1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Base header for wxPen
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows Licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_PEN_H_BASE_
13 #define _WX_PEN_H_BASE_
17 #if WXWIN_COMPATIBILITY_2_8
18 #include "wx/brush.h" // needed for some deprecated declarations
23 #if WXWIN_COMPATIBILITY_2_8
24 /* start of deprecated values */
25 /* wxSOLID, wxTRANSPARENT, wxSTIPPLE are already defined in wxBrushStyle */
31 /* end of deprecated values */
33 wxPENSTYLE_SOLID
= wxSOLID
,
34 wxPENSTYLE_DOT
= wxDOT
,
35 wxPENSTYLE_LONG_DASH
= wxLONG_DASH
,
36 wxPENSTYLE_SHORT_DASH
= wxSHORT_DASH
,
37 wxPENSTYLE_DOT_DASH
= wxDOT_DASH
,
38 wxPENSTYLE_USER_DASH
= wxUSER_DASH
,
40 wxPENSTYLE_TRANSPARENT
= wxTRANSPARENT
,
42 wxPENSTYLE_STIPPLE_MASK_OPAQUE
= wxSTIPPLE_MASK_OPAQUE
,
43 wxPENSTYLE_STIPPLE_MASK
= wxSTIPPLE_MASK
,
44 wxPENSTYLE_STIPPLE
= wxSTIPPLE
,
46 wxPENSTYLE_BDIAGONAL_HATCH
= wxBDIAGONAL_HATCH
,
47 wxPENSTYLE_CROSSDIAG_HATCH
= wxCROSSDIAG_HATCH
,
48 wxPENSTYLE_FDIAGONAL_HATCH
= wxFDIAGONAL_HATCH
,
49 wxPENSTYLE_CROSS_HATCH
= wxCROSS_HATCH
,
50 wxPENSTYLE_HORIZONTAL_HATCH
= wxHORIZONTAL_HATCH
,
51 wxPENSTYLE_VERTICAL_HATCH
= wxVERTICAL_HATCH
,
53 wxPENSTYLE_FIRST_HATCH
= wxFIRST_HATCH
,
54 wxPENSTYLE_LAST_HATCH
= wxLAST_HATCH
,
61 wxPENSTYLE_SHORT_DASH
,
65 wxPENSTYLE_TRANSPARENT
,
68 wxPENSTYLE_STIPPLE_MASK_OPAQUE
,
69 /* mask is used for blitting monochrome using text fore and back ground colors */
71 wxPENSTYLE_STIPPLE_MASK
,
72 /* mask is used for masking areas in the stipple bitmap (TO DO) */
75 /* drawn with a Pen, and without any Brush -- and it can be stippled. */
77 /* In wxWidgets < 2.6 use WX_HATCH macro */
78 /* to verify these wx*_HATCH are in style */
79 /* of wxBrush. In wxWidgets >= 2.6 use */
80 /* wxBrush::IsHatch() instead. */
81 wxPENSTYLE_BDIAGONAL_HATCH
,
82 wxPENSTYLE_CROSSDIAG_HATCH
,
83 wxPENSTYLE_FDIAGONAL_HATCH
,
84 wxPENSTYLE_CROSS_HATCH
,
85 wxPENSTYLE_HORIZONTAL_HATCH
,
86 wxPENSTYLE_VERTICAL_HATCH
,
88 wxPENSTYLE_FIRST_HATCH
= wxPENSTYLE_BDIAGONAL_HATCH
,
89 wxPENSTYLE_LAST_HATCH
= wxPENSTYLE_VERTICAL_HATCH
,
114 class WXDLLEXPORT wxPenBase
: public wxGDIObject
117 virtual ~wxPenBase() { }
119 virtual void SetColour(const wxColour
& col
) = 0;
120 virtual void SetColour(unsigned char r
, unsigned char g
, unsigned char b
) = 0;
122 virtual void SetWidth(int width
) = 0;
123 virtual void SetStyle(wxPenStyle style
) = 0;
124 virtual void SetStipple(const wxBitmap
& stipple
) = 0;
125 virtual void SetDashes(int nb_dashes
, const wxDash
*dash
) = 0;
126 virtual void SetJoin(wxPenJoin join
) = 0;
127 virtual void SetCap(wxPenCap cap
) = 0;
129 virtual wxColour
& GetColour() const = 0;
130 virtual wxBitmap
*GetStipple() const = 0;
131 virtual wxPenStyle
GetStyle() const = 0;
132 virtual wxPenJoin
GetJoin() const = 0;
133 virtual wxPenCap
GetCap() const = 0;
134 virtual int GetWidth() const = 0;
135 virtual int GetDashes(wxDash
**ptr
) const = 0;
137 #if WXWIN_COMPATIBILITY_2_8
138 void SetStyle(wxBrushStyle style
)
139 { SetStyle((wxPenStyle
)style
); }
143 #if defined(__WXPALMOS__)
144 #include "wx/palmos/pen.h"
145 #elif defined(__WXMSW__)
146 #include "wx/msw/pen.h"
147 #elif defined(__WXMOTIF__) || defined(__WXX11__)
148 #include "wx/x11/pen.h"
149 #elif defined(__WXGTK20__)
150 #include "wx/gtk/pen.h"
151 #elif defined(__WXGTK__)
152 #include "wx/gtk1/pen.h"
153 #elif defined(__WXMGL__)
154 #include "wx/mgl/pen.h"
155 #elif defined(__WXDFB__)
156 #include "wx/dfb/pen.h"
157 #elif defined(__WXMAC__)
158 #include "wx/mac/pen.h"
159 #elif defined(__WXCOCOA__)
160 #include "wx/cocoa/pen.h"
161 #elif defined(__WXPM__)
162 #include "wx/os2/pen.h"
165 class WXDLLIMPEXP_CORE wxPenList
: public wxGDIObjListBase
168 wxPen
*FindOrCreatePen(const wxColour
& colour
, int width
, wxPenStyle style
);
169 #if WXWIN_COMPATIBILITY_2_6
170 wxDEPRECATED( void AddPen(wxPen
*) );
171 wxDEPRECATED( void RemovePen(wxPen
*) );
175 extern WXDLLEXPORT_DATA(wxPenList
*) wxThePenList
;