]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/pen.h
Allow creating DIBs storing pixels in non-premultiplied format in wxMSW.
[wxWidgets.git] / include / wx / os2 / pen.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/os2/pen.h
3 // Purpose: wxPen class
4 // Author: David Webster
5 // Modified by:
6 // Created: 10/10/99
7 // RCS-ID: $Id$
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_PEN_H_
13 #define _WX_PEN_H_
14
15 #include "wx/gdiobj.h"
16 #include "wx/bitmap.h"
17
18 typedef long wxPMDash;
19
20 // ----------------------------------------------------------------------------
21 // Pen
22 // ----------------------------------------------------------------------------
23
24 class WXDLLIMPEXP_CORE wxPen : public wxPenBase
25 {
26 public:
27 wxPen() { }
28 wxPen( const wxColour& rColour
29 ,int nWidth = 1
30 ,wxPenStyle nStyle = wxPENSTYLE_SOLID
31 );
32 #if FUTURE_WXWIN_COMPATIBILITY_3_0
33 wxDEPRECATED_FUTURE( wxPen(const wxColour& col, int width, int style) );
34 #endif
35
36 wxPen( const wxBitmap& rStipple
37 ,int nWidth
38 );
39 virtual ~wxPen() { }
40
41 bool operator == (const wxPen& rPen) const;
42 inline bool operator != (const wxPen& rPen) const
43 { return !(*this == rPen); }
44
45 //
46 // Override in order to recreate the pen
47 //
48 void SetColour(const wxColour& rColour);
49 void SetColour(unsigned char cRed, unsigned char cGreen, unsigned char cBlue);
50
51 void SetWidth(int nWidth);
52 void SetStyle(wxPenStyle nStyle);
53 void SetStipple(const wxBitmap& rStipple);
54 void SetDashes( int nNbDashes
55 ,const wxDash* pDash
56 );
57 void SetJoin(wxPenJoin nJoin);
58 void SetCap(wxPenCap nCap);
59 void SetPS(HPS hPS);
60
61 wxColour GetColour(void) const;
62 int GetWidth(void) const;
63 wxPenStyle GetStyle(void) const;
64 wxPenJoin GetJoin(void) const;
65 wxPenCap GetCap(void) const;
66 int GetPS(void) const;
67 int GetDashes(wxDash **ptr) const;
68 wxDash* GetDash() const;
69 int GetDashCount() const;
70 wxBitmap* GetStipple(void) const;
71
72 #if FUTURE_WXWIN_COMPATIBILITY_3_0
73 wxDEPRECATED_FUTURE( void SetStyle(int style) )
74 { SetStyle((wxPenStyle)style); }
75 #endif
76
77 //
78 // Implementation
79 //
80
81 //
82 // Useful helper: create the brush resource
83 //
84 bool RealizeResource(void);
85 bool FreeResource(bool bForce = false);
86 virtual WXHANDLE GetResourceHandle(void) const;
87 bool IsFree(void) const;
88
89 private:
90 LINEBUNDLE m_vLineBundle;
91 AREABUNDLE m_vAreaBundle;
92
93 protected:
94 virtual wxGDIRefData* CreateGDIRefData() const;
95 virtual wxGDIRefData* CloneGDIRefData(const wxGDIRefData* data) const;
96
97 // same as FreeResource() + RealizeResource()
98 bool Recreate();
99
100 DECLARE_DYNAMIC_CLASS(wxPen)
101 }; // end of CLASS wxPen
102
103 extern int wx2os2PenStyle(wxPenStyle nWxStyle);
104
105 #endif
106 // _WX_PEN_H_