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
);
58 virtual bool DoUnionWithRect(const wxRect
& rect
);
61 DECLARE_DYNAMIC_CLASS(wxRegion
)
62 friend class WXDLLIMPEXP_FWD_CORE wxRegionIterator
;
65 class WXDLLIMPEXP_CORE wxRegionIterator
: public wxObject
69 wxRegionIterator(const wxRegion
& region
);
70 wxRegionIterator(const wxRegionIterator
& iterator
);
71 virtual ~wxRegionIterator();
73 wxRegionIterator
& operator=(const wxRegionIterator
& iterator
);
75 void Reset() { m_current
= 0; }
76 void Reset(const wxRegion
& region
);
78 operator bool () const { return m_current
< m_numRects
; }
79 bool HaveRects() const { return m_current
< m_numRects
; }
81 wxRegionIterator
& operator++();
82 wxRegionIterator
operator++(int);
87 long GetWidth() const { return GetW(); }
89 long GetHeight() const { return GetH(); }
90 wxRect
GetRect() const { return wxRect((int)GetX(), (int)GetY(), (int)GetWidth(), (int)GetHeight()); }
93 void SetRects(long numRects
, wxRect
*rects
);
100 DECLARE_DYNAMIC_CLASS(wxRegionIterator
)
103 #endif // _WX_MAC_CARBON_REGION_H_