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_
19 #if WXWIN_COMPATIBILITY_2_8
20 /* start of deprecated values */
21 /* wxSOLID, wxTRANSPARENT, wxSTIPPLE are already defined in wxBrushStyle */
27 /* end of deprecated values */
29 wxPENSTYLE_SOLID
= wxSOLID
,
30 wxPENSTYLE_DOT
= wxDOT
,
31 wxPENSTYLE_LONG_DASH
= wxLONG_DASH
,
32 wxPENSTYLE_SHORT_DASH
= wxSHORT_DASH
,
33 wxPENSTYLE_DOT_DASH
= wxDOT_DASH
,
34 wxPENSTYLE_USER_DOT
= wxUSER_DASH
,
36 wxPENSTYLE_TRANSPARENT
= wxTRANSPARENT
,
38 wxPENSTYLE_STIPPLE_MASK_OPAQUE
= wxSTIPPLE_MASK_OPAQUE
,
39 wxPENSTYLE_STIPPLE_MASK
= wxSTIPPLE_MASK
,
40 wxPENSTYLE_STIPPLE
= wxSTIPPLE
,
42 wxPENSTYLE_BDIAGONAL_HATCH
= wxBDIAGONAL_HATCH
,
43 wxPENSTYLE_CROSSDIAG_HATCH
= wxCROSSDIAG_HATCH
,
44 wxPENSTYLE_FDIAGONAL_HATCH
= wxFDIAGONAL_HATCH
,
45 wxPENSTYLE_CROSS_HATCH
= wxCROSS_HATCH
,
46 wxPENSTYLE_HORIZONTAL_HATCH
= wxHORIZONTAL_HATCH
,
47 wxPENSTYLE_VERTICAL_HATCH
= wxVERTICAL_HATCH
,
49 wxPENSTYLE_FIRST_HATCH
= wxFIRST_HATCH
,
50 wxPENSTYLE_LAST_HATCH
= wxLAST_HATCH
,
57 wxPENSTYLE_SHORT_DASH
,
61 wxPENSTYLE_TRANSPARENT
,
64 wxPENSTYLE_STIPPLE_MASK_OPAQUE
,
65 /* mask is used for blitting monochrome using text fore and back ground colors */
67 wxPENSTYLE_STIPPLE_MASK
,
68 /* mask is used for masking areas in the stipple bitmap (TO DO) */
71 /* drawn with a Pen, and without any Brush -- and it can be stippled. */
73 /* In wxWidgets < 2.6 use WX_HATCH macro */
74 /* to verify these wx*_HATCH are in style */
75 /* of wxBrush. In wxWidgets >= 2.6 use */
76 /* wxBrush::IsHatch() instead. */
77 wxPENSTYLE_BDIAGONAL_HATCH
,
78 wxPENSTYLE_CROSSDIAG_HATCH
,
79 wxPENSTYLE_FDIAGONAL_HATCH
,
80 wxPENSTYLE_CROSS_HATCH
,
81 wxPENSTYLE_HORIZONTAL_HATCH
,
82 wxPENSTYLE_VERTICAL_HATCH
,
84 wxPENSTYLE_FIRST_HATCH
= wxPENSTYLE_BDIAGONAL_HATCH
,
85 wxPENSTYLE_LAST_HATCH
= wxPENSTYLE_VERTICAL_HATCH
,
110 class WXDLLEXPORT wxPenBase
: public wxGDIObject
113 virtual ~wxPenBase() { }
115 virtual void SetColour(const wxColour
& col
) = 0;
116 virtual void SetColour(unsigned char r
, unsigned char g
, unsigned char b
) = 0;
118 virtual void SetWidth(int width
) = 0;
119 virtual void SetStyle(wxPenStyle style
) = 0;
120 virtual void SetStipple(const wxBitmap
& stipple
) = 0;
121 virtual void SetDashes(int nb_dashes
, const wxDash
*dash
) = 0;
122 virtual void SetJoin(wxPenJoin join
) = 0;
123 virtual void SetCap(wxPenCap cap
) = 0;
125 virtual wxColour
& GetColour() const = 0;
126 virtual wxBitmap
*GetStipple() const = 0;
127 virtual wxPenStyle
GetStyle() const = 0;
128 virtual wxPenJoin
GetJoin() const = 0;
129 virtual wxPenCap
GetCap() const = 0;
130 virtual int GetWidth() const = 0;
131 virtual int GetDashes(wxDash
**ptr
) const = 0;
133 #if WXWIN_COMPATIBILITY_2_8
134 void SetStyle(wxBrushStyle style
)
135 { SetStyle((wxPenStyle
)style
); }
139 #if defined(__WXPALMOS__)
140 #include "wx/palmos/pen.h"
141 #elif defined(__WXMSW__)
142 #include "wx/msw/pen.h"
143 #elif defined(__WXMOTIF__) || defined(__WXX11__)
144 #include "wx/x11/pen.h"
145 #elif defined(__WXGTK20__)
146 #include "wx/gtk/pen.h"
147 #elif defined(__WXGTK__)
148 #include "wx/gtk1/pen.h"
149 #elif defined(__WXMGL__)
150 #include "wx/mgl/pen.h"
151 #elif defined(__WXDFB__)
152 #include "wx/dfb/pen.h"
153 #elif defined(__WXMAC__)
154 #include "wx/mac/pen.h"
155 #elif defined(__WXCOCOA__)
156 #include "wx/cocoa/pen.h"
157 #elif defined(__WXPM__)
158 #include "wx/os2/pen.h"
161 class WXDLLIMPEXP_CORE wxPenList
: public wxGDIObjListBase
164 wxPen
*FindOrCreatePen(const wxColour
& colour
, int width
, wxPenStyle style
);
165 #if WXWIN_COMPATIBILITY_2_6
166 wxDEPRECATED( void AddPen(wxPen
*) );
167 wxDEPRECATED( void RemovePen(wxPen
*) );
171 extern WXDLLEXPORT_DATA(wxPenList
*) wxThePenList
;