]>
git.saurik.com Git - wxWidgets.git/blob - src/stubs/brush.cpp
1 /////////////////////////////////////////////////////////////////////////////
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "brush.h"
20 IMPLEMENT_DYNAMIC_CLASS(wxBrush
, wxGDIObject
)
22 wxBrushRefData::wxBrushRefData()
28 wxBrushRefData::wxBrushRefData(const wxBrushRefData
& data
)
30 m_style
= data
.m_style
;
31 m_stipple
= data
.m_stipple
;
32 m_colour
= data
.m_colour
;
38 wxBrushRefData::~wxBrushRefData()
47 wxTheBrushList
->AddBrush(this);
53 wxTheBrushList
->RemoveBrush(this);
56 wxBrush::wxBrush(const wxColour
& col
, int Style
)
58 m_refData
= new wxBrushRefData
;
60 M_BRUSHDATA
->m_colour
= col
;
61 M_BRUSHDATA
->m_style
= Style
;
66 wxTheBrushList
->AddBrush(this);
69 wxBrush::wxBrush(const wxBitmap
& stipple
)
71 m_refData
= new wxBrushRefData
;
73 M_BRUSHDATA
->m_style
= wxSTIPPLE
;
74 M_BRUSHDATA
->m_stipple
= stipple
;
79 wxTheBrushList
->AddBrush(this);
82 void wxBrush::Unshare()
84 // Don't change shared data
87 m_refData
= new wxBrushRefData();
91 wxBrushRefData
* ref
= new wxBrushRefData(*(wxBrushRefData
*)m_refData
);
97 void wxBrush::SetColour(const wxColour
& col
)
101 M_BRUSHDATA
->m_colour
= col
;
106 void wxBrush::SetColour(unsigned char r
, unsigned char g
, unsigned char b
)
110 M_BRUSHDATA
->m_colour
.Set(r
, g
, b
);
115 void wxBrush::SetStyle(int Style
)
119 M_BRUSHDATA
->m_style
= Style
;
124 void wxBrush::SetStipple(const wxBitmap
& Stipple
)
128 M_BRUSHDATA
->m_stipple
= Stipple
;
133 bool wxBrush::RealizeResource()
135 // TODO: create the brush