]>
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
);
28 virtual ~wxPenRefData();
39 WXHPEN m_hPen
;// in OS/2 GPI this will be the PS the pen is associated with
42 #define M_PENDATA ((wxPenRefData *)m_refData)
45 class WXDLLEXPORT wxPen
: public wxGDIObject
47 DECLARE_DYNAMIC_CLASS(wxPen
)
50 wxPen( const wxColour
& rColour
54 wxPen( const wxBitmap
& rStipple
59 inline bool operator == (const wxPen
& rPen
) const
60 { return m_refData
== rPen
.m_refData
; }
61 inline bool operator != (const wxPen
& rPen
) const
62 { return m_refData
!= rPen
.m_refData
; }
64 virtual bool Ok() const { return IsOk(); }
65 virtual bool IsOk(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
, unsigned char cGreen
, unsigned char cBlue
);
73 void SetWidth(int nWidth
);
74 void SetStyle(int nStyle
);
75 void SetStipple(const wxBitmap
& rStipple
);
76 void SetDashes( int nNbDashes
79 void SetJoin(int nJoin
);
80 void SetCap(int nCap
);
83 inline wxColour
& GetColour(void) const { return (M_PENDATA
? M_PENDATA
->m_vColour
: wxNullColour
); };
84 inline int GetWidth(void) const { return (M_PENDATA
? M_PENDATA
->m_nWidth
: 0); };
85 inline int GetStyle(void) const { return (M_PENDATA
? M_PENDATA
->m_nStyle
: 0); };
86 inline int GetJoin(void) const { return (M_PENDATA
? M_PENDATA
->m_nJoin
: 0); };
87 inline int GetCap(void) const { return (M_PENDATA
? M_PENDATA
->m_nCap
: 0); };
88 inline int GetPS(void) const { return (M_PENDATA
? M_PENDATA
->m_hPen
: 0); };
89 inline int GetDashes(wxDash
**ptr
) const
91 *ptr
= (M_PENDATA
? (wxDash
*)M_PENDATA
->m_dash
: (wxDash
*) NULL
);
92 return (M_PENDATA
? M_PENDATA
->m_nbDash
: 0);
94 inline wxDash
* GetDash() const { return (M_PENDATA
? (wxDash
*)M_PENDATA
->m_dash
: (wxDash
*)NULL
); };
95 inline int GetDashCount() const { return (M_PENDATA
? M_PENDATA
->m_nbDash
: 0); };
97 inline wxBitmap
* GetStipple(void) const { return (M_PENDATA
? (& M_PENDATA
->m_vStipple
) : (wxBitmap
*) NULL
); };
104 // Useful helper: create the brush resource
106 bool RealizeResource(void);
107 bool FreeResource(bool bForce
= false);
108 WXHANDLE
GetResourceHandle(void);
109 bool IsFree(void) const;
113 LINEBUNDLE m_vLineBundle
;
114 AREABUNDLE m_vAreaBundle
;
115 }; // end of CLASS wxPen
117 extern int wx2os2PenStyle(int nWxStyle
);