pen.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/cocoa/pen.h
  3. // Purpose: wxPen class
  4. // Author: David Elliott
  5. // Modified by:
  6. // Created: 2003/08/02 (stubs from 22.03.2003)
  7. // Copyright: (c) 2003 David Elliott
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef __WX_COCOA_PEN_H__
  11. #define __WX_COCOA_PEN_H__
  12. #include "wx/gdiobj.h"
  13. #include "wx/gdicmn.h"
  14. class WXDLLIMPEXP_FWD_CORE wxColour;
  15. class WXDLLIMPEXP_FWD_CORE wxBitmap;
  16. // ========================================================================
  17. // wxPen
  18. // ========================================================================
  19. class WXDLLIMPEXP_CORE wxPen: public wxGDIObject
  20. {
  21. public:
  22. wxPen();
  23. wxPen(const wxColour& col, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID);
  24. #if FUTURE_WXWIN_COMPATIBILITY_3_0
  25. wxDEPRECATED_FUTURE( wxPen(const wxColour& col, int width, int style) );
  26. #endif
  27. wxPen(const wxBitmap& stipple, int width);
  28. virtual ~wxPen();
  29. // FIXME: operator==() is wrong
  30. bool operator==(const wxPen& pen) const { return m_refData == pen.m_refData; }
  31. bool operator!=(const wxPen& pen) const { return !(*this == pen); }
  32. void SetColour(const wxColour& col) ;
  33. void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
  34. void SetWidth(int width);
  35. void SetStyle(wxPenStyle style);
  36. void SetStipple(const wxBitmap& stipple);
  37. void SetDashes(int nb_dashes, const wxDash *dash);
  38. void SetJoin(wxPenJoin join);
  39. void SetCap(wxPenCap cap);
  40. wxColour GetColour() const;
  41. int GetWidth() const;
  42. wxPenStyle GetStyle() const;
  43. wxPenJoin GetJoin() const;
  44. wxPenCap GetCap() const;
  45. int GetDashes(wxDash **ptr) const;
  46. wxBitmap *GetStipple() const;
  47. #if FUTURE_WXWIN_COMPATIBILITY_3_0
  48. wxDEPRECATED_FUTURE( void SetStyle(int style) )
  49. { SetStyle((wxPenStyle)style); }
  50. #endif
  51. // Cocoa-specific
  52. WX_NSColor GetNSColor();
  53. int GetCocoaLineDash(const CGFloat **pattern);
  54. protected:
  55. wxGDIRefData *CreateGDIRefData() const;
  56. wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
  57. DECLARE_DYNAMIC_CLASS(wxPen)
  58. };
  59. #endif // __WX_COCOA_PEN_H__