File: art_internal.h

package info (click to toggle)
wxpython3.0 3.0.2.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 482,760 kB
  • ctags: 518,293
  • sloc: cpp: 2,127,226; python: 294,045; makefile: 51,942; ansic: 19,033; sh: 3,013; xml: 1,629; perl: 17
file content (81 lines) | stat: -rw-r--r-- 2,938 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
///////////////////////////////////////////////////////////////////////////////
// Name:        wx/ribbon/art_internal.h
// Purpose:     Helper functions & classes used by ribbon art providers
// Author:      Peter Cawley
// Modified by:
// Created:     2009-08-04
// Copyright:   (C) Peter Cawley
// Licence:     wxWindows licence
///////////////////////////////////////////////////////////////////////////////

#ifndef _WX_RIBBON_ART_INTERNAL_H_
#define _WX_RIBBON_ART_INTERNAL_H_

#include "wx/defs.h"

#if wxUSE_RIBBON

WXDLLIMPEXP_RIBBON wxColour wxRibbonInterpolateColour(
                                const wxColour& start_colour,
                                const wxColour& end_colour,
                                int position,
                                int start_position,
                                int end_position);

WXDLLIMPEXP_RIBBON bool wxRibbonCanLabelBreakAtPosition(
                                const wxString& label,
                                size_t pos);

WXDLLIMPEXP_RIBBON void wxRibbonDrawParallelGradientLines(
                                wxDC& dc,
                                int nlines,
                                const wxPoint* line_origins,
                                int stepx,
                                int stepy,
                                int numsteps,
                                int offset_x,
                                int offset_y,
                                const wxColour& start_colour,
                                const wxColour& end_colour);

WXDLLIMPEXP_RIBBON wxBitmap wxRibbonLoadPixmap(
                                const char* const* bits,
                                wxColour fore);

/*
   HSL colour class, using interface as discussed in wx-dev. Provided mainly
   for art providers to perform colour scheme calculations in the HSL colour
   space. If such a class makes it into base / core, then this class should be
   removed and users switched over to the one in base / core.

   0.0 <= Hue < 360.0
   0.0 <= Saturation <= 1.0
   0.0 <= Luminance <= 1.0
*/
class WXDLLIMPEXP_RIBBON wxRibbonHSLColour
{
public:
   wxRibbonHSLColour()
       : hue(0.0), saturation(0.0), luminance(0.0) {}
   wxRibbonHSLColour(float H, float S, float L)
       : hue(H), saturation(S), luminance(L) { }
   wxRibbonHSLColour(const wxColour& C);

   wxColour    ToRGB() const;

   wxRibbonHSLColour& MakeDarker(float delta);
   wxRibbonHSLColour Darker(float delta) const;
   wxRibbonHSLColour Lighter(float delta) const;
   wxRibbonHSLColour Saturated(float delta) const;
   wxRibbonHSLColour Desaturated(float delta) const;
   wxRibbonHSLColour ShiftHue(float delta) const;

   float       hue, saturation, luminance;
};

WXDLLIMPEXP_RIBBON wxRibbonHSLColour wxRibbonShiftLuminance(
                                wxRibbonHSLColour colour, float amount);

#endif // wxUSE_RIBBON

#endif // _WX_RIBBON_ART_INTERNAL_H_