]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/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()
44 wxTheBrushList
->AddBrush(this);
50 wxTheBrushList
->RemoveBrush(this);
53 wxBrush::wxBrush(const wxColour
& col
, int Style
)
55 m_refData
= new wxBrushRefData
;
57 M_BRUSHDATA
->m_colour
= col
;
58 M_BRUSHDATA
->m_style
= Style
;
63 wxTheBrushList
->AddBrush(this);
66 wxBrush::wxBrush(const wxBitmap
& stipple
)
68 m_refData
= new wxBrushRefData
;
70 M_BRUSHDATA
->m_style
= wxSTIPPLE
;
71 M_BRUSHDATA
->m_stipple
= stipple
;
76 wxTheBrushList
->AddBrush(this);
79 void wxBrush::Unshare()
81 // Don't change shared data
84 m_refData
= new wxBrushRefData();
88 wxBrushRefData
* ref
= new wxBrushRefData(*(wxBrushRefData
*)m_refData
);
94 void wxBrush::SetColour(const wxColour
& col
)
98 M_BRUSHDATA
->m_colour
= col
;
103 void wxBrush::SetColour(unsigned char r
, unsigned char g
, unsigned char b
)
107 M_BRUSHDATA
->m_colour
.Set(r
, g
, b
);
112 void wxBrush::SetStyle(int Style
)
116 M_BRUSHDATA
->m_style
= Style
;
121 void wxBrush::SetStipple(const wxBitmap
& Stipple
)
125 M_BRUSHDATA
->m_stipple
= Stipple
;
130 bool wxBrush::RealizeResource()