]> git.saurik.com Git - wxWidgets.git/blame - include/wx/cocoa/pen.h
Fix memory leak by letting the base class version handle the
[wxWidgets.git] / include / wx / cocoa / pen.h
CommitLineData
a24aff65 1/////////////////////////////////////////////////////////////////////////////
cfbef359 2// Name: wx/cocoa/pen.h
a24aff65 3// Purpose: wxPen class
cfbef359 4// Author: David Elliott
a24aff65 5// Modified by:
8e517013 6// Created: 2003/08/02 (stubs from 22.03.2003)
a24aff65 7// RCS-ID: $Id$
cfbef359 8// Copyright: (c) 2003 David Elliott
77ffb593 9// Licence: wxWidgets licence
a24aff65
DE
10/////////////////////////////////////////////////////////////////////////////
11
8e517013
DE
12#ifndef __WX_COCOA_PEN_H__
13#define __WX_COCOA_PEN_H__
a24aff65
DE
14
15#include "wx/gdiobj.h"
8e517013 16#include "wx/gdicmn.h"
a24aff65 17
8e517013
DE
18class WXDLLEXPORT wxColour;
19class WXDLLEXPORT wxBitmap;
a24aff65 20
8e517013
DE
21// ========================================================================
22// wxPen
23// ========================================================================
a24aff65
DE
24class WXDLLEXPORT wxPen: public wxGDIObject
25{
8e517013 26 DECLARE_DYNAMIC_CLASS(wxPen)
a24aff65 27public:
8e517013
DE
28 wxPen();
29 wxPen(const wxColour& col, int width = 1, int style = wxSOLID);
30 wxPen(const wxBitmap& stipple, int width);
31 wxPen(const wxPen& pen)
32 : wxGDIObject()
33 { Ref(pen); }
34 ~wxPen();
35
36 // wxObjectRefData
37 wxObjectRefData *CreateRefData() const;
38 wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
39
40 inline wxPen& operator = (const wxPen& pen)
41 { if (*this == pen) return (*this); Ref(pen); return *this; }
42 inline bool operator == (const wxPen& pen)
43 { return m_refData == pen.m_refData; }
44 inline bool operator != (const wxPen& pen)
45 { return m_refData != pen.m_refData; }
46
47 virtual bool Ok() const { return (m_refData != NULL) ; }
48
49 void SetColour(const wxColour& col) ;
50 void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
51
52 void SetWidth(int width);
53 void SetStyle(int style);
54 void SetStipple(const wxBitmap& stipple);
55 void SetDashes(int nb_dashes, const wxDash *dash);
56 void SetJoin(int join);
57 void SetCap(int cap);
58
59 wxColour& GetColour() const;
60 int GetWidth() const;
61 int GetStyle() const;
62 int GetJoin() const;
63 int GetCap() const;
64 int GetDashes(wxDash **ptr) const;
65 wxBitmap *GetStipple() const;
66
67 WX_NSColor GetNSColor();
1f631557 68 int GetCocoaLineDash(const float **pattern);
a24aff65
DE
69};
70
8e517013 71#endif // __WX_COCOA_PEN_H__