1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/region.h
3 // Purpose: generic wxRegion class
4 // Author: David Elliott
7 // Copyright: (c) 2004 David Elliott
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_GENERIC_REGION_H__
12 #define _WX_GENERIC_REGION_H__
14 class WXDLLIMPEXP_CORE wxRegionGeneric
: public wxRegionBase
17 wxRegionGeneric(wxCoord x
, wxCoord y
, wxCoord w
, wxCoord h
);
18 wxRegionGeneric(const wxPoint
& topLeft
, const wxPoint
& bottomRight
);
19 wxRegionGeneric(const wxRect
& rect
);
20 wxRegionGeneric(size_t n
, const wxPoint
*points
, wxPolygonFillMode fillStyle
= wxODDEVEN_RULE
);
21 wxRegionGeneric(const wxBitmap
& bmp
);
22 wxRegionGeneric(const wxBitmap
& bmp
, const wxColour
& transp
, int tolerance
= 0);
24 virtual ~wxRegionGeneric();
26 // wxRegionBase pure virtuals
28 virtual bool IsEmpty() const;
31 virtual wxGDIRefData
*CreateGDIRefData() const;
32 virtual wxGDIRefData
*CloneGDIRefData(const wxGDIRefData
*data
) const;
34 // wxRegionBase pure virtuals
35 virtual bool DoIsEqual(const wxRegion
& region
) const;
36 virtual bool DoGetBox(wxCoord
& x
, wxCoord
& y
, wxCoord
& w
, wxCoord
& h
) const;
37 virtual wxRegionContain
DoContainsPoint(wxCoord x
, wxCoord y
) const;
38 virtual wxRegionContain
DoContainsRect(const wxRect
& rect
) const;
40 virtual bool DoOffset(wxCoord x
, wxCoord y
);
41 virtual bool DoUnionWithRect(const wxRect
& rect
);
42 virtual bool DoUnionWithRegion(const wxRegion
& region
);
43 virtual bool DoIntersect(const wxRegion
& region
);
44 virtual bool DoSubtract(const wxRegion
& region
);
45 virtual bool DoXor(const wxRegion
& region
);
47 friend class WXDLLIMPEXP_FWD_CORE wxRegionIteratorGeneric
;
50 class WXDLLIMPEXP_CORE wxRegionIteratorGeneric
: public wxObject
53 wxRegionIteratorGeneric();
54 wxRegionIteratorGeneric(const wxRegionGeneric
& region
);
55 wxRegionIteratorGeneric(const wxRegionIteratorGeneric
& iterator
);
56 virtual ~wxRegionIteratorGeneric();
58 wxRegionIteratorGeneric
& operator=(const wxRegionIteratorGeneric
& iterator
);
60 void Reset() { m_current
= 0; }
61 void Reset(const wxRegionGeneric
& region
);
63 operator bool () const { return HaveRects(); }
64 bool HaveRects() const;
66 wxRegionIteratorGeneric
& operator++();
67 wxRegionIteratorGeneric
operator++(int);
72 long GetWidth() const { return GetW(); }
74 long GetHeight() const { return GetH(); }
75 wxRect
GetRect() const;
78 wxRegionGeneric m_region
;
81 #endif // _WX_GENERIC_REGION_H__