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_
15 #include "wx/gdiobj.h"
16 #include "wx/gdicmn.h"
18 #if WXWIN_COMPATIBILITY_2_8
19 #include "wx/brush.h" // needed for some deprecated declarations
24 #if WXWIN_COMPATIBILITY_2_8
25 /* start of deprecated values */
26 /* wxSOLID, wxTRANSPARENT, wxSTIPPLE are already defined in wxBrushStyle */
32 /* end of deprecated values */
34 wxPENSTYLE_SOLID
= wxSOLID
,
35 wxPENSTYLE_DOT
= wxDOT
,
36 wxPENSTYLE_LONG_DASH
= wxLONG_DASH
,
37 wxPENSTYLE_SHORT_DASH
= wxSHORT_DASH
,
38 wxPENSTYLE_DOT_DASH
= wxDOT_DASH
,
39 wxPENSTYLE_USER_DASH
= wxUSER_DASH
,
41 wxPENSTYLE_TRANSPARENT
= wxTRANSPARENT
,
43 wxPENSTYLE_STIPPLE_MASK_OPAQUE
= wxSTIPPLE_MASK_OPAQUE
,
44 wxPENSTYLE_STIPPLE_MASK
= wxSTIPPLE_MASK
,
45 wxPENSTYLE_STIPPLE
= wxSTIPPLE
,
47 wxPENSTYLE_BDIAGONAL_HATCH
= wxBDIAGONAL_HATCH
,
48 wxPENSTYLE_CROSSDIAG_HATCH
= wxCROSSDIAG_HATCH
,
49 wxPENSTYLE_FDIAGONAL_HATCH
= wxFDIAGONAL_HATCH
,
50 wxPENSTYLE_CROSS_HATCH
= wxCROSS_HATCH
,
51 wxPENSTYLE_HORIZONTAL_HATCH
= wxHORIZONTAL_HATCH
,
52 wxPENSTYLE_VERTICAL_HATCH
= wxVERTICAL_HATCH
,
54 wxPENSTYLE_FIRST_HATCH
= wxFIRST_HATCH
,
55 wxPENSTYLE_LAST_HATCH
= wxLAST_HATCH
,
62 wxPENSTYLE_SHORT_DASH
,
66 wxPENSTYLE_TRANSPARENT
,
69 wxPENSTYLE_STIPPLE_MASK_OPAQUE
,
70 /* mask is used for blitting monochrome using text fore and back ground colors */
72 wxPENSTYLE_STIPPLE_MASK
,
73 /* mask is used for masking areas in the stipple bitmap (TO DO) */
76 /* drawn with a Pen, and without any Brush -- and it can be stippled. */
78 /* In wxWidgets < 2.6 use WX_HATCH macro */
79 /* to verify these wx*_HATCH are in style */
80 /* of wxBrush. In wxWidgets >= 2.6 use */
81 /* wxBrush::IsHatch() instead. */
82 wxPENSTYLE_BDIAGONAL_HATCH
,
83 wxPENSTYLE_CROSSDIAG_HATCH
,
84 wxPENSTYLE_FDIAGONAL_HATCH
,
85 wxPENSTYLE_CROSS_HATCH
,
86 wxPENSTYLE_HORIZONTAL_HATCH
,
87 wxPENSTYLE_VERTICAL_HATCH
,
89 wxPENSTYLE_FIRST_HATCH
= wxPENSTYLE_BDIAGONAL_HATCH
,
90 wxPENSTYLE_LAST_HATCH
= wxPENSTYLE_VERTICAL_HATCH
,
115 class WXDLLEXPORT wxPenBase
: public wxGDIObject
118 virtual ~wxPenBase() { }
120 virtual void SetColour(const wxColour
& col
) = 0;
121 virtual void SetColour(unsigned char r
, unsigned char g
, unsigned char b
) = 0;
123 virtual void SetWidth(int width
) = 0;
124 virtual void SetStyle(wxPenStyle style
) = 0;
125 virtual void SetStipple(const wxBitmap
& stipple
) = 0;
126 virtual void SetDashes(int nb_dashes
, const wxDash
*dash
) = 0;
127 virtual void SetJoin(wxPenJoin join
) = 0;
128 virtual void SetCap(wxPenCap cap
) = 0;
130 virtual wxColour
& GetColour() const = 0;
131 virtual wxBitmap
*GetStipple() const = 0;
132 virtual wxPenStyle
GetStyle() const = 0;
133 virtual wxPenJoin
GetJoin() const = 0;
134 virtual wxPenCap
GetCap() const = 0;
135 virtual int GetWidth() const = 0;
136 virtual int GetDashes(wxDash
**ptr
) const = 0;
138 #if WXWIN_COMPATIBILITY_2_8
139 void SetStyle(wxBrushStyle style
)
140 { SetStyle((wxPenStyle
)style
); }
144 #if defined(__WXPALMOS__)
145 #include "wx/palmos/pen.h"
146 #elif defined(__WXMSW__)
147 #include "wx/msw/pen.h"
148 #elif defined(__WXMOTIF__) || defined(__WXX11__)
149 #include "wx/x11/pen.h"
150 #elif defined(__WXGTK20__)
151 #include "wx/gtk/pen.h"
152 #elif defined(__WXGTK__)
153 #include "wx/gtk1/pen.h"
154 #elif defined(__WXMGL__)
155 #include "wx/mgl/pen.h"
156 #elif defined(__WXDFB__)
157 #include "wx/dfb/pen.h"
158 #elif defined(__WXMAC__)
159 #include "wx/mac/pen.h"
160 #elif defined(__WXCOCOA__)
161 #include "wx/cocoa/pen.h"
162 #elif defined(__WXPM__)
163 #include "wx/os2/pen.h"
166 class WXDLLIMPEXP_CORE wxPenList
: public wxGDIObjListBase
169 wxPen
*FindOrCreatePen(const wxColour
& colour
, int width
, wxPenStyle style
);
170 #if WXWIN_COMPATIBILITY_2_6
171 wxDEPRECATED( void AddPen(wxPen
*) );
172 wxDEPRECATED( void RemovePen(wxPen
*) );
176 extern WXDLLEXPORT_DATA(wxPenList
*) wxThePenList
;