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"
20 wxPENSTYLE_INVALID
= -1,
22 wxPENSTYLE_SOLID
= wxSOLID
,
23 wxPENSTYLE_DOT
= wxDOT
,
24 wxPENSTYLE_LONG_DASH
= wxLONG_DASH
,
25 wxPENSTYLE_SHORT_DASH
= wxSHORT_DASH
,
26 wxPENSTYLE_DOT_DASH
= wxDOT_DASH
,
27 wxPENSTYLE_USER_DASH
= wxUSER_DASH
,
29 wxPENSTYLE_TRANSPARENT
= wxTRANSPARENT
,
31 wxPENSTYLE_STIPPLE_MASK_OPAQUE
= wxSTIPPLE_MASK_OPAQUE
,
32 wxPENSTYLE_STIPPLE_MASK
= wxSTIPPLE_MASK
,
33 wxPENSTYLE_STIPPLE
= wxSTIPPLE
,
35 wxPENSTYLE_BDIAGONAL_HATCH
= wxBDIAGONAL_HATCH
,
36 wxPENSTYLE_CROSSDIAG_HATCH
= wxCROSSDIAG_HATCH
,
37 wxPENSTYLE_FDIAGONAL_HATCH
= wxFDIAGONAL_HATCH
,
38 wxPENSTYLE_CROSS_HATCH
= wxCROSS_HATCH
,
39 wxPENSTYLE_HORIZONTAL_HATCH
= wxHORIZONTAL_HATCH
,
40 wxPENSTYLE_VERTICAL_HATCH
= wxVERTICAL_HATCH
,
42 wxPENSTYLE_FIRST_HATCH
= wxFIRST_HATCH
,
43 wxPENSTYLE_LAST_HATCH
= wxLAST_HATCH
65 class WXDLLIMPEXP_CORE wxPenBase
: public wxGDIObject
68 virtual ~wxPenBase() { }
70 virtual void SetColour(const wxColour
& col
) = 0;
71 virtual void SetColour(unsigned char r
, unsigned char g
, unsigned char b
) = 0;
73 virtual void SetWidth(int width
) = 0;
74 virtual void SetStyle(wxPenStyle style
) = 0;
75 virtual void SetStipple(const wxBitmap
& stipple
) = 0;
76 virtual void SetDashes(int nb_dashes
, const wxDash
*dash
) = 0;
77 virtual void SetJoin(wxPenJoin join
) = 0;
78 virtual void SetCap(wxPenCap cap
) = 0;
80 virtual wxColour
GetColour() const = 0;
81 virtual wxBitmap
*GetStipple() const = 0;
82 virtual wxPenStyle
GetStyle() const = 0;
83 virtual wxPenJoin
GetJoin() const = 0;
84 virtual wxPenCap
GetCap() const = 0;
85 virtual int GetWidth() const = 0;
86 virtual int GetDashes(wxDash
**ptr
) const = 0;
89 #if defined(__WXPALMOS__)
90 #include "wx/palmos/pen.h"
91 #elif defined(__WXMSW__)
92 #include "wx/msw/pen.h"
93 #elif defined(__WXMOTIF__) || defined(__WXX11__)
94 #include "wx/x11/pen.h"
95 #elif defined(__WXGTK20__)
96 #include "wx/gtk/pen.h"
97 #elif defined(__WXGTK__)
98 #include "wx/gtk1/pen.h"
99 #elif defined(__WXMGL__)
100 #include "wx/mgl/pen.h"
101 #elif defined(__WXDFB__)
102 #include "wx/dfb/pen.h"
103 #elif defined(__WXMAC__)
104 #include "wx/osx/pen.h"
105 #elif defined(__WXCOCOA__)
106 #include "wx/cocoa/pen.h"
107 #elif defined(__WXPM__)
108 #include "wx/os2/pen.h"
111 class WXDLLIMPEXP_CORE wxPenList
: public wxGDIObjListBase
114 wxPen
*FindOrCreatePen(const wxColour
& colour
,
116 wxPenStyle style
= wxPENSTYLE_SOLID
);
118 #if FUTURE_WXWIN_COMPATIBILITY_3_0
119 wxPen
*FindOrCreatePen(const wxColour
& colour
, int width
, int style
)
120 { return FindOrCreatePen(colour
, width
, (wxPenStyle
)style
); }
122 #if WXWIN_COMPATIBILITY_2_6
123 wxDEPRECATED( void AddPen(wxPen
*) );
124 wxDEPRECATED( void RemovePen(wxPen
*) );
128 extern WXDLLIMPEXP_DATA_CORE(wxPenList
*) wxThePenList
;
130 // provide comparison operators to allow code such as
132 // if ( pen.GetStyle() == wxTRANSPARENT )
134 // to compile without warnings which it would otherwise provoke from some
135 // compilers as it compares elements of different enums
136 #if FUTURE_WXWIN_COMPATIBILITY_3_0
138 inline bool operator==(wxPenStyle s
, wxDeprecatedGUIConstants t
)
140 return wx_static_cast(int, s
) == wx_static_cast(int, t
);
143 inline bool operator!=(wxPenStyle s
, wxDeprecatedGUIConstants t
)
148 #endif // FUTURE_WXWIN_COMPATIBILITY_3_0
150 #endif // _WX_PEN_H_BASE_