]> git.saurik.com Git - wxWidgets.git/blob - include/wx/ribbon/art_internal.h
Applying patch #10784: eliminate gauge flicker
[wxWidgets.git] / include / wx / ribbon / art_internal.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/ribbon/art_internal.h
3 // Purpose: Helper functions & classes used by ribbon art providers
4 // Author: Peter Cawley
5 // Modified by:
6 // Created: 2009-08-04
7 // RCS-ID: $Id$
8 // Copyright: (C) Peter Cawley
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_RIBBON_ART_INTERNAL_H_
13 #define _WX_RIBBON_ART_INTERNAL_H_
14
15 #include "wx/defs.h"
16
17 #if wxUSE_RIBBON
18
19 WXDLLIMPEXP_RIBBON wxColour wxRibbonInterpolateColour(
20 const wxColour& start_colour,
21 const wxColour& end_colour,
22 int position,
23 int start_position,
24 int end_position);
25
26 WXDLLIMPEXP_RIBBON bool wxRibbonCanLabelBreakAtPosition(
27 const wxString& label,
28 size_t pos);
29
30 WXDLLIMPEXP_RIBBON void wxRibbonDrawParallelGradientLines(
31 wxDC& dc,
32 int nlines,
33 const wxPoint* line_origins,
34 int stepx,
35 int stepy,
36 int numsteps,
37 int offset_x,
38 int offset_y,
39 const wxColour& start_colour,
40 const wxColour& end_colour);
41
42 WXDLLIMPEXP_RIBBON wxBitmap wxRibbonLoadPixmap(
43 const char* const* bits,
44 wxColour fore);
45
46 /*
47 HSL colour class, using interface as discussed in wx-dev. Provided mainly
48 for art providers to perform colour scheme calculations in the HSL colour
49 space. If such a class makes it into base / core, then this class should be
50 removed and users switched over to the one in base / core.
51
52 0.0 <= Hue < 360.0
53 0.0 <= Saturation <= 1.0
54 0.0 <= Luminance <= 1.0
55 */
56 class WXDLLIMPEXP_RIBBON wxRibbonHSLColour
57 {
58 public:
59 wxRibbonHSLColour()
60 : hue(0.0), saturation(0.0), luminance(0.0) {}
61 wxRibbonHSLColour(float H, float S, float L)
62 : hue(H), saturation(S), luminance(L) { }
63 wxRibbonHSLColour(const wxColour& C);
64
65 wxColour ToRGB() const;
66
67 wxRibbonHSLColour& MakeDarker(float delta);
68 wxRibbonHSLColour Darker(float delta) const;
69 wxRibbonHSLColour Lighter(float delta) const;
70 wxRibbonHSLColour Saturated(float delta) const;
71 wxRibbonHSLColour Desaturated(float delta) const;
72 wxRibbonHSLColour ShiftHue(float delta) const;
73
74 float hue, saturation, luminance;
75 };
76
77 WXDLLIMPEXP_RIBBON wxRibbonHSLColour wxRibbonShiftLuminance(
78 wxRibbonHSLColour colour, float amount);
79
80 #endif // wxUSE_RIBBON
81
82 #endif // _WX_RIBBON_ART_INTERNAL_H_