]> git.saurik.com Git - wxWidgets.git/blob - include/wx/cocoa/brush.h
renamed GlobalHandle class to GlobalPtr to avoid conflict with the Win32 function
[wxWidgets.git] / include / wx / cocoa / brush.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: brush.h
3 // Purpose: wxBrush class
4 // Author: AUTHOR
5 // Modified by:
6 // Created: ??/??/98
7 // RCS-ID: $Id$
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_BRUSH_H_
13 #define _WX_BRUSH_H_
14
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "brush.h"
17 #endif
18
19 #include "wx/gdicmn.h"
20 #include "wx/gdiobj.h"
21 #include "wx/bitmap.h"
22
23 class WXDLLEXPORT wxBrush;
24
25 // Brush
26 class WXDLLEXPORT wxBrush: public wxGDIObject
27 {
28 DECLARE_DYNAMIC_CLASS(wxBrush)
29
30 public:
31 wxBrush();
32 wxBrush(const wxColour& col, int style);
33 wxBrush(const wxBitmap& stipple);
34 wxBrush(const wxBrush& brush)
35 : wxGDIObject()
36 { Ref(brush); }
37 ~wxBrush();
38
39 virtual void SetColour(const wxColour& col) ;
40 virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
41 virtual void SetStyle(int style) ;
42 virtual void SetStipple(const wxBitmap& stipple) ;
43
44 wxBrush& operator = (const wxBrush& brush)
45 { if (*this == brush) return (*this); Ref(brush); return *this; }
46 bool operator == (const wxBrush& brush)
47 { return m_refData == brush.m_refData; }
48 bool operator != (const wxBrush& brush)
49 { return m_refData != brush.m_refData; }
50
51 wxColour& GetColour() const ;
52 int GetStyle() const ;
53 wxBitmap *GetStipple() const ;
54
55 virtual bool Ok() const { return (m_refData != NULL) ; }
56
57 // Implementation
58
59 // Useful helper: create the brush resource
60 bool RealizeResource();
61
62 // When setting properties, we must make sure we're not changing
63 // another object
64 void Unshare();
65 };
66
67 #endif
68 // _WX_BRUSH_H_