]>
Commit | Line | Data |
---|---|---|
99d80019 JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/brush.h | |
3 | // Purpose: Includes platform-specific wxBrush file | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: Julian Smart | |
9 | // Licence: wxWindows Licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
34138703 JS |
12 | #ifndef _WX_BRUSH_H_BASE_ |
13 | #define _WX_BRUSH_H_BASE_ | |
c801d85f | 14 | |
c7dc7711 WS |
15 | #include "wx/defs.h" |
16 | #include "wx/object.h" | |
17 | #include "wx/gdiobj.h" | |
18 | ||
3e6858cd FM |
19 | // NOTE: these values cannot be combined together! |
20 | enum wxBrushStyle | |
21 | { | |
82cddbd9 | 22 | #if WXWIN_COMPATIBILITY_2_8 |
3e6858cd | 23 | /* start of deprecated values */ |
82cddbd9 FM |
24 | wxSOLID = 100, |
25 | wxTRANSPARENT = 106, | |
26 | wxSTIPPLE_MASK_OPAQUE = 107, | |
27 | wxSTIPPLE_MASK = 108, | |
28 | wxSTIPPLE = 109, | |
29 | wxBDIAGONAL_HATCH = 110, | |
30 | wxCROSSDIAG_HATCH = 111, | |
31 | wxFDIAGONAL_HATCH = 112, | |
32 | wxCROSS_HATCH = 113, | |
33 | wxHORIZONTAL_HATCH = 114, | |
34 | wxVERTICAL_HATCH = 115, | |
3e6858cd FM |
35 | wxFIRST_HATCH = wxBDIAGONAL_HATCH, |
36 | wxLAST_HATCH = wxVERTICAL_HATCH, | |
37 | /* end of deprecated values */ | |
38 | ||
39 | wxBRUSHSTYLE_SOLID = wxSOLID, | |
3e6858cd | 40 | wxBRUSHSTYLE_TRANSPARENT = wxTRANSPARENT, |
3e6858cd | 41 | wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE = wxSTIPPLE_MASK_OPAQUE, |
3e6858cd | 42 | wxBRUSHSTYLE_STIPPLE_MASK = wxSTIPPLE_MASK, |
3e6858cd | 43 | wxBRUSHSTYLE_STIPPLE = wxSTIPPLE, |
3e6858cd FM |
44 | wxBRUSHSTYLE_BDIAGONAL_HATCH = wxBDIAGONAL_HATCH, |
45 | wxBRUSHSTYLE_CROSSDIAG_HATCH = wxCROSSDIAG_HATCH, | |
46 | wxBRUSHSTYLE_FDIAGONAL_HATCH = wxFDIAGONAL_HATCH, | |
47 | wxBRUSHSTYLE_CROSS_HATCH = wxCROSS_HATCH, | |
48 | wxBRUSHSTYLE_HORIZONTAL_HATCH = wxHORIZONTAL_HATCH, | |
49 | wxBRUSHSTYLE_VERTICAL_HATCH = wxVERTICAL_HATCH, | |
3e6858cd FM |
50 | wxBRUSHSTYLE_FIRST_HATCH = wxFIRST_HATCH, |
51 | wxBRUSHSTYLE_LAST_HATCH = wxLAST_HATCH, | |
3e6858cd FM |
52 | wxBRUSHSTYLE_MAX |
53 | #else | |
54 | wxBRUSHSTYLE_SOLID, | |
3e6858cd FM |
55 | wxBRUSHSTYLE_TRANSPARENT, |
56 | ||
57 | /* Brush Stippling. */ | |
82cddbd9 | 58 | |
3e6858cd FM |
59 | wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE, |
60 | /* mask is used for blitting monochrome using text fore and back ground colors */ | |
61 | ||
62 | wxBRUSHSTYLE_STIPPLE_MASK, | |
63 | /* mask is used for masking areas in the stipple bitmap (TO DO) */ | |
64 | ||
65 | wxBRUSHSTYLE_STIPPLE, | |
66 | /* drawn with a Pen, and without any Brush -- and it can be stippled. */ | |
67 | ||
68 | /* In wxWidgets < 2.6 use WX_HATCH macro */ | |
69 | /* to verify these wx*_HATCH are in style */ | |
70 | /* of wxBrush. In wxWidgets >= 2.6 use */ | |
71 | /* wxBrush::IsHatch() instead. */ | |
72 | wxBRUSHSTYLE_BDIAGONAL_HATCH, | |
73 | wxBRUSHSTYLE_CROSSDIAG_HATCH, | |
74 | wxBRUSHSTYLE_FDIAGONAL_HATCH, | |
75 | wxBRUSHSTYLE_CROSS_HATCH, | |
76 | wxBRUSHSTYLE_HORIZONTAL_HATCH, | |
77 | wxBRUSHSTYLE_VERTICAL_HATCH, | |
78 | ||
79 | wxBRUSHSTYLE_FIRST_HATCH = wxBRUSHSTYLE_BDIAGONAL_HATCH, | |
80 | wxBRUSHSTYLE_LAST_HATCH = wxBRUSHSTYLE_VERTICAL_HATCH, | |
81 | ||
82 | wxBRUSHSTYLE_MAX | |
83 | #endif | |
84 | }; | |
85 | ||
86 | ||
cb9d5bd0 WS |
87 | // wxBrushBase |
88 | class WXDLLEXPORT wxBrushBase: public wxGDIObject | |
89 | { | |
90 | public: | |
91 | virtual ~wxBrushBase() { } | |
92 | ||
3e6858cd | 93 | virtual wxBrushStyle GetStyle() const = 0; |
cb9d5bd0 WS |
94 | |
95 | virtual bool IsHatch() const | |
3e6858cd | 96 | { return (GetStyle()>=wxBRUSHSTYLE_FIRST_HATCH) && (GetStyle()<=wxBRUSHSTYLE_LAST_HATCH); } |
cb9d5bd0 WS |
97 | }; |
98 | ||
4055ed82 | 99 | #if defined(__WXPALMOS__) |
ffecfa5a JS |
100 | #include "wx/palmos/brush.h" |
101 | #elif defined(__WXMSW__) | |
5b36366c VZ |
102 | #include "wx/msw/brush.h" |
103 | #elif defined(__WXMOTIF__) || defined(__WXX11__) | |
104 | #include "wx/x11/brush.h" | |
1be7a35c | 105 | #elif defined(__WXGTK20__) |
5b36366c | 106 | #include "wx/gtk/brush.h" |
1be7a35c MR |
107 | #elif defined(__WXGTK__) |
108 | #include "wx/gtk1/brush.h" | |
1e6feb95 | 109 | #elif defined(__WXMGL__) |
5b36366c | 110 | #include "wx/mgl/brush.h" |
b3c86150 VS |
111 | #elif defined(__WXDFB__) |
112 | #include "wx/dfb/brush.h" | |
34138703 | 113 | #elif defined(__WXMAC__) |
5b36366c | 114 | #include "wx/mac/brush.h" |
e64df9bc | 115 | #elif defined(__WXCOCOA__) |
5b36366c | 116 | #include "wx/cocoa/brush.h" |
1777b9bb | 117 | #elif defined(__WXPM__) |
5b36366c | 118 | #include "wx/os2/brush.h" |
c801d85f KB |
119 | #endif |
120 | ||
82cddbd9 FM |
121 | class WXDLLIMPEXP_CORE wxBrushList: public wxGDIObjListBase |
122 | { | |
123 | public: | |
124 | wxBrush *FindOrCreateBrush(const wxColour& colour, wxBrushStyle style = wxBRUSHSTYLE_SOLID); | |
125 | #if WXWIN_COMPATIBILITY_2_6 | |
126 | wxDEPRECATED( void AddBrush(wxBrush*) ); | |
127 | wxDEPRECATED( void RemoveBrush(wxBrush*) ); | |
128 | #endif | |
129 | }; | |
130 | ||
131 | extern WXDLLEXPORT_DATA(wxBrushList*) wxTheBrushList; | |
132 | ||
c801d85f | 133 | #endif |
34138703 | 134 | // _WX_BRUSH_H_BASE_ |