1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/region.h
3 // Purpose: wxRegion class
4 // Author: David Elliott
8 // Copyright: (c) 2004 David Elliott
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_COCOA_REGION_H__
13 #define _WX_COCOA_REGION_H__
15 #include "wx/generic/region.h"
17 class WXDLLEXPORT wxRegion
: public wxRegionGeneric
19 DECLARE_DYNAMIC_CLASS(wxRegion
);
21 wxRegion(wxCoord x
, wxCoord y
, wxCoord w
, wxCoord h
)
22 : wxRegionGeneric(x
,y
,w
,h
)
24 wxRegion(const wxPoint
& topLeft
, const wxPoint
& bottomRight
)
25 : wxRegionGeneric(topLeft
, bottomRight
)
27 wxRegion(const wxRect
& rect
)
28 : wxRegionGeneric(rect
)
31 wxRegion(const wxBitmap
& bmp
,
32 const wxColour
& transColour
= wxNullColour
,
36 Union(bmp
, transColour
, tolerance
);
39 wxRegion(const wxRegion
& r
)
42 wxRegion
& operator= (const wxRegion
& r
)
43 { return *(wxRegion
*)&(this->wxRegionGeneric::operator=(r
)); }
45 // Use the non-transparent pixels of a wxBitmap for the region to combine
46 // with this region. If the bitmap has a mask then it will be used,
47 // otherwise the colour to be treated as transparent may be specified,
48 // along with an optional tolerance value.
49 // NOTE: implemented in common/rgncmn.cpp
50 bool Union(const wxBitmap
& bmp
,
51 const wxColour
& transColour
= wxNullColour
,
53 /* And because of function hiding: */
54 bool Union(long x
, long y
, long width
, long height
)
55 { return wxRegionGeneric::Union(x
,y
,width
,height
); }
56 bool Union(const wxRect
& rect
)
57 { return wxRegionGeneric::Union(rect
); }
58 bool Union(const wxRegion
& region
)
59 { return wxRegionGeneric::Union(region
); }
61 // Convert the region to a B&W bitmap with the black pixels being inside
63 // NOTE: implemented in common/rgncmn.cpp
64 wxBitmap
ConvertToBitmap() const;
68 class WXDLLEXPORT wxRegionIterator
: public wxRegionIteratorGeneric
70 // DECLARE_DYNAMIC_CLASS(wxRegionIteratorGeneric);
73 wxRegionIterator(const wxRegion
& region
)
74 : wxRegionIteratorGeneric(region
)
76 wxRegionIterator(const wxRegionIterator
& iterator
)
77 : wxRegionIteratorGeneric(iterator
)
79 ~wxRegionIterator() {}
81 wxRegionIterator
& operator=(const wxRegionIterator
& iter
)
82 { return *(wxRegionIterator
*)&(this->wxRegionIteratorGeneric::operator=(iter
)); }
85 #endif //ndef _WX_COCOA_REGION_H__