// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
-#pragma implementation "brush.h"
-#endif
+// for compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
-#include "wx/setup.h"
-#include "wx/utils.h"
#include "wx/brush.h"
-#include "wx/colour.h"
+
+#ifndef WX_PRECOMP
+ #include "wx/utils.h"
+ #include "wx/bitmap.h"
+ #include "wx/colour.h"
+#endif
//-----------------------------------------------------------------------------
// wxBrush
//-----------------------------------------------------------------------------
-class wxBrushRefData: public wxObjectRefData
+class wxBrushRefData : public wxGDIRefData
{
public:
wxBrushRefData()
{
m_style = 0;
}
-
+
wxBrushRefData( const wxBrushRefData& data )
{
m_style = data.m_style;
m_stipple = data.m_stipple;
m_colour = data.m_colour;
}
-
+
bool operator == (const wxBrushRefData& data) const
{
return (m_style == data.m_style &&
- m_stipple == data.m_stipple &&
+ m_stipple.IsSameAs(data.m_stipple) &&
m_colour == data.m_colour);
}
-
+
int m_style;
wxColour m_colour;
wxBitmap m_stipple;
// m_refData unrefed in ~wxObject
}
-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);
}
bool wxBrush::operator == ( const wxBrush& brush ) const
{
- if (m_refData == brush.m_refData) return TRUE;
-
- if (!m_refData || !brush.m_refData) return FALSE;
-
+ if (m_refData == brush.m_refData) return true;
+
+ if (!m_refData || !brush.m_refData) return false;
+
return ( *(wxBrushRefData*)m_refData == *(wxBrushRefData*)brush.m_refData );
}
void wxBrush::SetColour( const wxColour& col )
{
AllocExclusive();
-
+
M_BRUSHDATA->m_colour = col;
}
void wxBrush::SetColour( unsigned char r, unsigned char g, unsigned char b )
{
AllocExclusive();
-
+
M_BRUSHDATA->m_colour.Set( r, g, b );
}
void wxBrush::SetStyle( int style )
{
AllocExclusive();
-
+
M_BRUSHDATA->m_style = style;
}
void wxBrush::SetStipple( const wxBitmap& stipple )
{
AllocExclusive();
-
+
M_BRUSHDATA->m_stipple = stipple;
if (M_BRUSHDATA->m_stipple.GetMask())
{