]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/stubs/pen.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxPen class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "pen.h"
19 #include "wx/gdiobj.h"
21 typedef WXDWORD wxDash
;
23 class WXDLLEXPORT wxPen
;
25 class WXDLLEXPORT wxPenRefData
: public wxGDIRefData
27 friend class WXDLLEXPORT wxPen
;
41 /* TODO: implementation
46 #define M_PENDATA ((wxPenRefData *)m_refData)
49 class WXDLLEXPORT wxPen
: public wxGDIObject
51 DECLARE_DYNAMIC_CLASS(wxPen
)
54 wxPen(const wxColour
& col
, int width
, int style
);
55 wxPen(const wxString
& col
, int width
, int style
);
56 wxPen(const wxBitmap
& stipple
, int width
);
57 inline wxPen(const wxPen
& pen
) { Ref(pen
); }
58 inline wxPen(const wxPen
* pen
) { if (pen
) Ref(*pen
); }
61 inline wxPen
& operator = (const wxPen
& pen
) { if (*this == pen
) return (*this); Ref(pen
); return *this; }
62 inline bool operator == (const wxPen
& pen
) { return m_refData
== pen
.m_refData
; }
63 inline bool operator != (const wxPen
& pen
) { return m_refData
!= pen
.m_refData
; }
65 virtual bool Ok() const { return (m_refData
!= NULL
) ; }
67 // Override in order to recreate the pen
68 void SetColour(const wxColour
& col
) ;
69 void SetColour(const wxString
& col
) ;
70 void SetColour(const unsigned char r
, const unsigned char g
, const unsigned char b
) ;
72 void SetWidth(int width
) ;
73 void SetStyle(int style
) ;
74 void SetStipple(const wxBitmap
& stipple
) ;
75 void SetDashes(int nb_dashes
, const wxDash
*dash
) ;
76 void SetJoin(int join
) ;
77 void SetCap(int cap
) ;
79 inline wxColour
& GetColour() const { return (M_PENDATA
? M_PENDATA
->m_colour
: wxNullColour
); };
80 inline int GetWidth() const { return (M_PENDATA
? M_PENDATA
->m_width
: 0); };
81 inline int GetStyle() const { return (M_PENDATA
? M_PENDATA
->m_style
: 0); };
82 inline int GetJoin() const { return (M_PENDATA
? M_PENDATA
->m_join
: 0); };
83 inline int GetCap() const { return (M_PENDATA
? M_PENDATA
->m_cap
: 0); };
84 inline int GetDashes(wxDash
**ptr
) const {
85 *ptr
= (M_PENDATA
? M_PENDATA
->m_dash
: NULL
); return (M_PENDATA
? M_PENDATA
->m_nbDash
: 0);
88 inline wxBitmap
*GetStipple() const { return (M_PENDATA
? (& M_PENDATA
->m_stipple
) : NULL
); };