1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/os2/region.h
3 // Purpose: wxRegion class
4 // Author: David Webster
7 // Copyright: (c) David Webster
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_OS2_REGION_H_
12 #define _WX_OS2_REGION_H_
15 #include "wx/os2/private.h"
17 class WXDLLIMPEXP_CORE wxRegion
: public wxRegionWithCombine
25 wxRegion( const wxPoint
& rTopLeft
26 ,const wxPoint
& rBottomRight
28 wxRegion(const wxRect
& rRect
);
29 wxRegion(WXHRGN hRegion
, WXHDC hPS
); // Hangs on to this region
30 wxRegion(size_t n
, const wxPoint
*points
, wxPolygonFillMode fillStyle
= wxODDEVEN_RULE
);
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 wxGDIRefData
* CreateGDIRefData(void) const;
67 virtual wxGDIRefData
* CloneGDIRefData(const wxGDIRefData
* 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 WXDLLIMPEXP_FWD_CORE wxRegionIterator
;
78 DECLARE_DYNAMIC_CLASS(wxRegion
);
80 }; // end of CLASS wxRegion
82 class WXDLLIMPEXP_CORE wxRegionIterator
: public wxObject
86 wxRegionIterator(const wxRegion
& rRegion
);
87 virtual ~wxRegionIterator();
89 void Reset(void) { m_lCurrent
= 0; }
90 void Reset(const wxRegion
& rRegion
);
92 operator bool (void) const { return m_lCurrent
< m_lNumRects
; }
93 bool HaveRects(void) const { return m_lCurrent
< m_lNumRects
; }
95 void operator ++ (void);
96 void operator ++ (int);
98 wxCoord
GetX(void) const;
99 wxCoord
GetY(void) const;
100 wxCoord
GetW(void) const;
101 wxCoord
GetWidth(void) const { return GetW(); }
102 wxCoord
GetH(void) const;
103 wxCoord
GetHeight(void) const { return GetH(); }
104 wxRect
GetRect(void) const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); }
112 DECLARE_DYNAMIC_CLASS(wxRegionIterator
)
113 }; // end of wxRegionIterator
115 #endif // _WX_OS2_REGION_H_