]> git.saurik.com Git - wxWidgets.git/blame - include/wx/os2/brush.h
fix header files so that they can be included directly without generating 'undefined...
[wxWidgets.git] / include / wx / os2 / brush.h
CommitLineData
0e320a79 1/////////////////////////////////////////////////////////////////////////////
46562151 2// Name: wx/os2/brush.h
0e320a79 3// Purpose: wxBrush class
37f214d5 4// Author: David Webster
0e320a79 5// Modified by:
37f214d5 6// Created: 10/13/99
0e320a79 7// RCS-ID: $Id$
37f214d5 8// Copyright: (c) David Webster
65571936 9// Licence: wxWindows licence
0e320a79
DW
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_BRUSH_H_
13#define _WX_BRUSH_H_
14
0e320a79
DW
15#include "wx/gdicmn.h"
16#include "wx/gdiobj.h"
17#include "wx/bitmap.h"
18
b5dbe15d 19class WXDLLIMPEXP_FWD_CORE wxBrush;
0e320a79
DW
20
21class WXDLLEXPORT wxBrushRefData: public wxGDIRefData
22{
b5dbe15d 23 friend class WXDLLIMPEXP_FWD_CORE wxBrush;
0e320a79
DW
24public:
25 wxBrushRefData();
15f03b25 26 wxBrushRefData(const wxBrushRefData& rData);
d3c7fc99 27 virtual ~wxBrushRefData();
0e320a79 28
7aa920b5
VZ
29 bool operator == (const wxBrushRefData& data) const
30 {
31 return (m_nStyle == data.m_nStyle &&
32 m_vStipple.IsSameAs(data.m_vStipple) &&
33 m_vColour == data.m_vColour);
34 }
35
0e320a79 36protected:
3e6858cd
FM
37 wxBrushStyle m_nStyle;
38 wxBitmap m_vStipple;
39 wxColour m_vColour;
40 WXHBRUSH m_hBrush; // in OS/2 GPI this will be the PS the pen is associated with
41 AREABUNDLE m_vBundle;
0e320a79
DW
42};
43
44#define M_BRUSHDATA ((wxBrushRefData *)m_refData)
45
46// Brush
cb9d5bd0 47class WXDLLEXPORT wxBrush: public wxBrushBase
0e320a79 48{
0e320a79 49public:
15f03b25 50 wxBrush();
3e6858cd 51 wxBrush(const wxColour& rCol, wxBrushStyle nStyle = wxBRUSHSTYLE_SOLID);
ac3688c0
FM
52#if FUTURE_WXWIN_COMPATIBILITY_3_0
53 wxDEPRECATED_FUTURE( wxBrush(const wxColour& col, int style) );
54#endif
15f03b25 55 wxBrush(const wxBitmap& rStipple);
d3c7fc99 56 virtual ~wxBrush();
15f03b25 57
86e75e59 58 bool operator == (const wxBrush& rBrush) const;
55ccdb93 59 inline bool operator != (const wxBrush& rBrush) const { return !(*this == rBrush); }
15f03b25
DW
60
61 virtual void SetColour(const wxColour& rColour);
1a1498c0 62 virtual void SetColour(unsigned char cRed, unsigned char cGreen, unsigned char cBrush);
15f03b25 63 virtual void SetPS(HPS hPS);
3e6858cd 64 virtual void SetStyle(wxBrushStyle nStyle);
15f03b25
DW
65 virtual void SetStipple(const wxBitmap& rStipple);
66
67 inline wxColour& GetColour(void) const { return (M_BRUSHDATA ? M_BRUSHDATA->m_vColour : wxNullColour); };
3e6858cd 68 virtual wxBrushStyle GetStyle(void) const { return (M_BRUSHDATA ? M_BRUSHDATA->m_nStyle : 0); };
15f03b25
DW
69 inline wxBitmap* GetStipple(void) const { return (M_BRUSHDATA ? & M_BRUSHDATA->m_vStipple : 0); };
70 inline int GetPS(void) const { return (M_BRUSHDATA ? M_BRUSHDATA->m_hBrush : 0); };
71
15f03b25
DW
72 //
73 // Implementation
74 //
75
76 //
77 // Useful helper: create the brush resource
78 //
79 bool RealizeResource(void);
17b1d76b 80 virtual WXHANDLE GetResourceHandle(void) const;
ab9d0a8c 81 bool FreeResource(bool bForce = false);
15f03b25 82 bool IsFree(void) const;
4b3f61d1
SN
83
84protected:
85 virtual wxGDIRefData *CreateGDIRefData() const;
86 virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
87
88private:
89 DECLARE_DYNAMIC_CLASS(wxBrush)
15f03b25 90}; // end of CLASS wxBrush
0e320a79
DW
91
92#endif
93 // _WX_BRUSH_H_