1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/region.h
3 // Purpose: generic wxRegion class
4 // Author: David Elliott
8 // Copyright: (c) 2004 David Elliott
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_GENERIC_REGION_H__
13 #define _WX_GENERIC_REGION_H__
15 class WXDLLEXPORT wxRegionGeneric
: public wxRegionBase
18 wxRegionGeneric(wxCoord x
, wxCoord y
, wxCoord w
, wxCoord h
);
19 wxRegionGeneric(const wxPoint
& topLeft
, const wxPoint
& bottomRight
);
20 wxRegionGeneric(const wxRect
& rect
);
22 virtual ~wxRegionGeneric();
24 // wxRegionBase pure virtuals
26 virtual bool IsEmpty() const;
29 virtual wxObjectRefData
*CreateRefData() const;
30 virtual wxObjectRefData
*CloneRefData(const wxObjectRefData
*data
) const;
32 // wxRegionBase pure virtuals
33 virtual bool DoIsEqual(const wxRegion
& region
) const;
34 virtual bool DoGetBox(wxCoord
& x
, wxCoord
& y
, wxCoord
& w
, wxCoord
& h
) const;
35 virtual wxRegionContain
DoContainsPoint(wxCoord x
, wxCoord y
) const;
36 virtual wxRegionContain
DoContainsRect(const wxRect
& rect
) const;
38 virtual bool DoOffset(wxCoord x
, wxCoord y
);
39 virtual bool DoUnionWithRect(const wxRect
& rect
);
40 virtual bool DoUnionWithRegion(const wxRegion
& region
);
41 virtual bool DoIntersect(const wxRegion
& region
);
42 virtual bool DoSubtract(const wxRegion
& region
);
43 virtual bool DoXor(const wxRegion
& region
);
45 friend class WXDLLIMPEXP_FWD_CORE wxRegionIteratorGeneric
;
48 class WXDLLEXPORT wxRegionIteratorGeneric
: public wxObject
51 wxRegionIteratorGeneric();
52 wxRegionIteratorGeneric(const wxRegionGeneric
& region
);
53 wxRegionIteratorGeneric(const wxRegionIteratorGeneric
& iterator
);
54 virtual ~wxRegionIteratorGeneric();
56 wxRegionIteratorGeneric
& operator=(const wxRegionIteratorGeneric
& iterator
);
58 void Reset() { m_current
= 0; }
59 void Reset(const wxRegionGeneric
& region
);
61 operator bool () const { return HaveRects(); }
62 bool HaveRects() const;
64 wxRegionIteratorGeneric
& operator++();
65 wxRegionIteratorGeneric
operator++(int);
70 long GetWidth() const { return GetW(); }
72 long GetHeight() const { return GetH(); }
73 wxRect
GetRect() const;
76 wxRegionGeneric m_region
;
79 #endif // _WX_GENERIC_REGION_H__