1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/palmos/region.h
3 // Purpose: wxRegion class
4 // Author: Julian Smart
8 // Copyright: (c) 1997-2002 wxWidgets team
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_PALMOS_REGION_H_
13 #define _WX_PALMOS_REGION_H_
15 class WXDLLEXPORT wxRegion
: public wxRegionWithCombine
19 wxRegion(wxCoord x
, wxCoord y
, wxCoord w
, wxCoord h
);
20 wxRegion(const wxPoint
& topLeft
, const wxPoint
& bottomRight
);
21 wxRegion(const wxRect
& rect
);
22 wxRegion(WXHRGN hRegion
); // Hangs on to this region
23 wxRegion(size_t n
, const wxPoint
*points
, int 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
);
39 // wxRegionBase methods
41 virtual bool IsEmpty() const;
43 // Get internal region handle
44 WXHRGN
GetHRGN() const;
47 virtual wxObjectRefData
*CreateRefData() const;
48 virtual wxObjectRefData
*CloneRefData(const wxObjectRefData
*data
) const;
50 virtual bool DoIsEqual(const wxRegion
& region
) const;
51 virtual bool DoGetBox(wxCoord
& x
, wxCoord
& y
, wxCoord
& w
, wxCoord
& h
) const;
52 virtual wxRegionContain
DoContainsPoint(wxCoord x
, wxCoord y
) const;
53 virtual wxRegionContain
DoContainsRect(const wxRect
& rect
) const;
55 virtual bool DoOffset(wxCoord x
, wxCoord y
);
56 virtual bool DoCombine(const wxRegion
& region
, wxRegionOp op
);
58 friend class WXDLLIMPEXP_FWD_CORE wxRegionIterator
;
60 DECLARE_DYNAMIC_CLASS(wxRegion
)
63 class WXDLLEXPORT wxRegionIterator
: public wxObject
66 wxRegionIterator() { Init(); }
67 wxRegionIterator(const wxRegion
& region
);
68 wxRegionIterator(const wxRegionIterator
& ri
) : wxObject(ri
) { Init(); *this = ri
; }
70 wxRegionIterator
& operator=(const wxRegionIterator
& ri
);
72 virtual ~wxRegionIterator();
74 void Reset() { m_current
= 0; }
75 void Reset(const wxRegion
& region
);
77 bool HaveRects() const { return (m_current
< m_numRects
); }
79 operator bool () const { return HaveRects(); }
81 wxRegionIterator
& operator++();
82 wxRegionIterator
operator++(int);
87 wxCoord
GetWidth() const { return GetW(); }
89 wxCoord
GetHeight() const { return GetH(); }
91 wxRect
GetRect() const { return wxRect(GetX(), GetY(), GetW(), GetH()); }
94 // common part of all ctors
102 DECLARE_DYNAMIC_CLASS(wxRegionIterator
)
105 #endif // _WX_PALMOS_REGION_H_