]> git.saurik.com Git - wxWidgets.git/blob - include/wx/brush.h
201e53e91a904abbd9111fa07959f62bbe2fd73d
[wxWidgets.git] / include / wx / brush.h
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
12 #ifndef _WX_BRUSH_H_BASE_
13 #define _WX_BRUSH_H_BASE_
14
15 #include "wx/defs.h"
16 #include "wx/object.h"
17 #include "wx/gdiobj.h"
18
19 // NOTE: these values cannot be combined together!
20 enum wxBrushStyle
21 {
22 #if WXWIN_COMPATIBILITY_2_8
23 /* start of deprecated values */
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,
35 wxFIRST_HATCH = wxBDIAGONAL_HATCH,
36 wxLAST_HATCH = wxVERTICAL_HATCH,
37 /* end of deprecated values */
38
39 wxBRUSHSTYLE_SOLID = wxSOLID,
40 wxBRUSHSTYLE_TRANSPARENT = wxTRANSPARENT,
41 wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE = wxSTIPPLE_MASK_OPAQUE,
42 wxBRUSHSTYLE_STIPPLE_MASK = wxSTIPPLE_MASK,
43 wxBRUSHSTYLE_STIPPLE = wxSTIPPLE,
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,
50 wxBRUSHSTYLE_FIRST_HATCH = wxFIRST_HATCH,
51 wxBRUSHSTYLE_LAST_HATCH = wxLAST_HATCH,
52 wxBRUSHSTYLE_MAX
53 #else
54 wxBRUSHSTYLE_SOLID,
55 wxBRUSHSTYLE_TRANSPARENT,
56
57 /* Brush Stippling. */
58
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
87 // wxBrushBase
88 class WXDLLEXPORT wxBrushBase: public wxGDIObject
89 {
90 public:
91 virtual ~wxBrushBase() { }
92
93 virtual wxBrushStyle GetStyle() const = 0;
94
95 virtual bool IsHatch() const
96 { return (GetStyle()>=wxBRUSHSTYLE_FIRST_HATCH) && (GetStyle()<=wxBRUSHSTYLE_LAST_HATCH); }
97 };
98
99 #if defined(__WXPALMOS__)
100 #include "wx/palmos/brush.h"
101 #elif defined(__WXMSW__)
102 #include "wx/msw/brush.h"
103 #elif defined(__WXMOTIF__) || defined(__WXX11__)
104 #include "wx/x11/brush.h"
105 #elif defined(__WXGTK20__)
106 #include "wx/gtk/brush.h"
107 #elif defined(__WXGTK__)
108 #include "wx/gtk1/brush.h"
109 #elif defined(__WXMGL__)
110 #include "wx/mgl/brush.h"
111 #elif defined(__WXDFB__)
112 #include "wx/dfb/brush.h"
113 #elif defined(__WXMAC__)
114 #include "wx/mac/brush.h"
115 #elif defined(__WXCOCOA__)
116 #include "wx/cocoa/brush.h"
117 #elif defined(__WXPM__)
118 #include "wx/os2/brush.h"
119 #endif
120
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
133 #endif
134 // _WX_BRUSH_H_BASE_