]> git.saurik.com Git - wxWidgets.git/blobdiff - src/dfb/brush.cpp
Finished review/fixes of GDI category of functions and macros.
[wxWidgets.git] / src / dfb / brush.cpp
index 93209e3362ec4f1a649bb335b00afc0025b26a48..51a295f9979be411cfa4d44f741edc38697abd8f 100644 (file)
 // wxBrush
 //-----------------------------------------------------------------------------
 
-class wxBrushRefData: public wxObjectRefData
+class wxBrushRefData : public wxGDIRefData
 {
 public:
-    wxBrushRefData(const wxColour& clr = wxNullColour, int style = wxSOLID)
+    wxBrushRefData(const wxColour& clr = wxNullColour, wxBrushStyle style = wxBRUSHSTYLE_SOLID)
     {
         m_colour = clr;
         SetStyle(style);
@@ -41,7 +41,9 @@ public:
         m_style = data.m_style;
     }
 
-    void SetStyle(int style)
+    virtual bool IsOk() const { return m_colour.IsOk(); }
+
+    void SetStyle(wxBrushStyle style)
     {
         if ( style != wxSOLID && style != wxTRANSPARENT )
         {
@@ -53,7 +55,7 @@ public:
     }
 
     wxColour       m_colour;
-    int            m_style;
+    wxBrushStyle   m_style;
 };
 
 //-----------------------------------------------------------------------------
@@ -62,7 +64,7 @@ public:
 
 IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject)
 
-wxBrush::wxBrush(const wxColour &colour, int style)
+wxBrush::wxBrush(const wxColour &colour, wxBrushStyle style)
 {
     m_refData = new wxBrushRefData(colour, style);
 }
@@ -80,12 +82,7 @@ bool wxBrush::operator==(const wxBrush& brush) const
     return m_refData == brush.m_refData;
 }
 
-bool wxBrush::IsOk() const
-{
-    return ((m_refData) && M_BRUSHDATA->m_colour.Ok());
-}
-
-int wxBrush::GetStyle() const
+wxBrushStyle wxBrush::GetStyle() const
 {
     if (m_refData == NULL)
     {
@@ -125,7 +122,7 @@ void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b)
     M_BRUSHDATA->m_colour.Set(r, g, b);
 }
 
-void wxBrush::SetStyle(int style)
+void wxBrush::SetStyle(wxBrushStyle style)
 {
     AllocExclusive();
     M_BRUSHDATA->SetStyle(style);
@@ -136,12 +133,12 @@ void wxBrush::SetStipple(const wxBitmap& WXUNUSED(stipple))
     wxFAIL_MSG( wxT("brushes with stipple bitmaps not implemented") );
 }
 
-wxObjectRefData *wxBrush::CreateRefData() const
+wxGDIRefData *wxBrush::CreateGDIRefData() const
 {
     return new wxBrushRefData;
 }
 
-wxObjectRefData *wxBrush::CloneRefData(const wxObjectRefData *data) const
+wxGDIRefData *wxBrush::CloneGDIRefData(const wxGDIRefData *data) const
 {
     return new wxBrushRefData(*(wxBrushRefData *)data);
 }