]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/pen.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxPen class
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/gdiobj.h"
16 #include "wx/bitmap.h"
18 typedef long wxPMDash
;
20 class WXDLLEXPORT wxPen
;
22 class WXDLLEXPORT wxPenRefData
: public wxGDIRefData
24 friend class WXDLLEXPORT wxPen
;
27 wxPenRefData(const wxPenRefData
& rData
);
37 WXHPEN m_hPen
;// in OS/2 GPI this will be the PS the pen is associated with
40 #define M_PENDATA ((wxPenRefData *)m_refData)
43 class WXDLLEXPORT wxPen
: public wxGDIObject
45 DECLARE_DYNAMIC_CLASS(wxPen
)
48 wxPen( const wxColour
& rColour
52 wxPen( const wxBitmap
& rStipple
55 inline wxPen(const wxPen
& rPen
) { Ref(rPen
); }
58 inline wxPen
& operator = (const wxPen
& rPen
)
59 { if (*this == rPen
) return (*this); Ref(rPen
); return *this; }
60 inline bool operator == (const wxPen
& rPen
) const
61 { return m_refData
== rPen
.m_refData
; }
62 inline bool operator != (const wxPen
& rPen
) const
63 { return m_refData
!= rPen
.m_refData
; }
65 virtual bool Ok(void) const { return (m_refData
!= NULL
); }
68 // Override in order to recreate the pen
70 void SetColour(const wxColour
& rColour
);
71 void SetColour( unsigned char cRed
76 void SetWidth(int nWidth
);
77 void SetStyle(int nStyle
);
78 void SetStipple(const wxBitmap
& rStipple
);
79 void SetDashes( int nNbDashes
82 void SetJoin(int nJoin
);
83 void SetCap(int nCap
);
86 inline wxColour
& GetColour(void) const { return (M_PENDATA
? M_PENDATA
->m_vColour
: wxNullColour
); };
87 inline int GetWidth(void) const { return (M_PENDATA
? M_PENDATA
->m_nWidth
: 0); };
88 inline int GetStyle(void) const { return (M_PENDATA
? M_PENDATA
->m_nStyle
: 0); };
89 inline int GetJoin(void) const { return (M_PENDATA
? M_PENDATA
->m_nJoin
: 0); };
90 inline int GetCap(void) const { return (M_PENDATA
? M_PENDATA
->m_nCap
: 0); };
91 inline int GetPS(void) const { return (M_PENDATA
? M_PENDATA
->m_hPen
: 0); };
93 inline wxBitmap
* GetStipple(void) const { return (M_PENDATA
? (& M_PENDATA
->m_vStipple
) : (wxBitmap
*) NULL
); };
100 // Useful helper: create the brush resource
102 bool RealizeResource(void);
103 bool FreeResource(bool bForce
= FALSE
);
104 WXHANDLE
GetResourceHandle(void);
105 bool IsFree(void) const;
109 LINEBUNDLE m_vLineBundle
;
110 AREABUNDLE m_vAreaBundle
;
111 }; // end of CLASS wxPen
113 extern int wx2os2PenStyle(int nWxStyle
);