]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/brush.cpp
fix PCH in VC8 projects (until the next rebake...)
[wxWidgets.git] / src / gtk1 / brush.cpp
index 908cfd933cb7bbd24731a41a7d59f0275715ddd0..eb5606cfea9b6e3eeb666913bf80aa7257da81eb 100644 (file)
@@ -27,7 +27,7 @@ class wxBrushRefData: public wxGDIRefData
 public:
     wxBrushRefData()
     {
-        m_style = 0;
+        m_style = wxBRUSHSTYLE_INVALID;
     }
 
     wxBrushRefData( const wxBrushRefData& data )
@@ -63,6 +63,15 @@ wxBrush::wxBrush( const wxColour &colour, wxBrushStyle style )
     M_BRUSHDATA->m_colour = colour;
 }
 
+#if FUTURE_WXWIN_COMPATIBILITY_3_0
+wxBrush::wxBrush(const wxColour& col, int style)
+{
+    m_refData = new wxBrushRefData;
+    M_BRUSHDATA->m_style = (wxBrushStyle)style;
+    M_BRUSHDATA->m_colour = col;
+}
+#endif
+
 wxBrush::wxBrush( const wxBitmap &stippleBitmap )
 {
     m_refData = new wxBrushRefData();
@@ -71,9 +80,9 @@ wxBrush::wxBrush( const wxBitmap &stippleBitmap )
     M_BRUSHDATA->m_stipple = stippleBitmap;
 
     if (M_BRUSHDATA->m_stipple.GetMask())
-        M_BRUSHDATA->m_style = wxSTIPPLE_MASK_OPAQUE;
+        M_BRUSHDATA->m_style = wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE;
     else
-        M_BRUSHDATA->m_style = wxSTIPPLE;
+        M_BRUSHDATA->m_style = wxBRUSHSTYLE_STIPPLE_MASK;
 }
 
 wxBrush::~wxBrush()
@@ -102,33 +111,21 @@ bool wxBrush::operator == ( const wxBrush& brush ) const
 
 wxBrushStyle wxBrush::GetStyle() const
 {
-    if (m_refData == NULL)
-    {
-        wxFAIL_MSG( wxT("invalid brush") );
-        return 0;
-    }
+    wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, _T("invalid brush") );
 
     return M_BRUSHDATA->m_style;
 }
 
-wxColour &wxBrush::GetColour() const
+wxColour wxBrush::GetColour() const
 {
-    if (m_refData == NULL)
-    {
-        wxFAIL_MSG( wxT("invalid brush") );
-        return wxNullColour;
-    }
+    wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") );
 
     return M_BRUSHDATA->m_colour;
 }
 
 wxBitmap *wxBrush::GetStipple() const
 {
-    if (m_refData == NULL)
-    {
-        wxFAIL_MSG( wxT("invalid brush") );
-        return &wxNullBitmap;
-    }
+    wxCHECK_MSG( Ok(), NULL, _T("invalid brush") );
 
     return &M_BRUSHDATA->m_stipple;
 }
@@ -160,11 +157,7 @@ void wxBrush::SetStipple( const wxBitmap& stipple )
 
     M_BRUSHDATA->m_stipple = stipple;
     if (M_BRUSHDATA->m_stipple.GetMask())
-    {
-        M_BRUSHDATA->m_style = wxSTIPPLE_MASK_OPAQUE;
-    }
+        M_BRUSHDATA->m_style = wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE;
     else
-    {
-        M_BRUSHDATA->m_style = wxSTIPPLE;
-    }
+        M_BRUSHDATA->m_style = wxBRUSHSTYLE_STIPPLE_MASK;
 }