X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4bb6408c2631988fab9925014c6619358bf867de..710968c3aa9be5b1de7469e1a9a4da0cd2481b6c:/src/motif/brush.cpp diff --git a/src/motif/brush.cpp b/src/motif/brush.cpp index 45a73b74af..685b376427 100644 --- a/src/motif/brush.cpp +++ b/src/motif/brush.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: brush.cpp +// Name: src/motif/brush.cpp // Purpose: wxBrush // Author: Julian Smart // Modified by: // Created: 17/09/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -17,42 +17,31 @@ #include "wx/utils.h" #include "wx/brush.h" -#if !USE_SHARED_LIBRARIES IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject) -#endif 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 wxBrush::wxBrush() { - if ( wxTheBrushList ) - wxTheBrushList->AddBrush(this); } wxBrush::~wxBrush() { - if ( wxTheBrushList ) - wxTheBrushList->RemoveBrush(this); } wxBrush::wxBrush(const wxColour& col, int Style) @@ -63,23 +52,6 @@ wxBrush::wxBrush(const wxColour& col, int Style) 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); } wxBrush::wxBrush(const wxBitmap& stipple) @@ -90,24 +62,21 @@ wxBrush::wxBrush(const wxBitmap& stipple) 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) @@ -119,16 +88,7 @@ void wxBrush::SetColour(const wxColour& col) RealizeResource(); } -void wxBrush::SetColour(const wxString& col) -{ - Unshare(); - - M_BRUSHDATA->m_colour = col; - - RealizeResource(); -} - -void wxBrush::SetColour(const unsigned char r, const unsigned char g, const unsigned char b) +void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b) { Unshare(); @@ -155,8 +115,9 @@ void wxBrush::SetStipple(const wxBitmap& Stipple) RealizeResource(); } -void wxBrush::RealizeResource() +bool wxBrush::RealizeResource() { -// TODO: create the brush + // Nothing more to do + return TRUE; }