]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/brush.cpp
1 /////////////////////////////////////////////////////////////////////////////
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "brush.h"
20 #if !USE_SHARED_LIBRARIES
21 IMPLEMENT_DYNAMIC_CLASS(wxBrush
, wxGDIObject
)
24 wxBrushRefData::wxBrushRefData()
29 wxBrushRefData::wxBrushRefData(const wxBrushRefData
& data
)
31 m_style
= data
.m_style
;
32 m_stipple
= data
.m_stipple
;
33 m_colour
= data
.m_colour
;
36 wxBrushRefData::~wxBrushRefData()
49 wxBrush::wxBrush(const wxColour
& col
, int Style
)
51 m_refData
= new wxBrushRefData
;
53 M_BRUSHDATA
->m_colour
= col
;
54 M_BRUSHDATA
->m_style
= Style
;
59 wxBrush::wxBrush(const wxBitmap
& stipple
)
61 m_refData
= new wxBrushRefData
;
63 M_BRUSHDATA
->m_style
= wxSTIPPLE
;
64 M_BRUSHDATA
->m_stipple
= stipple
;
69 void wxBrush::Unshare()
71 // Don't change shared data
74 m_refData
= new wxBrushRefData();
78 wxBrushRefData
* ref
= new wxBrushRefData(*(wxBrushRefData
*)m_refData
);
84 void wxBrush::SetColour(const wxColour
& col
)
88 M_BRUSHDATA
->m_colour
= col
;
93 void wxBrush::SetColour(unsigned char r
, unsigned char g
, unsigned char b
)
97 M_BRUSHDATA
->m_colour
.Set(r
, g
, b
);
102 void wxBrush::SetStyle(int Style
)
106 M_BRUSHDATA
->m_style
= Style
;
111 void wxBrush::SetStipple(const wxBitmap
& Stipple
)
115 M_BRUSHDATA
->m_stipple
= Stipple
;
120 bool wxBrush::RealizeResource()