X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4bb6408c2631988fab9925014c6619358bf867de..7b9da2077d0975db6c965a85c91d5aca671ab5e3:/src/motif/brush.cpp diff --git a/src/motif/brush.cpp b/src/motif/brush.cpp index 45a73b74af..1b8069646b 100644 --- a/src/motif/brush.cpp +++ b/src/motif/brush.cpp @@ -24,22 +24,17 @@ IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject) wxBrushRefData::wxBrushRefData() { m_style = wxSOLID; -// TODO: null data } wxBrushRefData::wxBrushRefData(const wxBrushRefData& data) { - m_style = data.m_style; - m_stipple = data.m_stipple; - m_colour = data.m_colour; -/* TODO: null data - m_hBrush = 0; -*/ + m_style = data.m_style; + m_stipple = data.m_stipple; + m_colour = data.m_colour; } wxBrushRefData::~wxBrushRefData() { -// TODO: delete data } // Brushes @@ -58,26 +53,12 @@ wxBrush::~wxBrush() wxBrush::wxBrush(const wxColour& col, int Style) { m_refData = new wxBrushRefData; - + M_BRUSHDATA->m_colour = col; M_BRUSHDATA->m_style = Style; - + RealizeResource(); - - if ( wxTheBrushList ) - wxTheBrushList->AddBrush(this); -} - -wxBrush::wxBrush(const wxString& col, int Style) -{ - m_refData = new wxBrushRefData; - - // Implicit conversion from string to wxColour via colour database - M_BRUSHDATA->m_colour = col; - M_BRUSHDATA->m_style = Style; - - RealizeResource(); - + if ( wxTheBrushList ) wxTheBrushList->AddBrush(this); } @@ -85,78 +66,70 @@ wxBrush::wxBrush(const wxString& col, int Style) wxBrush::wxBrush(const wxBitmap& stipple) { m_refData = new wxBrushRefData; - + M_BRUSHDATA->m_style = wxSTIPPLE; M_BRUSHDATA->m_stipple = stipple; - + RealizeResource(); - + if ( wxTheBrushList ) wxTheBrushList->AddBrush(this); } void wxBrush::Unshare() { - // Don't change shared data - if (!m_refData) + // Don't change shared data + if (!m_refData) { - m_refData = new wxBrushRefData(); - } + m_refData = new wxBrushRefData(); + } else { - wxBrushRefData* ref = new wxBrushRefData(*(wxBrushRefData*)m_refData); - UnRef(); - m_refData = ref; - } + wxBrushRefData* ref = new wxBrushRefData(*(wxBrushRefData*)m_refData); + UnRef(); + m_refData = ref; + } } void wxBrush::SetColour(const wxColour& col) { Unshare(); - + M_BRUSHDATA->m_colour = col; - + RealizeResource(); } -void wxBrush::SetColour(const wxString& col) +void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b) { Unshare(); - - M_BRUSHDATA->m_colour = col; - - RealizeResource(); -} - -void wxBrush::SetColour(const unsigned char r, const unsigned char g, const unsigned char b) -{ - Unshare(); - + M_BRUSHDATA->m_colour.Set(r, g, b); - + RealizeResource(); } void wxBrush::SetStyle(int Style) { Unshare(); - + M_BRUSHDATA->m_style = Style; - + RealizeResource(); } void wxBrush::SetStipple(const wxBitmap& Stipple) { Unshare(); - + M_BRUSHDATA->m_stipple = Stipple; - + RealizeResource(); } -void wxBrush::RealizeResource() +bool wxBrush::RealizeResource() { -// TODO: create the brush + // Nothing more to do + return TRUE; }