]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mgl/brush.cpp
Put some life into GTK 2.0 drawing.
[wxWidgets.git] / src / mgl / brush.cpp
index 6bddd63b3b2b3e926d972f2ca1b79fe6248a2930..437a499948cde247d6c0d9c40ea4bea60454cd45 100644 (file)
@@ -3,7 +3,7 @@
 // Purpose:
 // Author:      Vaclav Slavik
 // Id:          $Id$
-// Copyright:   (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
+// Copyright:   (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
@@ -223,25 +223,25 @@ void* wxBrush::GetPixPattern() const
 
 void wxBrush::SetColour(const wxColour& col)
 {
-    Unshare();
+    AllocExclusive();
     M_BRUSHDATA->m_colour = col;
 }
 
 void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b)
 {
-    Unshare();
+    AllocExclusive();
     M_BRUSHDATA->m_colour.Set(r, g, b);
 }
 
 void wxBrush::SetStyle( int style )
 {
-    Unshare();
+    AllocExclusive();
     M_BRUSHDATA->m_style = style;
 }
 
 void wxBrush::SetStipple(const wxBitmap& stipple)
 {
-    Unshare();
+    AllocExclusive();
 
     wxCHECK_RET( stipple.Ok(), _T("invalid bitmap") );
     wxCHECK_RET( stipple.GetWidth() == 8 && stipple.GetHeight() == 8, 
@@ -257,17 +257,13 @@ void wxBrush::SetStipple(const wxBitmap& stipple)
         M_BRUSHDATA->m_style = wxSTIPPLE;
 }
 
-void wxBrush::Unshare()
+wxObjectRefData *wxBrush::CreateRefData() const
 {
-    if (!m_refData)
-    {
-        m_refData = new wxBrushRefData();
-    }
-    else
-    {
-        wxBrushRefData* ref = new wxBrushRefData(*(wxBrushRefData*)m_refData);
-        UnRef();
-        m_refData = ref;
-    }
+    return new wxBrushRefData;
+}
+
+wxObjectRefData *wxBrush::CloneRefData(const wxObjectRefData *data) const
+{
+    return new wxBrushRefData(*(wxBrushRefData *)data);
 }