Remove unused functions/templates
Avoid -Wformat-signedness warnings
Avoid -Wdouble-promotion warnings
Simplify use of rand() in base64 tests Just use the result of rand() directly. Avoids -Wdouble-promotion warnings.
Avoid -Wshift-sign-overflow warning
Use float consistently in wxRibbon art color handling The underlying calculations are done using floats. Avoids -Wfloat-conversion warnings.
| ... | ... | @@ -1703,7 +1703,7 @@ wxCairoBitmapData::wxCairoBitmapData( wxGraphicsRenderer* renderer, const wxBitm |
| 1703 | 1703 | // the upper 8 bits unused. Red, Green, and Blue are stored in
|
| 1704 | 1704 | // the remaining 24 bits in that order. The 32-bit quantities
|
| 1705 | 1705 | // are stored native-endian.
|
| 1706 | - *data = (wxALPHA_OPAQUE << 24 | p.Red() << 16 | p.Green() << 8 | p.Blue() );
|
|
| 1706 | + *data = wxUint32(wxALPHA_OPAQUE) << 24 | p.Red() << 16 | p.Green() << 8 | p.Blue();
|
|
| 1707 | 1707 | ++data;
|
| 1708 | 1708 | ++p;
|
| 1709 | 1709 | }
|
| ... | ... | @@ -232,27 +232,27 @@ void wxRibbonAUIArtProvider::SetColourScheme( |
| 232 | 232 | // TODO: Remove next line once this provider stops piggybacking MSW
|
| 233 | 233 | wxRibbonMSWArtProvider::SetColourScheme(primary, secondary, tertiary);
|
| 234 | 234 | |
| 235 | - const auto LikePrimary = [primary_hsl](double luminance)
|
|
| 235 | + const auto LikePrimary = [primary_hsl](float luminance)
|
|
| 236 | 236 | {
|
| 237 | 237 | return wxRibbonShiftLuminance(primary_hsl, luminance).ToRGB();
|
| 238 | 238 | };
|
| 239 | - const auto LikeSecondary = [secondary_hsl](double luminance)
|
|
| 239 | + const auto LikeSecondary = [secondary_hsl](float luminance)
|
|
| 240 | 240 | {
|
| 241 | 241 | return wxRibbonShiftLuminance(secondary_hsl, luminance).ToRGB();
|
| 242 | 242 | };
|
| 243 | 243 | |
| 244 | - m_tab_ctrl_background_colour = LikePrimary(0.9);
|
|
| 244 | + m_tab_ctrl_background_colour = LikePrimary(0.9f);
|
|
| 245 | 245 | #ifdef __WXOSX__
|
| 246 | 246 | m_tab_ctrl_background_gradient_colour = m_tab_ctrl_background_colour;
|
| 247 | 247 | #else
|
| 248 | - m_tab_ctrl_background_gradient_colour = LikePrimary(1.7);
|
|
| 248 | + m_tab_ctrl_background_gradient_colour = LikePrimary(1.7f);
|
|
| 249 | 249 | #endif
|
| 250 | 250 | m_tab_border_pen = LikePrimary(0.75);
|
| 251 | 251 | #ifdef __WXOSX__
|
| 252 | 252 | m_tab_label_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_CAPTIONTEXT);
|
| 253 | 253 | #else
|
| 254 | 254 | m_tab_label_colour = wxSystemSettings::SelectLightDark(
|
| 255 | - LikePrimary(0.1),
|
|
| 255 | + LikePrimary(0.1f),
|
|
| 256 | 256 | wxSystemSettings::GetColour(wxSYS_COLOUR_CAPTIONTEXT));
|
| 257 | 257 | #endif
|
| 258 | 258 | m_tab_active_label_colour = m_tab_label_colour;
|
| ... | ... | @@ -261,7 +261,7 @@ void wxRibbonAUIArtProvider::SetColourScheme( |
| 261 | 261 | #ifdef __WXOSX__
|
| 262 | 262 | m_tab_hover_background_top_gradient_colour = m_tab_hover_background_top_colour;
|
| 263 | 263 | #else
|
| 264 | - m_tab_hover_background_top_gradient_colour = LikePrimary(1.6);
|
|
| 264 | + m_tab_hover_background_top_gradient_colour = LikePrimary(1.6f);
|
|
| 265 | 265 | #endif
|
| 266 | 266 | m_tab_hover_background_brush = m_tab_hover_background_top_colour;
|
| 267 | 267 | m_tab_active_background_colour = m_tab_ctrl_background_gradient_colour;
|
| ... | ... | @@ -278,14 +278,14 @@ void wxRibbonAUIArtProvider::SetColourScheme( |
| 278 | 278 | m_panel_border_pen = m_tab_border_pen;
|
| 279 | 279 | m_background_brush = primary_hsl.ToRGB();
|
| 280 | 280 | m_page_hover_background_colour = LikePrimary(1.5);
|
| 281 | - m_page_hover_background_gradient_colour = LikePrimary(0.9);
|
|
| 282 | - m_panel_label_background_colour = LikePrimary(0.85);
|
|
| 283 | - m_panel_label_background_gradient_colour = LikePrimary(0.97);
|
|
| 281 | + m_page_hover_background_gradient_colour = LikePrimary(0.9f);
|
|
| 282 | + m_panel_label_background_colour = LikePrimary(0.85f);
|
|
| 283 | + m_panel_label_background_gradient_colour = LikePrimary(0.97f);
|
|
| 284 | 284 | m_panel_hover_label_background_gradient_colour = secondary_hsl.ToRGB();
|
| 285 | 285 | m_panel_hover_label_background_colour = secondary_hsl.AdjustLuminance(0.2f).ToRGB();
|
| 286 | 286 | m_button_bar_hover_border_pen = secondary_hsl.ToRGB();
|
| 287 | - m_button_bar_hover_background_brush = LikeSecondary(1.7);
|
|
| 288 | - m_button_bar_active_background_brush = LikeSecondary(1.4);
|
|
| 287 | + m_button_bar_hover_background_brush = LikeSecondary(1.7f);
|
|
| 288 | + m_button_bar_active_background_brush = LikeSecondary(1.4f);
|
|
| 289 | 289 | m_button_bar_label_colour = m_tab_label_colour;
|
| 290 | 290 | #ifdef __WXOSX__
|
| 291 | 291 | m_button_bar_label_disabled_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_INACTIVECAPTIONTEXT);
|
| ... | ... | @@ -294,18 +294,18 @@ void wxRibbonAUIArtProvider::SetColourScheme( |
| 294 | 294 | #endif
|
| 295 | 295 | m_gallery_border_pen = m_tab_border_pen;
|
| 296 | 296 | m_gallery_item_border_pen = m_button_bar_hover_border_pen;
|
| 297 | - m_gallery_hover_background_brush = LikePrimary(1.2);
|
|
| 297 | + m_gallery_hover_background_brush = LikePrimary(1.2f);
|
|
| 298 | 298 | m_gallery_button_background_colour = m_page_hover_background_colour;
|
| 299 | 299 | m_gallery_button_background_gradient_colour = m_page_hover_background_gradient_colour;
|
| 300 | 300 | m_gallery_button_hover_background_brush = m_button_bar_hover_background_brush;
|
| 301 | 301 | m_gallery_button_active_background_brush = m_button_bar_active_background_brush;
|
| 302 | 302 | m_gallery_button_disabled_background_brush = primary_hsl.Desaturated(0.15f).ToRGB();
|
| 303 | - SetColour(wxRIBBON_ART_GALLERY_BUTTON_FACE_COLOUR, LikePrimary(0.1));
|
|
| 303 | + SetColour(wxRIBBON_ART_GALLERY_BUTTON_FACE_COLOUR, LikePrimary(0.1f));
|
|
| 304 | 304 | SetColour(wxRIBBON_ART_GALLERY_BUTTON_DISABLED_FACE_COLOUR, wxColour(128, 128, 128));
|
| 305 | - SetColour(wxRIBBON_ART_GALLERY_BUTTON_ACTIVE_FACE_COLOUR, LikeSecondary(0.1));
|
|
| 306 | - SetColour(wxRIBBON_ART_GALLERY_BUTTON_HOVER_FACE_COLOUR, LikeSecondary(0.1));
|
|
| 305 | + SetColour(wxRIBBON_ART_GALLERY_BUTTON_ACTIVE_FACE_COLOUR, LikeSecondary(0.1f));
|
|
| 306 | + SetColour(wxRIBBON_ART_GALLERY_BUTTON_HOVER_FACE_COLOUR, LikeSecondary(0.1f));
|
|
| 307 | 307 | m_toolbar_border_pen = m_tab_border_pen;
|
| 308 | - SetColour(wxRIBBON_ART_TOOLBAR_FACE_COLOUR, LikePrimary(0.1));
|
|
| 308 | + SetColour(wxRIBBON_ART_TOOLBAR_FACE_COLOUR, LikePrimary(0.1f));
|
|
| 309 | 309 | m_tool_background_colour = m_page_hover_background_colour;
|
| 310 | 310 | m_tool_background_gradient_colour = m_page_hover_background_gradient_colour;
|
| 311 | 311 | m_toolbar_hover_borden_pen = m_button_bar_hover_border_pen;
|
| ... | ... | @@ -370,116 +370,116 @@ void wxRibbonMSWArtProvider::SetColourScheme( |
| 370 | 370 | secondary_hsl.luminance = std::cos(secondary_hsl.luminance * float(M_PI)) * -0.4f + 0.5f;
|
| 371 | 371 | |
| 372 | 372 | const auto LikePrimary = [primary_hsl, primary_is_gray]
|
| 373 | - (double h, double s, double l)
|
|
| 373 | + (float h, float s, float l)
|
|
| 374 | 374 | {
|
| 375 | - return primary_hsl.ShiftHue(h).Saturated(primary_is_gray ? 0.0 : s)
|
|
| 375 | + return primary_hsl.ShiftHue(h).Saturated(primary_is_gray ? 0.0f : s)
|
|
| 376 | 376 | .AdjustLuminance(l).ToRGB();
|
| 377 | 377 | };
|
| 378 | 378 | const auto LikeSecondary = [secondary_hsl, secondary_is_gray]
|
| 379 | - (double h, double s, double l)
|
|
| 379 | + (float h, float s, float l)
|
|
| 380 | 380 | {
|
| 381 | - return secondary_hsl.ShiftHue(h).Saturated(secondary_is_gray ? 0.0 : s)
|
|
| 381 | + return secondary_hsl.ShiftHue(h).Saturated(secondary_is_gray ? 0.0f : s)
|
|
| 382 | 382 | .AdjustLuminance(l).ToRGB();
|
| 383 | 383 | };
|
| 384 | 384 | |
| 385 | - m_page_border_pen = LikePrimary(1.4, 0.00, -0.08);
|
|
| 386 | - |
|
| 387 | - m_page_background_top_colour = LikePrimary(-0.1, -0.03, 0.12);
|
|
| 388 | - m_page_hover_background_top_colour = LikePrimary(-2.8, 0.27, 0.17);
|
|
| 389 | - m_page_background_top_gradient_colour = LikePrimary(0.1, -0.10, 0.08);
|
|
| 390 | - m_page_hover_background_top_gradient_colour = LikePrimary(3.2, 0.16, 0.13);
|
|
| 391 | - m_page_background_colour = LikePrimary(0.4, -0.09, 0.05);
|
|
| 392 | - m_page_hover_background_colour = LikePrimary(0.1, 0.19, 0.10);
|
|
| 393 | - m_page_background_gradient_colour = LikePrimary(-3.2, 0.27, 0.10);
|
|
| 394 | - m_page_hover_background_gradient_colour = LikePrimary(1.8, 0.01, 0.15);
|
|
| 395 | - |
|
| 396 | - m_tab_active_background_colour = LikePrimary(-0.1, -0.31, 0.16);
|
|
| 397 | - m_tab_active_background_gradient_colour = LikePrimary(-0.1, -0.03, 0.12);
|
|
| 398 | - m_tab_separator_colour = LikePrimary(0.9, 0.24, 0.05);
|
|
| 399 | - m_tab_ctrl_background_brush = LikePrimary(1.0, 0.39, 0.07);
|
|
| 400 | - m_tab_hover_background_colour = LikePrimary(1.3, 0.15, 0.10);
|
|
| 401 | - m_tab_hover_background_top_colour = LikePrimary(1.4, 0.36, 0.08);
|
|
| 402 | - m_tab_border_pen = LikePrimary(1.4, 0.03, -0.05);
|
|
| 403 | - m_tab_separator_gradient_colour = LikePrimary(1.7, -0.15, -0.18);
|
|
| 404 | - m_tab_hover_background_top_gradient_colour = LikePrimary(1.8, 0.34, 0.13);
|
|
| 405 | - m_tab_label_colour = LikePrimary(4.3, 0.13, -0.49);
|
|
| 385 | + m_page_border_pen = LikePrimary(1.4f, 0.00f, -0.08f);
|
|
| 386 | + |
|
| 387 | + m_page_background_top_colour = LikePrimary(-0.1f, -0.03f, 0.12f);
|
|
| 388 | + m_page_hover_background_top_colour = LikePrimary(-2.8f, 0.27f, 0.17f);
|
|
| 389 | + m_page_background_top_gradient_colour = LikePrimary(0.1f, -0.10f, 0.08f);
|
|
| 390 | + m_page_hover_background_top_gradient_colour = LikePrimary(3.2f, 0.16f, 0.13f);
|
|
| 391 | + m_page_background_colour = LikePrimary(0.4f, -0.09f, 0.05f);
|
|
| 392 | + m_page_hover_background_colour = LikePrimary(0.1f, 0.19f, 0.10f);
|
|
| 393 | + m_page_background_gradient_colour = LikePrimary(-3.2f, 0.27f, 0.10f);
|
|
| 394 | + m_page_hover_background_gradient_colour = LikePrimary(1.8f, 0.01f, 0.15f);
|
|
| 395 | + |
|
| 396 | + m_tab_active_background_colour = LikePrimary(-0.1f, -0.31f, 0.16f);
|
|
| 397 | + m_tab_active_background_gradient_colour = LikePrimary(-0.1f, -0.03f, 0.12f);
|
|
| 398 | + m_tab_separator_colour = LikePrimary(0.9f, 0.24f, 0.05f);
|
|
| 399 | + m_tab_ctrl_background_brush = LikePrimary(1.0f, 0.39f, 0.07f);
|
|
| 400 | + m_tab_hover_background_colour = LikePrimary(1.3f, 0.15f, 0.10f);
|
|
| 401 | + m_tab_hover_background_top_colour = LikePrimary(1.4f, 0.36f, 0.08f);
|
|
| 402 | + m_tab_border_pen = LikePrimary(1.4f, 0.03f, -0.05f);
|
|
| 403 | + m_tab_separator_gradient_colour = LikePrimary(1.7f, -0.15f, -0.18f);
|
|
| 404 | + m_tab_hover_background_top_gradient_colour = LikePrimary(1.8f, 0.34f, 0.13f);
|
|
| 405 | + m_tab_label_colour = LikePrimary(4.3f, 0.13f, -0.49f);
|
|
| 406 | 406 | m_tab_active_label_colour = m_tab_label_colour;
|
| 407 | 407 | m_tab_hover_label_colour = m_tab_label_colour;
|
| 408 | - m_tab_hover_background_gradient_colour = LikeSecondary(-1.5, -0.34, 0.01);
|
|
| 409 | - |
|
| 410 | - m_panel_minimised_border_gradient_pen = LikePrimary(-6.9, -0.17, -0.09);
|
|
| 411 | - m_panel_minimised_border_pen = LikePrimary(-5.3, -0.24, -0.06);
|
|
| 412 | - m_panel_hover_border_gradient_pen = m_panel_border_gradient_pen = LikePrimary(-5.2, -0.15, -0.06);
|
|
| 413 | - m_panel_hover_border_pen = m_panel_border_pen = LikePrimary(-2.8, -0.32, 0.02);
|
|
| 414 | - m_panel_label_background_brush = LikePrimary(-1.5, 0.03, 0.05);
|
|
| 415 | - m_panel_active_background_gradient_colour = LikePrimary(0.5, 0.34, 0.05);
|
|
| 416 | - m_panel_hover_label_background_brush = LikePrimary(1.0, 0.30, 0.09);
|
|
| 417 | - m_panel_active_background_top_gradient_colour = LikePrimary(1.4, -0.17, -0.13);
|
|
| 418 | - m_panel_active_background_colour = LikePrimary(1.6, -0.18, -0.18);
|
|
| 419 | - m_panel_active_background_top_colour = LikePrimary(1.7, -0.20, -0.03);
|
|
| 420 | - m_panel_label_colour = LikePrimary(2.8, -0.14, -0.35);
|
|
| 408 | + m_tab_hover_background_gradient_colour = LikeSecondary(-1.5f, -0.34f, 0.01f);
|
|
| 409 | + |
|
| 410 | + m_panel_minimised_border_gradient_pen = LikePrimary(-6.9f, -0.17f, -0.09f);
|
|
| 411 | + m_panel_minimised_border_pen = LikePrimary(-5.3f, -0.24f, -0.06f);
|
|
| 412 | + m_panel_hover_border_gradient_pen = m_panel_border_gradient_pen = LikePrimary(-5.2f, -0.15f, -0.06f);
|
|
| 413 | + m_panel_hover_border_pen = m_panel_border_pen = LikePrimary(-2.8f, -0.32f, 0.02f);
|
|
| 414 | + m_panel_label_background_brush = LikePrimary(-1.5f, 0.03f, 0.05f);
|
|
| 415 | + m_panel_active_background_gradient_colour = LikePrimary(0.5f, 0.34f, 0.05f);
|
|
| 416 | + m_panel_hover_label_background_brush = LikePrimary(1.0f, 0.30f, 0.09f);
|
|
| 417 | + m_panel_active_background_top_gradient_colour = LikePrimary(1.4f, -0.17f, -0.13f);
|
|
| 418 | + m_panel_active_background_colour = LikePrimary(1.6f, -0.18f, -0.18f);
|
|
| 419 | + m_panel_active_background_top_colour = LikePrimary(1.7f, -0.20f, -0.03f);
|
|
| 420 | + m_panel_label_colour = LikePrimary(2.8f, -0.14f, -0.35f);
|
|
| 421 | 421 | m_panel_hover_label_colour = m_panel_label_colour;
|
| 422 | 422 | m_panel_minimised_label_colour = m_tab_label_colour;
|
| 423 | - m_panel_hover_button_background_brush = LikeSecondary(-0.9, 0.16, -0.07);
|
|
| 424 | - m_panel_hover_button_border_pen = LikeSecondary(-3.9, -0.16, -0.14);
|
|
| 425 | - SetColour(wxRIBBON_ART_PANEL_BUTTON_FACE_COLOUR, LikePrimary(1.4, -0.21, -0.23));
|
|
| 426 | - SetColour(wxRIBBON_ART_PANEL_BUTTON_HOVER_FACE_COLOUR, LikePrimary(1.5, -0.24, -0.29));
|
|
| 427 | - |
|
| 428 | - m_ribbon_toggle_brush = LikeSecondary(-0.9, 0.16, -0.07);
|
|
| 429 | - m_ribbon_toggle_pen = LikeSecondary(-3.9, -0.16, -0.14);
|
|
| 430 | - SetColour(wxRIBBON_ART_PAGE_TOGGLE_FACE_COLOUR, LikePrimary(1.7, -0.20, -0.15));
|
|
| 431 | - SetColour(wxRIBBON_ART_PAGE_TOGGLE_HOVER_FACE_COLOUR, LikePrimary(1.8, -0.23, -0.21));
|
|
| 432 | - |
|
| 433 | - m_gallery_button_disabled_background_colour = LikePrimary(-2.8, -0.46, 0.09);
|
|
| 434 | - m_gallery_button_disabled_background_top_brush = LikePrimary(-2.8, -0.36, 0.15);
|
|
| 435 | - m_gallery_hover_background_brush = LikePrimary(-0.8, 0.05, 0.15);
|
|
| 436 | - m_gallery_border_pen = LikePrimary(0.7, -0.02, 0.03);
|
|
| 437 | - m_gallery_button_background_top_brush = LikePrimary(0.8, 0.34, 0.13);
|
|
| 438 | - m_gallery_button_background_colour = LikePrimary(1.3, 0.10, 0.08);
|
|
| 423 | + m_panel_hover_button_background_brush = LikeSecondary(-0.9f, 0.16f, -0.07f);
|
|
| 424 | + m_panel_hover_button_border_pen = LikeSecondary(-3.9f, -0.16f, -0.14f);
|
|
| 425 | + SetColour(wxRIBBON_ART_PANEL_BUTTON_FACE_COLOUR, LikePrimary(1.4f, -0.21f, -0.23f));
|
|
| 426 | + SetColour(wxRIBBON_ART_PANEL_BUTTON_HOVER_FACE_COLOUR, LikePrimary(1.5f, -0.24f, -0.29f));
|
|
| 427 | + |
|
| 428 | + m_ribbon_toggle_brush = LikeSecondary(-0.9f, 0.16f, -0.07f);
|
|
| 429 | + m_ribbon_toggle_pen = LikeSecondary(-3.9f, -0.16f, -0.14f);
|
|
| 430 | + SetColour(wxRIBBON_ART_PAGE_TOGGLE_FACE_COLOUR, LikePrimary(1.7f, -0.20f, -0.15f));
|
|
| 431 | + SetColour(wxRIBBON_ART_PAGE_TOGGLE_HOVER_FACE_COLOUR, LikePrimary(1.8f, -0.23f, -0.21f));
|
|
| 432 | + |
|
| 433 | + m_gallery_button_disabled_background_colour = LikePrimary(-2.8f, -0.46f, 0.09f);
|
|
| 434 | + m_gallery_button_disabled_background_top_brush = LikePrimary(-2.8f, -0.36f, 0.15f);
|
|
| 435 | + m_gallery_hover_background_brush = LikePrimary(-0.8f, 0.05f, 0.15f);
|
|
| 436 | + m_gallery_border_pen = LikePrimary(0.7f, -0.02f, 0.03f);
|
|
| 437 | + m_gallery_button_background_top_brush = LikePrimary(0.8f, 0.34f, 0.13f);
|
|
| 438 | + m_gallery_button_background_colour = LikePrimary(1.3f, 0.10f, 0.08f);
|
|
| 439 | 439 | // SetColour used so that the relevant bitmaps are generated
|
| 440 | - SetColour(wxRIBBON_ART_GALLERY_BUTTON_FACE_COLOUR, LikePrimary(1.4, -0.21, -0.23));
|
|
| 441 | - SetColour(wxRIBBON_ART_GALLERY_BUTTON_HOVER_FACE_COLOUR, LikePrimary(1.5, -0.24, -0.29));
|
|
| 442 | - SetColour(wxRIBBON_ART_GALLERY_BUTTON_ACTIVE_FACE_COLOUR, LikePrimary(1.5, -0.24, -0.29));
|
|
| 443 | - SetColour(wxRIBBON_ART_GALLERY_BUTTON_DISABLED_FACE_COLOUR, LikePrimary(0.0, -1.0, 0.0));
|
|
| 444 | - m_gallery_button_disabled_background_gradient_colour = LikePrimary(1.5, -0.43, 0.12);
|
|
| 445 | - m_gallery_button_background_gradient_colour = LikePrimary(1.7, 0.11, 0.09);
|
|
| 446 | - m_gallery_item_border_pen = LikeSecondary(-3.9, -0.16, -0.14);
|
|
| 447 | - m_gallery_button_hover_background_colour = LikeSecondary(-0.9, 0.16, -0.07);
|
|
| 448 | - m_gallery_button_hover_background_gradient_colour = LikeSecondary(0.1, 0.12, 0.03);
|
|
| 449 | - m_gallery_button_hover_background_top_brush = LikeSecondary(4.3, 0.16, 0.17);
|
|
| 450 | - |
|
| 451 | - m_gallery_button_active_background_colour = LikeSecondary(-9.9, 0.03, -0.22);
|
|
| 452 | - m_gallery_button_active_background_gradient_colour = LikeSecondary(-9.5, 0.14, -0.11);
|
|
| 453 | - m_gallery_button_active_background_top_brush = LikeSecondary(-9.0, 0.15, -0.08);
|
|
| 440 | + SetColour(wxRIBBON_ART_GALLERY_BUTTON_FACE_COLOUR, LikePrimary(1.4f, -0.21f, -0.23f));
|
|
| 441 | + SetColour(wxRIBBON_ART_GALLERY_BUTTON_HOVER_FACE_COLOUR, LikePrimary(1.5f, -0.24f, -0.29f));
|
|
| 442 | + SetColour(wxRIBBON_ART_GALLERY_BUTTON_ACTIVE_FACE_COLOUR, LikePrimary(1.5f, -0.24f, -0.29f));
|
|
| 443 | + SetColour(wxRIBBON_ART_GALLERY_BUTTON_DISABLED_FACE_COLOUR, LikePrimary(0.0f, -1.0f, 0.0f));
|
|
| 444 | + m_gallery_button_disabled_background_gradient_colour = LikePrimary(1.5f, -0.43f, 0.12f);
|
|
| 445 | + m_gallery_button_background_gradient_colour = LikePrimary(1.7f, 0.11f, 0.09f);
|
|
| 446 | + m_gallery_item_border_pen = LikeSecondary(-3.9f, -0.16f, -0.14f);
|
|
| 447 | + m_gallery_button_hover_background_colour = LikeSecondary(-0.9f, 0.16f, -0.07f);
|
|
| 448 | + m_gallery_button_hover_background_gradient_colour = LikeSecondary(0.1f, 0.12f, 0.03f);
|
|
| 449 | + m_gallery_button_hover_background_top_brush = LikeSecondary(4.3f, 0.16f, 0.17f);
|
|
| 450 | + |
|
| 451 | + m_gallery_button_active_background_colour = LikeSecondary(-9.9f, 0.03f, -0.22f);
|
|
| 452 | + m_gallery_button_active_background_gradient_colour = LikeSecondary(-9.5f, 0.14f, -0.11f);
|
|
| 453 | + m_gallery_button_active_background_top_brush = LikeSecondary(-9.0f, 0.15f, -0.08f);
|
|
| 454 | 454 | |
| 455 | 455 | m_button_bar_label_colour = m_tab_label_colour;
|
| 456 | 456 | m_button_bar_label_disabled_colour = m_tab_label_colour;
|
| 457 | 457 | |
| 458 | - m_button_bar_hover_border_pen = LikeSecondary(-6.2, -0.47, -0.14);
|
|
| 459 | - m_button_bar_hover_background_gradient_colour = LikeSecondary(-0.6, 0.16, 0.04);
|
|
| 460 | - m_button_bar_hover_background_colour = LikeSecondary(-0.2, 0.16, -0.10);
|
|
| 461 | - m_button_bar_hover_background_top_gradient_colour = LikeSecondary(0.2, 0.16, 0.03);
|
|
| 462 | - m_button_bar_hover_background_top_colour = LikeSecondary(8.8, 0.16, 0.17);
|
|
| 463 | - m_button_bar_active_border_pen = LikeSecondary(-6.2, -0.47, -0.25);
|
|
| 464 | - m_button_bar_active_background_top_colour = LikeSecondary(-8.4, 0.08, 0.06);
|
|
| 465 | - m_button_bar_active_background_top_gradient_colour = LikeSecondary(-9.7, 0.13, -0.07);
|
|
| 466 | - m_button_bar_active_background_colour = LikeSecondary(-9.9, 0.14, -0.14);
|
|
| 467 | - m_button_bar_active_background_gradient_colour = LikeSecondary(-8.7, 0.17, -0.03);
|
|
| 468 | - |
|
| 469 | - m_toolbar_border_pen = LikePrimary(1.4, -0.21, -0.16);
|
|
| 470 | - SetColour(wxRIBBON_ART_TOOLBAR_FACE_COLOUR, LikePrimary(1.4, -0.17, -0.22));
|
|
| 471 | - m_tool_background_top_colour = LikePrimary(-1.9, -0.07, 0.06);
|
|
| 472 | - m_tool_background_top_gradient_colour = LikePrimary(1.4, 0.12, 0.08);
|
|
| 473 | - m_tool_background_colour = LikePrimary(1.4, -0.09, 0.03);
|
|
| 474 | - m_tool_background_gradient_colour = LikePrimary(1.9, 0.11, 0.09);
|
|
| 475 | - m_tool_hover_background_top_colour = LikeSecondary(3.4, 0.11, 0.16);
|
|
| 476 | - m_tool_hover_background_top_gradient_colour = LikeSecondary(-1.4, 0.04, 0.08);
|
|
| 477 | - m_tool_hover_background_colour = LikeSecondary(-1.8, 0.16, -0.12);
|
|
| 478 | - m_tool_hover_background_gradient_colour = LikeSecondary(-2.6, 0.16, 0.05);
|
|
| 479 | - m_tool_active_background_top_colour = LikeSecondary(-9.9, -0.12, -0.09);
|
|
| 480 | - m_tool_active_background_top_gradient_colour = LikeSecondary(-8.5, 0.16, -0.12);
|
|
| 481 | - m_tool_active_background_colour = LikeSecondary(-7.9, 0.16, -0.20);
|
|
| 482 | - m_tool_active_background_gradient_colour = LikeSecondary(-6.6, 0.16, -0.10);
|
|
| 458 | + m_button_bar_hover_border_pen = LikeSecondary(-6.2f, -0.47f, -0.14f);
|
|
| 459 | + m_button_bar_hover_background_gradient_colour = LikeSecondary(-0.6f, 0.16f, 0.04f);
|
|
| 460 | + m_button_bar_hover_background_colour = LikeSecondary(-0.2f, 0.16f, -0.10f);
|
|
| 461 | + m_button_bar_hover_background_top_gradient_colour = LikeSecondary(0.2f, 0.16f, 0.03f);
|
|
| 462 | + m_button_bar_hover_background_top_colour = LikeSecondary(8.8f, 0.16f, 0.17f);
|
|
| 463 | + m_button_bar_active_border_pen = LikeSecondary(-6.2f, -0.47f, -0.25f);
|
|
| 464 | + m_button_bar_active_background_top_colour = LikeSecondary(-8.4f, 0.08f, 0.06f);
|
|
| 465 | + m_button_bar_active_background_top_gradient_colour = LikeSecondary(-9.7f, 0.13f, -0.07f);
|
|
| 466 | + m_button_bar_active_background_colour = LikeSecondary(-9.9f, 0.14f, -0.14f);
|
|
| 467 | + m_button_bar_active_background_gradient_colour = LikeSecondary(-8.7f, 0.17f, -0.03f);
|
|
| 468 | + |
|
| 469 | + m_toolbar_border_pen = LikePrimary(1.4f, -0.21f, -0.16f);
|
|
| 470 | + SetColour(wxRIBBON_ART_TOOLBAR_FACE_COLOUR, LikePrimary(1.4f, -0.17f, -0.22f));
|
|
| 471 | + m_tool_background_top_colour = LikePrimary(-1.9f, -0.07f, 0.06f);
|
|
| 472 | + m_tool_background_top_gradient_colour = LikePrimary(1.4f, 0.12f, 0.08f);
|
|
| 473 | + m_tool_background_colour = LikePrimary(1.4f, -0.09f, 0.03f);
|
|
| 474 | + m_tool_background_gradient_colour = LikePrimary(1.9f, 0.11f, 0.09f);
|
|
| 475 | + m_tool_hover_background_top_colour = LikeSecondary(3.4f, 0.11f, 0.16f);
|
|
| 476 | + m_tool_hover_background_top_gradient_colour = LikeSecondary(-1.4f, 0.04f, 0.08f);
|
|
| 477 | + m_tool_hover_background_colour = LikeSecondary(-1.8f, 0.16f, -0.12f);
|
|
| 478 | + m_tool_hover_background_gradient_colour = LikeSecondary(-2.6f, 0.16f, 0.05f);
|
|
| 479 | + m_tool_active_background_top_colour = LikeSecondary(-9.9f, -0.12f, -0.09f);
|
|
| 480 | + m_tool_active_background_top_gradient_colour = LikeSecondary(-8.5f, 0.16f, -0.12f);
|
|
| 481 | + m_tool_active_background_colour = LikeSecondary(-7.9f, 0.16f, -0.20f);
|
|
| 482 | + m_tool_active_background_gradient_colour = LikeSecondary(-6.6f, 0.16f, -0.10f);
|
|
| 483 | 483 | |
| 484 | 484 | //For highlight pages we show a colour between the active page and for a hovered page:
|
| 485 | 485 | wxColour top_colour1((m_tab_active_background_colour.Red() + m_tab_hover_background_top_colour.Red())/2,
|
| ... | ... | @@ -205,9 +205,9 @@ void wxAnyTestCase::Equality() |
| 205 | 205 | CPPUNIT_ASSERT_DOUBLES_EQUAL(m_anyFloatDouble1.As<double>(),
|
| 206 | 206 | m_anyDoubleDouble1.As<double>(),
|
| 207 | 207 | FEQ_DELTA);
|
| 208 | - CPPUNIT_ASSERT_DOUBLES_EQUAL(m_anyFloatDouble1.As<double>(),
|
|
| 208 | + CPPUNIT_ASSERT_DOUBLES_EQUAL(m_anyFloatDouble1.As<float>(),
|
|
| 209 | 209 | TEST_FLOAT_CONST,
|
| 210 | - FEQ_DELTA);
|
|
| 210 | + float(FEQ_DELTA));
|
|
| 211 | 211 | CPPUNIT_ASSERT(m_anyWxObjectPtr1.As<wxObject*>()
|
| 212 | 212 | == dummyWxObjectPointer);
|
| 213 | 213 | CPPUNIT_ASSERT(m_anyVoidPtr1.As<void*>() == dummyVoidPointer);
|
| ... | ... | @@ -220,9 +220,9 @@ void wxAnyTestCase::Equality() |
| 220 | 220 | CPPUNIT_ASSERT_DOUBLES_EQUAL(m_anyFloatDouble2.As<double>(),
|
| 221 | 221 | m_anyDoubleDouble2.As<double>(),
|
| 222 | 222 | FEQ_DELTA);
|
| 223 | - CPPUNIT_ASSERT_DOUBLES_EQUAL(m_anyFloatDouble2.As<double>(),
|
|
| 223 | + CPPUNIT_ASSERT_DOUBLES_EQUAL(m_anyFloatDouble2.As<float>(),
|
|
| 224 | 224 | TEST_FLOAT_CONST,
|
| 225 | - FEQ_DELTA);
|
|
| 225 | + float(FEQ_DELTA));
|
|
| 226 | 226 | CPPUNIT_ASSERT(m_anyWxObjectPtr2.As<wxObject*>()
|
| 227 | 227 | == dummyWxObjectPointer);
|
| 228 | 228 | CPPUNIT_ASSERT(m_anyVoidPtr2.As<void*>() == dummyVoidPointer);
|
| ... | ... | @@ -328,7 +328,7 @@ void wxAnyTestCase::GetAs() |
| 328 | 328 | CPPUNIT_ASSERT(s == "15");
|
| 329 | 329 | res = m_anySignedLong1.GetAs(&f);
|
| 330 | 330 | CPPUNIT_ASSERT(res);
|
| 331 | - CPPUNIT_ASSERT_DOUBLES_EQUAL(f, 15.0, FEQ_DELTA);
|
|
| 331 | + CPPUNIT_ASSERT_DOUBLES_EQUAL(f, 15.0f, float(FEQ_DELTA));
|
|
| 332 | 332 | res = m_anySignedLong1.GetAs(&b);
|
| 333 | 333 | CPPUNIT_ASSERT(res);
|
| 334 | 334 | CPPUNIT_ASSERT(b == true);
|
| ... | ... | @@ -342,7 +342,7 @@ void wxAnyTestCase::GetAs() |
| 342 | 342 | CPPUNIT_ASSERT(s == "15");
|
| 343 | 343 | res = m_anyUnsignedLong1.GetAs(&f);
|
| 344 | 344 | CPPUNIT_ASSERT(res);
|
| 345 | - CPPUNIT_ASSERT_DOUBLES_EQUAL(f, 15.0, FEQ_DELTA);
|
|
| 345 | + CPPUNIT_ASSERT_DOUBLES_EQUAL(f, 15.0f, float(FEQ_DELTA));
|
|
| 346 | 346 | res = m_anyUnsignedLong1.GetAs(&b);
|
| 347 | 347 | CPPUNIT_ASSERT(res);
|
| 348 | 348 | CPPUNIT_ASSERT(b == true);
|
| ... | ... | @@ -366,7 +366,7 @@ void wxAnyTestCase::GetAs() |
| 366 | 366 | CPPUNIT_ASSERT_EQUAL(ul, static_cast<unsigned long>(15));
|
| 367 | 367 | res = anyString.GetAs(&f);
|
| 368 | 368 | CPPUNIT_ASSERT(res);
|
| 369 | - CPPUNIT_ASSERT_DOUBLES_EQUAL(f, 15.0, FEQ_DELTA);
|
|
| 369 | + CPPUNIT_ASSERT_DOUBLES_EQUAL(f, 15.0f, float(FEQ_DELTA));
|
|
| 370 | 370 | anyString = "TRUE";
|
| 371 | 371 | res = anyString.GetAs(&b);
|
| 372 | 372 | CPPUNIT_ASSERT(res);
|
| ... | ... | @@ -400,7 +400,7 @@ void wxAnyTestCase::GetAs() |
| 400 | 400 | double d2;
|
| 401 | 401 | res = s.ToCDouble(&d2);
|
| 402 | 402 | CPPUNIT_ASSERT(res);
|
| 403 | - CPPUNIT_ASSERT_DOUBLES_EQUAL(d2, TEST_FLOAT_CONST, FEQ_DELTA);
|
|
| 403 | + CPPUNIT_ASSERT_DOUBLES_EQUAL(d2, TEST_DOUBLE_CONST, FEQ_DELTA);
|
|
| 404 | 404 | }
|
| 405 | 405 | |
| 406 | 406 | |
| ... | ... | @@ -502,7 +502,7 @@ void wxAnyTestCase::wxVariantConversions() |
| 502 | 502 | // Prepare wxVariants
|
| 503 | 503 | wxVariant vLong(123L);
|
| 504 | 504 | wxVariant vString("ABC");
|
| 505 | - wxVariant vDouble(TEST_FLOAT_CONST);
|
|
| 505 | + wxVariant vDouble(TEST_DOUBLE_CONST);
|
|
| 506 | 506 | wxVariant vBool((bool)true);
|
| 507 | 507 | wxVariant vChar('A');
|
| 508 | 508 | wxVariant vLongLong(wxLongLong(wxLL(0xAABBBBCCCC)));
|
| ... | ... | @@ -560,11 +560,11 @@ void wxAnyTestCase::wxVariantConversions() |
| 560 | 560 | |
| 561 | 561 | any = vDouble;
|
| 562 | 562 | double d = any.As<double>();
|
| 563 | - CPPUNIT_ASSERT_DOUBLES_EQUAL(d, TEST_FLOAT_CONST, FEQ_DELTA);
|
|
| 563 | + CPPUNIT_ASSERT_DOUBLES_EQUAL(d, TEST_DOUBLE_CONST, FEQ_DELTA);
|
|
| 564 | 564 | res = any.GetAs(&variant);
|
| 565 | 565 | CPPUNIT_ASSERT(res);
|
| 566 | 566 | CPPUNIT_ASSERT_DOUBLES_EQUAL(variant.GetDouble(),
|
| 567 | - TEST_FLOAT_CONST,
|
|
| 567 | + TEST_DOUBLE_CONST,
|
|
| 568 | 568 | FEQ_DELTA);
|
| 569 | 569 | |
| 570 | 570 | any = vBool;
|
| ... | ... | @@ -49,7 +49,7 @@ static void generateRandomData(void* buff, size_t len) |
| 49 | 49 | unsigned char *cbuff = (unsigned char *)buff;
|
| 50 | 50 | while(len--)
|
| 51 | 51 | {
|
| 52 | - *(cbuff++) = (unsigned char)((rand() / (float)RAND_MAX * 255.) + 1);
|
|
| 52 | + *(cbuff++) = (unsigned char)rand();
|
|
| 53 | 53 | }
|
| 54 | 54 | }
|
| 55 | 55 | |
| ... | ... | @@ -61,7 +61,7 @@ static void generateGibberish(void* buff, size_t len) |
| 61 | 61 | unsigned char *cbuff = (unsigned char *)buff;
|
| 62 | 62 | while(len--)
|
| 63 | 63 | {
|
| 64 | - *(cbuff++) = cb64[(size_t)((rand() / (float)RAND_MAX * 64.) + 1)];
|
|
| 64 | + *(cbuff++) = cb64[rand() & 63];
|
|
| 65 | 65 | }
|
| 66 | 66 | }
|
| 67 | 67 | |
| ... | ... | @@ -213,7 +213,7 @@ TEST_CASE("Encode Decode PatternC", "[base64]") |
| 213 | 213 | |
| 214 | 214 | TEST_CASE("Encode Decode Random", "[base64]")
|
| 215 | 215 | {
|
| 216 | - size_t size = (size_t)(rand() / (float)RAND_MAX * 3000. + 11);
|
|
| 216 | + size_t size = (rand() & 0xfff) + 11;
|
|
| 217 | 217 | unsigned char *buff = new unsigned char[size];
|
| 218 | 218 | generateRandomData(buff, size);
|
| 219 | 219 | wxString str = wxBase64Encode(buff, size);
|
| ... | ... | @@ -254,28 +254,6 @@ WaitForEventAt( |
| 254 | 254 | |
| 255 | 255 | } // anonymous namespace
|
| 256 | 256 | |
| 257 | -namespace Catch
|
|
| 258 | -{
|
|
| 259 | - |
|
| 260 | -template <> struct StringMaker<TestableGrid>
|
|
| 261 | -{
|
|
| 262 | - static std::string convert(const TestableGrid& grid)
|
|
| 263 | - {
|
|
| 264 | - return ("Content before edit:\n" + grid.m_beforeGridAnnotated
|
|
| 265 | - + "\nContent after edit:\n" + grid.ToString()).ToStdString();
|
|
| 266 | - }
|
|
| 267 | -};
|
|
| 268 | - |
|
| 269 | -template <> struct StringMaker<Multicell>
|
|
| 270 | -{
|
|
| 271 | - static std::string convert(const Multicell& multi)
|
|
| 272 | - {
|
|
| 273 | - return multi.ToString().ToStdString();
|
|
| 274 | - }
|
|
| 275 | -};
|
|
| 276 | - |
|
| 277 | -} // namespace Catch
|
|
| 278 | - |
|
| 279 | 257 | class GridTestCase
|
| 280 | 258 | {
|
| 281 | 259 | public:
|
| ... | ... | @@ -293,34 +293,6 @@ TEST_CASE("wxDateTime::WDays", "[datetime]") |
| 293 | 293 | wxDateTime::WeekDay wday; // the weekday
|
| 294 | 294 | wxDateTime::Month month; // the month
|
| 295 | 295 | int year; // and the year
|
| 296 | - |
|
| 297 | - wxString Format() const
|
|
| 298 | - {
|
|
| 299 | - wxString s, which;
|
|
| 300 | - switch ( nWeek < -1 ? -nWeek : nWeek )
|
|
| 301 | - {
|
|
| 302 | - case 1: which = wxT("first"); break;
|
|
| 303 | - case 2: which = wxT("second"); break;
|
|
| 304 | - case 3: which = wxT("third"); break;
|
|
| 305 | - case 4: which = wxT("fourth"); break;
|
|
| 306 | - case 5: which = wxT("fifth"); break;
|
|
| 307 | - |
|
| 308 | - case -1: which = wxT("last"); break;
|
|
| 309 | - }
|
|
| 310 | - |
|
| 311 | - if ( nWeek < -1 )
|
|
| 312 | - {
|
|
| 313 | - which += wxT(" from end");
|
|
| 314 | - }
|
|
| 315 | - |
|
| 316 | - s.Printf(wxT("The %s %s of %s in %d"),
|
|
| 317 | - which.c_str(),
|
|
| 318 | - wxDateTime::GetWeekDayName(wday).c_str(),
|
|
| 319 | - wxDateTime::GetMonthName(month).c_str(),
|
|
| 320 | - year);
|
|
| 321 | - |
|
| 322 | - return s;
|
|
| 323 | - }
|
|
| 324 | 296 | };
|
| 325 | 297 | |
| 326 | 298 | // the array data was generated by the following python program
|
| ... | ... | @@ -3138,7 +3138,7 @@ static wxSize ParseEnvVarAsSize(const wxString& varname) |
| 3138 | 3138 | // Compute difference between the 2 images by summing up squares of (naively
|
| 3139 | 3139 | // computed, i.e. without any perception-based correction) distances between
|
| 3140 | 3140 | // colours for each pixel.
|
| 3141 | -static float ComputeImageDiff(const wxImage& img1, const wxImage& img2)
|
|
| 3141 | +static double ComputeImageDiff(const wxImage& img1, const wxImage& img2)
|
|
| 3142 | 3142 | {
|
| 3143 | 3143 | const wxSize size = img1.GetSize();
|
| 3144 | 3144 | |
| ... | ... | @@ -3155,10 +3155,10 @@ static float ComputeImageDiff(const wxImage& img1, const wxImage& img2) |
| 3155 | 3155 | p1 != end;
|
| 3156 | 3156 | p1 += 3, p2 += 3 )
|
| 3157 | 3157 | {
|
| 3158 | - diff += sqrt(sqr(p1[0] - p2[0]) + sqr(p1[1] - p2[1]) + sqr(p1[2] - p2[2]));
|
|
| 3158 | + diff += sqrtf(sqr(p1[0] - p2[0]) + sqr(p1[1] - p2[1]) + sqr(p1[2] - p2[2]));
|
|
| 3159 | 3159 | }
|
| 3160 | 3160 | |
| 3161 | - return diff / numPixels;
|
|
| 3161 | + return double(diff / numPixels);
|
|
| 3162 | 3162 | }
|
| 3163 | 3163 | |
| 3164 | 3164 | // The purpose of this test is to compute "resize quality" which is defined as
|
| ... | ... | @@ -37,8 +37,6 @@ public: |
| 37 | 37 | |
| 38 | 38 | static size_t GetNumber() { return ms_bars; }
|
| 39 | 39 | |
| 40 | - const wxChar *GetName() const { return m_name.c_str(); }
|
|
| 41 | - |
|
| 42 | 40 | private:
|
| 43 | 41 | wxString m_name;
|
| 44 | 42 |
| ... | ... | @@ -50,7 +50,7 @@ TEST_CASE("HexConvTestCase", "[string][hexconv]") |
| 50 | 50 | static void DecToHex1()
|
| 51 | 51 | {
|
| 52 | 52 | // Conversion to wxString
|
| 53 | - for ( int i = 0; i < 256; i++ )
|
|
| 53 | + for ( unsigned i = 0; i < 256; i++ )
|
|
| 54 | 54 | {
|
| 55 | 55 | char szHexStrRef[16];
|
| 56 | 56 | sprintf(szHexStrRef, "%02X", i);
|
| ... | ... | @@ -65,7 +65,7 @@ static void DecToHex1() |
| 65 | 65 | static void DecToHex2()
|
| 66 | 66 | {
|
| 67 | 67 | // Conversion to wxChar string
|
| 68 | - for ( int i = 0; i < 256; i++ )
|
|
| 68 | + for ( unsigned i = 0; i < 256; i++ )
|
|
| 69 | 69 | {
|
| 70 | 70 | char szHexStrRef[16];
|
| 71 | 71 | sprintf(szHexStrRef, "%02X", i);
|
| ... | ... | @@ -85,7 +85,7 @@ static void DecToHex2() |
| 85 | 85 | static void DecToHex3()
|
| 86 | 86 | {
|
| 87 | 87 | // Conversion to 2 characters
|
| 88 | - for ( int i = 0; i < 256; i++ )
|
|
| 88 | + for ( unsigned i = 0; i < 256; i++ )
|
|
| 89 | 89 | {
|
| 90 | 90 | char szHexStrRef[16];
|
| 91 | 91 | sprintf(szHexStrRef, "%02X", i);
|
| ... | ... | @@ -105,7 +105,7 @@ static void HexToDec1() |
| 105 | 105 | for ( int i = 0; i < 256; i++ )
|
| 106 | 106 | {
|
| 107 | 107 | char szHexStr[16];
|
| 108 | - sprintf(szHexStr, "%02X", i);
|
|
| 108 | + sprintf(szHexStr, "%02X", unsigned(i));
|
|
| 109 | 109 | |
| 110 | 110 | int n = wxHexToDec(szHexStr);
|
| 111 | 111 | CHECK(n == i);
|
| ... | ... | @@ -118,7 +118,7 @@ static void HexToDec2() |
| 118 | 118 | for ( int i = 0; i < 256; i++ )
|
| 119 | 119 | {
|
| 120 | 120 | char szHexStr[16];
|
| 121 | - sprintf(szHexStr, "%02X", i);
|
|
| 121 | + sprintf(szHexStr, "%02X", unsigned(i));
|
|
| 122 | 122 | wxString hexStr = wxString(szHexStr);
|
| 123 | 123 | |
| 124 | 124 | int n = wxHexToDec(hexStr);
|
—
View it on GitLab.
You're receiving this email because of your account on gitlab.com. Manage all notifications · Help