]> git.saurik.com Git - wxWidgets.git/blob - include/wx/cocoa/region.h
Compilation fixes
[wxWidgets.git] / include / wx / cocoa / region.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/region.h
3 // Purpose: wxRegion class
4 // Author: David Elliott
5 // Modified by:
6 // Created: 2004/04/12
7 // RCS-ID: $Id$
8 // Copyright: (c) 2004 David Elliott
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_COCOA_REGION_H__
13 #define _WX_COCOA_REGION_H__
14
15 #include "wx/generic/region.h"
16
17 class WXDLLEXPORT wxRegion : public wxRegionGeneric
18 {
19 DECLARE_DYNAMIC_CLASS(wxRegion);
20 public:
21 wxRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h)
22 : wxRegionGeneric(x,y,w,h)
23 {}
24 wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight)
25 : wxRegionGeneric(topLeft, bottomRight)
26 {}
27 wxRegion(const wxRect& rect)
28 : wxRegionGeneric(rect)
29 {}
30 wxRegion() {}
31 wxRegion(const wxBitmap& bmp,
32 const wxColour& transColour = wxNullColour,
33 int tolerance = 0)
34 : wxRegionGeneric()
35 {
36 Union(bmp, transColour, tolerance);
37 }
38 ~wxRegion() {}
39 wxRegion(const wxRegion& r)
40 : wxRegionGeneric(r)
41 {}
42 wxRegion& operator= (const wxRegion& r)
43 { return *(wxRegion*)&(this->wxRegionGeneric::operator=(r)); }
44
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,
52 int tolerance = 0);
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); }
60
61 // Convert the region to a B&W bitmap with the black pixels being inside
62 // the region.
63 // NOTE: implemented in common/rgncmn.cpp
64 wxBitmap ConvertToBitmap() const;
65
66 };
67
68 class WXDLLEXPORT wxRegionIterator : public wxRegionIteratorGeneric
69 {
70 // DECLARE_DYNAMIC_CLASS(wxRegionIteratorGeneric);
71 public:
72 wxRegionIterator() {}
73 wxRegionIterator(const wxRegion& region)
74 : wxRegionIteratorGeneric(region)
75 {}
76 wxRegionIterator(const wxRegionIterator& iterator)
77 : wxRegionIteratorGeneric(iterator)
78 {}
79 ~wxRegionIterator() {}
80
81 wxRegionIterator& operator=(const wxRegionIterator& iter)
82 { return *(wxRegionIterator*)&(this->wxRegionIteratorGeneric::operator=(iter)); }
83 };
84
85 #endif //ndef _WX_COCOA_REGION_H__