]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/x11/pen.h | |
3 | // Purpose: wxPen class | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 17/09/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_PEN_H_ | |
13 | #define _WX_PEN_H_ | |
14 | ||
15 | #include "wx/gdicmn.h" | |
16 | #include "wx/gdiobj.h" | |
17 | ||
18 | //----------------------------------------------------------------------------- | |
19 | // classes | |
20 | //----------------------------------------------------------------------------- | |
21 | ||
22 | class WXDLLIMPEXP_CORE wxPen; | |
23 | class WXDLLIMPEXP_CORE wxColour; | |
24 | class WXDLLIMPEXP_CORE wxBitmap; | |
25 | ||
26 | typedef char wxX11Dash; | |
27 | ||
28 | //----------------------------------------------------------------------------- | |
29 | // wxPen | |
30 | //----------------------------------------------------------------------------- | |
31 | ||
32 | class WXDLLIMPEXP_CORE wxPen: public wxGDIObject | |
33 | { | |
34 | public: | |
35 | wxPen() { } | |
36 | ||
37 | wxPen( const wxColour &colour, int width = 1, int style = wxSOLID ); | |
38 | wxPen( const wxBitmap &stipple, int width ); | |
39 | virtual ~wxPen(); | |
40 | ||
41 | bool Ok() const { return IsOk(); } | |
42 | bool IsOk() const { return m_refData != NULL; } | |
43 | ||
44 | bool operator == ( const wxPen& pen ) const; | |
45 | bool operator != (const wxPen& pen) const { return !(*this == pen); } | |
46 | ||
47 | void SetColour( const wxColour &colour ); | |
48 | void SetColour( unsigned char red, unsigned char green, unsigned char blue ); | |
49 | void SetCap( int capStyle ); | |
50 | void SetJoin( int joinStyle ); | |
51 | void SetStyle( int style ); | |
52 | void SetWidth( int width ); | |
53 | void SetDashes( int number_of_dashes, const wxDash *dash ); | |
54 | void SetStipple( wxBitmap *stipple ); | |
55 | ||
56 | wxColour &GetColour() const; | |
57 | int GetCap() const; | |
58 | int GetJoin() const; | |
59 | int GetStyle() const; | |
60 | int GetWidth() const; | |
61 | int GetDashes(wxDash **ptr) const; | |
62 | int GetDashCount() const; | |
63 | wxDash* GetDash() const; | |
64 | wxBitmap* GetStipple() const; | |
65 | ||
66 | protected: | |
67 | // ref counting code | |
68 | virtual wxObjectRefData *CreateRefData() const; | |
69 | virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; | |
70 | ||
71 | DECLARE_DYNAMIC_CLASS(wxPen) | |
72 | }; | |
73 | ||
74 | #endif | |
75 | // _WX_PEN_H_ |