1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/osx/carbon/region.h
3 // Purpose: wxRegion class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_MAC_CARBON_REGION_H_
13 #define _WX_MAC_CARBON_REGION_H_
17 class WXDLLIMPEXP_CORE wxRegion
: public wxRegionWithCombine
20 wxRegion(long x
, long y
, long w
, long h
);
21 wxRegion(const wxPoint
& topLeft
, const wxPoint
& bottomRight
);
22 wxRegion(const wxRect
& rect
);
23 wxRegion( WXHRGN hRegion
);
24 wxRegion(size_t n
, const wxPoint
*points
, wxPolygonFillMode fillStyle
= wxODDEVEN_RULE
);
26 wxRegion(const wxBitmap
& bmp
)
30 wxRegion(const wxBitmap
& bmp
,
31 const wxColour
& transColour
, int tolerance
= 0)
33 Union(bmp
, transColour
, tolerance
);
38 // wxRegionBase methods
40 virtual bool IsEmpty() const;
43 WXHRGN
GetWXHRGN() const ;
46 virtual wxGDIRefData
*CreateGDIRefData() const;
47 virtual wxGDIRefData
*CloneGDIRefData(const wxGDIRefData
*data
) const;
49 virtual bool DoIsEqual(const wxRegion
& region
) const;
50 virtual bool DoGetBox(wxCoord
& x
, wxCoord
& y
, wxCoord
& w
, wxCoord
& h
) const;
51 virtual wxRegionContain
DoContainsPoint(wxCoord x
, wxCoord y
) const;
52 virtual wxRegionContain
DoContainsRect(const wxRect
& rect
) const;
54 virtual bool DoOffset(wxCoord x
, wxCoord y
);
55 virtual bool DoCombine(const wxRegion
& region
, wxRegionOp op
);
58 DECLARE_DYNAMIC_CLASS(wxRegion
)
59 friend class WXDLLIMPEXP_FWD_CORE wxRegionIterator
;
62 class WXDLLIMPEXP_CORE wxRegionIterator
: public wxObject
66 wxRegionIterator(const wxRegion
& region
);
67 wxRegionIterator(const wxRegionIterator
& iterator
);
68 virtual ~wxRegionIterator();
70 wxRegionIterator
& operator=(const wxRegionIterator
& iterator
);
72 void Reset() { m_current
= 0; }
73 void Reset(const wxRegion
& region
);
75 operator bool () const { return m_current
< m_numRects
; }
76 bool HaveRects() const { return m_current
< m_numRects
; }
78 wxRegionIterator
& operator++();
79 wxRegionIterator
operator++(int);
84 long GetWidth() const { return GetW(); }
86 long GetHeight() const { return GetH(); }
87 wxRect
GetRect() const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); }
90 void SetRects(long numRects
, wxRect
*rects
);
97 DECLARE_DYNAMIC_CLASS(wxRegionIterator
)
100 #endif // _WX_MAC_CARBON_REGION_H_