]> git.saurik.com Git - wxWidgets.git/blob - include/wx/x11/pen.h
Warning fix (instead of silencing int->short with typecast, have the same type intern...
[wxWidgets.git] / include / wx / x11 / pen.h
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 ~wxPen();
40
41 wxPen( const wxPen& pen ) { Ref(pen); }
42 wxPen& operator = ( const wxPen& pen ) { Ref(pen); return *this; }
43
44 bool Ok() const { return m_refData != NULL; }
45
46 bool operator == ( const wxPen& pen ) const;
47 bool operator != (const wxPen& pen) const { return !(*this == pen); }
48
49 void SetColour( const wxColour &colour );
50 void SetColour( unsigned char red, unsigned char green, unsigned char blue );
51 void SetCap( int capStyle );
52 void SetJoin( int joinStyle );
53 void SetStyle( int style );
54 void SetWidth( int width );
55 void SetDashes( int number_of_dashes, const wxDash *dash );
56 void SetStipple( wxBitmap *stipple );
57
58 wxColour &GetColour() const;
59 int GetCap() const;
60 int GetJoin() const;
61 int GetStyle() const;
62 int GetWidth() const;
63 int GetDashes(wxDash **ptr) const;
64 int GetDashCount() const;
65 wxDash* GetDash() const;
66 wxBitmap* GetStipple() const;
67
68 private:
69 // ref counting code
70 virtual wxObjectRefData *CreateRefData() const;
71 virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
72
73 DECLARE_DYNAMIC_CLASS(wxPen)
74 };
75
76 #endif
77 // _WX_PEN_H_