1 ///////////////////////////////////////////////////////////////////////////// 2 // Name: wx/gtk1/pen.h 3 // Purpose: 4 // Author: Robert Roebling 5 // Copyright: (c) 1998 Robert Roebling 6 // Licence: wxWindows licence 7 ///////////////////////////////////////////////////////////////////////////// 8 9 #ifndef __GTKPENH__ 10 #define __GTKPENH__ 11 12 #include "wx/defs.h" 13 #include "wx/object.h" 14 #include "wx/string.h" 15 #include "wx/gdiobj.h" 16 #include "wx/gdicmn.h" 17 18 //----------------------------------------------------------------------------- 19 // classes 20 //----------------------------------------------------------------------------- 21 22 class WXDLLIMPEXP_FWD_CORE wxPen; 23 24 #if defined(__WXGTK127__) 25 typedef signed char wxGTKDash; 26 #else 27 typedef char wxGTKDash; 28 #endif 29 30 //----------------------------------------------------------------------------- 31 // wxPen 32 //----------------------------------------------------------------------------- 33 34 class WXDLLIMPEXP_CORE wxPen: public wxPenBase 35 { 36 public: wxPen()37 wxPen() { } 38 39 wxPen( const wxColour &colour, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID ); 40 41 wxPen( const wxPenInfo& info ); 42 43 bool operator==(const wxPen& pen) const; 44 bool operator!=(const wxPen& pen) const { return !(*this == pen); } 45 46 void SetColour( const wxColour &colour ); 47 void SetColour( unsigned char red, unsigned char green, unsigned char blue ); 48 void SetCap( wxPenCap capStyle ); 49 void SetJoin( wxPenJoin joinStyle ); 50 void SetStyle( wxPenStyle style ); 51 void SetWidth( int width ); 52 void SetDashes( int number_of_dashes, const wxDash *dash ); 53 void SetStipple(const wxBitmap& stipple); 54 55 wxColour GetColour() const; 56 wxPenCap GetCap() const; 57 wxPenJoin GetJoin() const; 58 wxPenStyle GetStyle() const; 59 int GetWidth() const; 60 int GetDashes(wxDash **ptr) const; 61 int GetDashCount() const; 62 wxDash* GetDash() const; 63 wxBitmap *GetStipple() const; 64 65 66 wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") 67 wxPen(const wxColour& col, int width, int style); 68 69 wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") SetStyle(int style)70 void SetStyle(int style) { SetStyle((wxPenStyle)style); } 71 72 private: 73 virtual wxGDIRefData *CreateGDIRefData() const; 74 virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; 75 76 wxDECLARE_DYNAMIC_CLASS(wxPen); 77 }; 78 79 #endif // __GTKPENH__ 80