]>
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()
30 wxBrushRefData::wxBrushRefData(const wxBrushRefData
& data
)
32 m_style
= data
.m_style
;
33 m_stipple
= data
.m_stipple
;
34 m_colour
= data
.m_colour
;
40 wxBrushRefData::~wxBrushRefData()
49 wxTheBrushList
->AddBrush(this);
55 wxTheBrushList
->RemoveBrush(this);
58 wxBrush::wxBrush(const wxColour
& col
, int Style
)
60 m_refData
= new wxBrushRefData
;
62 M_BRUSHDATA
->m_colour
= col
;
63 M_BRUSHDATA
->m_style
= Style
;
68 wxTheBrushList
->AddBrush(this);
71 wxBrush::wxBrush(const wxBitmap
& stipple
)
73 m_refData
= new wxBrushRefData
;
75 M_BRUSHDATA
->m_style
= wxSTIPPLE
;
76 M_BRUSHDATA
->m_stipple
= stipple
;
81 wxTheBrushList
->AddBrush(this);
84 void wxBrush::Unshare()
86 // Don't change shared data
89 m_refData
= new wxBrushRefData();
93 wxBrushRefData
* ref
= new wxBrushRefData(*(wxBrushRefData
*)m_refData
);
99 void wxBrush::SetColour(const wxColour
& col
)
103 M_BRUSHDATA
->m_colour
= col
;
108 void wxBrush::SetColour(unsigned char r
, unsigned char g
, unsigned char b
)
112 M_BRUSHDATA
->m_colour
.Set(r
, g
, b
);
117 void wxBrush::SetStyle(int Style
)
121 M_BRUSHDATA
->m_style
= Style
;
126 void wxBrush::SetStipple(const wxBitmap
& Stipple
)
130 M_BRUSHDATA
->m_stipple
= Stipple
;
135 bool wxBrush::RealizeResource()
137 // TODO: create the brush