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 WXDLLIMPEXP_CORE 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
);
21 wxRegionGeneric(size_t n
, const wxPoint
*points
, wxPolygonFillMode fillStyle
= wxODDEVEN_RULE
);
22 wxRegionGeneric(const wxBitmap
& bmp
);
23 wxRegionGeneric(const wxBitmap
& bmp
, const wxColour
& transp
, int tolerance
= 0);
25 virtual ~wxRegionGeneric();
27 // wxRegionBase pure virtuals
29 virtual bool IsEmpty() const;
32 virtual wxGDIRefData
*CreateGDIRefData() const;
33 virtual wxGDIRefData
*CloneGDIRefData(const wxGDIRefData
*data
) const;
35 // wxRegionBase pure virtuals
36 virtual bool DoIsEqual(const wxRegion
& region
) const;
37 virtual bool DoGetBox(wxCoord
& x
, wxCoord
& y
, wxCoord
& w
, wxCoord
& h
) const;
38 virtual wxRegionContain
DoContainsPoint(wxCoord x
, wxCoord y
) const;
39 virtual wxRegionContain
DoContainsRect(const wxRect
& rect
) const;
41 virtual bool DoOffset(wxCoord x
, wxCoord y
);
42 virtual bool DoUnionWithRect(const wxRect
& rect
);
43 virtual bool DoUnionWithRegion(const wxRegion
& region
);
44 virtual bool DoIntersect(const wxRegion
& region
);
45 virtual bool DoSubtract(const wxRegion
& region
);
46 virtual bool DoXor(const wxRegion
& region
);
48 friend class WXDLLIMPEXP_FWD_CORE wxRegionIteratorGeneric
;
51 class WXDLLIMPEXP_CORE wxRegionIteratorGeneric
: public wxObject
54 wxRegionIteratorGeneric();
55 wxRegionIteratorGeneric(const wxRegionGeneric
& region
);
56 wxRegionIteratorGeneric(const wxRegionIteratorGeneric
& iterator
);
57 virtual ~wxRegionIteratorGeneric();
59 wxRegionIteratorGeneric
& operator=(const wxRegionIteratorGeneric
& iterator
);
61 void Reset() { m_current
= 0; }
62 void Reset(const wxRegionGeneric
& region
);
64 operator bool () const { return HaveRects(); }
65 bool HaveRects() const;
67 wxRegionIteratorGeneric
& operator++();
68 wxRegionIteratorGeneric
operator++(int);
73 long GetWidth() const { return GetW(); }
75 long GetHeight() const { return GetH(); }
76 wxRect
GetRect() const;
79 wxRegionGeneric m_region
;
82 #endif // _WX_GENERIC_REGION_H__