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
21 wxRegion(long x
, long y
, long w
, long h
);
22 wxRegion(const wxPoint
& topLeft
, const wxPoint
& bottomRight
);
23 wxRegion(const wxRect
& rect
);
24 wxRegion( WXHRGN hRegion
);
25 wxRegion(size_t n
, const wxPoint
*points
, wxPolygonFillMode fillStyle
= wxODDEVEN_RULE
);
27 wxRegion(const wxBitmap
& bmp
)
31 wxRegion(const wxBitmap
& bmp
,
32 const wxColour
& transColour
, int tolerance
= 0)
34 Union(bmp
, transColour
, tolerance
);
40 // wxRegionBase methods
42 virtual bool IsEmpty() const;
45 WXHRGN
GetWXHRGN() const ;
48 virtual wxGDIRefData
*CreateGDIRefData() const;
49 virtual wxGDIRefData
*CloneGDIRefData(const wxGDIRefData
*data
) const;
51 virtual bool DoIsEqual(const wxRegion
& region
) const;
52 virtual bool DoGetBox(wxCoord
& x
, wxCoord
& y
, wxCoord
& w
, wxCoord
& h
) const;
53 virtual wxRegionContain
DoContainsPoint(wxCoord x
, wxCoord y
) const;
54 virtual wxRegionContain
DoContainsRect(const wxRect
& rect
) const;
56 virtual bool DoOffset(wxCoord x
, wxCoord y
);
57 virtual bool DoCombine(const wxRegion
& region
, wxRegionOp op
);
60 DECLARE_DYNAMIC_CLASS(wxRegion
)
61 friend class WXDLLIMPEXP_FWD_CORE wxRegionIterator
;
64 class WXDLLIMPEXP_CORE wxRegionIterator
: public wxObject
68 wxRegionIterator(const wxRegion
& region
);
69 wxRegionIterator(const wxRegionIterator
& iterator
);
70 virtual ~wxRegionIterator();
72 wxRegionIterator
& operator=(const wxRegionIterator
& iterator
);
74 void Reset() { m_current
= 0; }
75 void Reset(const wxRegion
& region
);
77 operator bool () const { return m_current
< m_numRects
; }
78 bool HaveRects() const { return m_current
< m_numRects
; }
80 wxRegionIterator
& operator++();
81 wxRegionIterator
operator++(int);
86 long GetWidth() const { return GetW(); }
88 long GetHeight() const { return GetH(); }
89 wxRect
GetRect() const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); }
92 void SetRects(long numRects
, wxRect
*rects
);
99 DECLARE_DYNAMIC_CLASS(wxRegionIterator
)
102 #endif // _WX_MAC_CARBON_REGION_H_