1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxRegion class
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_OS2_REGION_H_
13 #define _WX_OS2_REGION_H_
16 #include "wx/os2/private.h"
18 class WXDLLEXPORT wxRegion
: public wxRegionWithCombine
26 wxRegion( const wxPoint
& rTopLeft
27 ,const wxPoint
& rBottomRight
29 wxRegion(const wxRect
& rRect
);
30 wxRegion(WXHRGN hRegion
, WXHDC hPS
); // Hangs on to this region
31 wxRegion( const wxBitmap
& bmp
)
35 wxRegion( const wxBitmap
& bmp
,
36 const wxColour
& transColour
, int tolerance
= 0)
38 Union(bmp
, transColour
, tolerance
);
49 // Clear current region
56 virtual bool IsEmpty() const;
59 // Get internal region handle
61 WXHRGN
GetHRGN() const;
66 virtual wxObjectRefData
* CreateData(void) const;
67 virtual wxObjectRefData
* CloneData(const wxObjectRefData
* pData
) const;
69 virtual bool DoIsEqual(const wxRegion
& region
) const;
70 virtual bool DoGetBox(wxCoord
& x
, wxCoord
& y
, wxCoord
& w
, wxCoord
& h
) const;
71 virtual wxRegionContain
DoContainsPoint(wxCoord x
, wxCoord y
) const;
72 virtual wxRegionContain
DoContainsRect(const wxRect
& rect
) const;
74 virtual bool DoOffset(wxCoord x
, wxCoord y
);
75 virtual bool DoCombine(const wxRegion
& region
, wxRegionOp op
);
77 friend class WXDLLEXPORT wxRegionIterator
;
78 DECLARE_DYNAMIC_CLASS(wxRegion
);
80 }; // end of CLASS wxRegion
82 class WXDLLEXPORT wxRegionIterator
: public wxObject
84 DECLARE_DYNAMIC_CLASS(wxRegionIterator
);
87 wxRegionIterator(const wxRegion
& rRegion
);
88 virtual ~wxRegionIterator();
90 void Reset(void) { m_lCurrent
= 0; }
91 void Reset(const wxRegion
& rRegion
);
93 operator bool (void) const { return m_lCurrent
< m_lNumRects
; }
94 bool HaveRects(void) const { return m_lCurrent
< m_lNumRects
; }
96 void operator ++ (void);
97 void operator ++ (int);
99 wxCoord
GetX(void) const;
100 wxCoord
GetY(void) const;
101 wxCoord
GetW(void) const;
102 wxCoord
GetWidth(void) const { return GetW(); }
103 wxCoord
GetH(void) const;
104 wxCoord
GetHeight(void) const { return GetH(); }
105 wxRect
GetRect(void) const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); }
112 }; // end of wxRegionIterator
114 #endif // _WX_OS2_REGION_H_