1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/os2/region.h
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(size_t n
, const wxPoint
*points
, int fillStyle
= wxODDEVEN_RULE
);
32 wxRegion( const wxBitmap
& bmp
)
36 wxRegion( const wxBitmap
& bmp
,
37 const wxColour
& transColour
, int tolerance
= 0)
39 Union(bmp
, transColour
, tolerance
);
50 // Clear current region
57 virtual bool IsEmpty() const;
60 // Get internal region handle
62 WXHRGN
GetHRGN() const;
67 virtual wxObjectRefData
* CreateData(void) const;
68 virtual wxObjectRefData
* CloneData(const wxObjectRefData
* pData
) const;
70 virtual bool DoIsEqual(const wxRegion
& region
) const;
71 virtual bool DoGetBox(wxCoord
& x
, wxCoord
& y
, wxCoord
& w
, wxCoord
& h
) const;
72 virtual wxRegionContain
DoContainsPoint(wxCoord x
, wxCoord y
) const;
73 virtual wxRegionContain
DoContainsRect(const wxRect
& rect
) const;
75 virtual bool DoOffset(wxCoord x
, wxCoord y
);
76 virtual bool DoCombine(const wxRegion
& region
, wxRegionOp op
);
78 friend class WXDLLIMPEXP_FWD_CORE wxRegionIterator
;
79 DECLARE_DYNAMIC_CLASS(wxRegion
);
81 }; // end of CLASS wxRegion
83 class WXDLLEXPORT wxRegionIterator
: public wxObject
85 DECLARE_DYNAMIC_CLASS(wxRegionIterator
);
88 wxRegionIterator(const wxRegion
& rRegion
);
89 virtual ~wxRegionIterator();
91 void Reset(void) { m_lCurrent
= 0; }
92 void Reset(const wxRegion
& rRegion
);
94 operator bool (void) const { return m_lCurrent
< m_lNumRects
; }
95 bool HaveRects(void) const { return m_lCurrent
< m_lNumRects
; }
97 void operator ++ (void);
98 void operator ++ (int);
100 wxCoord
GetX(void) const;
101 wxCoord
GetY(void) const;
102 wxCoord
GetW(void) const;
103 wxCoord
GetWidth(void) const { return GetW(); }
104 wxCoord
GetH(void) const;
105 wxCoord
GetHeight(void) const { return GetH(); }
106 wxRect
GetRect(void) const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); }
113 }; // end of wxRegionIterator
115 #endif // _WX_OS2_REGION_H_