]>
git.saurik.com Git - wxWidgets.git/blob - src/motif/brush.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/motif/brush.cpp
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "brush.h"
20 IMPLEMENT_DYNAMIC_CLASS(wxBrush
, wxGDIObject
)
22 wxBrushRefData::wxBrushRefData()
27 wxBrushRefData::wxBrushRefData(const wxBrushRefData
& data
)
29 m_style
= data
.m_style
;
30 m_stipple
= data
.m_stipple
;
31 m_colour
= data
.m_colour
;
34 wxBrushRefData::~wxBrushRefData()
47 wxBrush::wxBrush(const wxColour
& col
, int Style
)
49 m_refData
= new wxBrushRefData
;
51 M_BRUSHDATA
->m_colour
= col
;
52 M_BRUSHDATA
->m_style
= Style
;
57 wxBrush::wxBrush(const wxBitmap
& stipple
)
59 m_refData
= new wxBrushRefData
;
61 M_BRUSHDATA
->m_style
= wxSTIPPLE
;
62 M_BRUSHDATA
->m_stipple
= stipple
;
67 void wxBrush::Unshare()
69 // Don't change shared data
72 m_refData
= new wxBrushRefData();
76 wxBrushRefData
* ref
= new wxBrushRefData(*(wxBrushRefData
*)m_refData
);
82 void wxBrush::SetColour(const wxColour
& col
)
86 M_BRUSHDATA
->m_colour
= col
;
91 void wxBrush::SetColour(unsigned char r
, unsigned char g
, unsigned char b
)
95 M_BRUSHDATA
->m_colour
.Set(r
, g
, b
);
100 void wxBrush::SetStyle(int Style
)
104 M_BRUSHDATA
->m_style
= Style
;
109 void wxBrush::SetStipple(const wxBitmap
& Stipple
)
113 M_BRUSHDATA
->m_stipple
= Stipple
;
118 bool wxBrush::RealizeResource()
120 // Nothing more to do