1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxBrush class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "brush.h"
19 #include "wx/gdicmn.h"
20 #include "wx/gdiobj.h"
21 #include "wx/bitmap.h"
23 class WXDLLEXPORT wxBrush
;
25 class WXDLLEXPORT wxBrushRefData
: public wxGDIRefData
27 friend class WXDLLEXPORT wxBrush
;
30 wxBrushRefData(const wxBrushRefData
& data
);
38 /* TODO: implementation
43 #define M_BRUSHDATA ((wxBrushRefData *)m_refData)
46 class WXDLLEXPORT wxBrush
: public wxGDIObject
48 DECLARE_DYNAMIC_CLASS(wxBrush
)
52 wxBrush(const wxColour
& col
, int style
);
53 wxBrush(const wxBitmap
& stipple
);
54 inline wxBrush(const wxBrush
& brush
) { Ref(brush
); }
55 inline wxBrush(const wxBrush
* brush
) { if (brush
) Ref(*brush
); }
58 virtual void SetColour(const wxColour
& col
) ;
59 virtual void SetColour(unsigned char r
, unsigned char g
, unsigned char b
) ;
60 virtual void SetStyle(int style
) ;
61 virtual void SetStipple(const wxBitmap
& stipple
) ;
63 inline wxBrush
& operator = (const wxBrush
& brush
) { if (*this == brush
) return (*this); Ref(brush
); return *this; }
64 inline bool operator == (const wxBrush
& brush
) { return m_refData
== brush
.m_refData
; }
65 inline bool operator != (const wxBrush
& brush
) { return m_refData
!= brush
.m_refData
; }
67 inline wxColour
& GetColour() const { return (M_BRUSHDATA
? M_BRUSHDATA
->m_colour
: wxNullColour
); };
68 inline int GetStyle() const { return (M_BRUSHDATA
? M_BRUSHDATA
->m_style
: 0); };
69 inline wxBitmap
*GetStipple() const { return (M_BRUSHDATA
? & M_BRUSHDATA
->m_stipple
: 0); };
71 virtual bool Ok() const { return (m_refData
!= NULL
) ; }
75 // Useful helper: create the brush resource
76 bool RealizeResource();
78 // When setting properties, we must make sure we're not changing