]>
Commit | Line | Data |
---|---|---|
4c3c3844 DE |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/generic/region.h | |
3 | // Purpose: generic wxRegion class | |
4 | // Author: David Elliott | |
5 | // Modified by: | |
6 | // Created: 2004/04/12 | |
4c3c3844 | 7 | // Copyright: (c) 2004 David Elliott |
ca65c044 | 8 | // Licence: wxWindows licence |
4c3c3844 DE |
9 | ///////////////////////////////////////////////////////////////////////////// |
10 | ||
11 | #ifndef _WX_GENERIC_REGION_H__ | |
12 | #define _WX_GENERIC_REGION_H__ | |
13 | ||
53a2db12 | 14 | class WXDLLIMPEXP_CORE wxRegionGeneric : public wxRegionBase |
4c3c3844 | 15 | { |
4c3c3844 DE |
16 | public: |
17 | wxRegionGeneric(wxCoord x, wxCoord y, wxCoord w, wxCoord h); | |
18 | wxRegionGeneric(const wxPoint& topLeft, const wxPoint& bottomRight); | |
19 | wxRegionGeneric(const wxRect& rect); | |
b916f712 KO |
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); | |
4c3c3844 | 23 | wxRegionGeneric(); |
d3c7fc99 | 24 | virtual ~wxRegionGeneric(); |
4c3c3844 | 25 | |
8a16d737 VZ |
26 | // wxRegionBase pure virtuals |
27 | virtual void Clear(); | |
28 | virtual bool IsEmpty() const; | |
9a6384ca | 29 | |
4c3c3844 | 30 | protected: |
8f884a0d VZ |
31 | virtual wxGDIRefData *CreateGDIRefData() const; |
32 | virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; | |
8a16d737 VZ |
33 | |
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; | |
39 | ||
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); | |
46 | ||
b5dbe15d | 47 | friend class WXDLLIMPEXP_FWD_CORE wxRegionIteratorGeneric; |
4c3c3844 DE |
48 | }; |
49 | ||
53a2db12 | 50 | class WXDLLIMPEXP_CORE wxRegionIteratorGeneric : public wxObject |
4c3c3844 | 51 | { |
4c3c3844 DE |
52 | public: |
53 | wxRegionIteratorGeneric(); | |
54 | wxRegionIteratorGeneric(const wxRegionGeneric& region); | |
55 | wxRegionIteratorGeneric(const wxRegionIteratorGeneric& iterator); | |
d3c7fc99 | 56 | virtual ~wxRegionIteratorGeneric(); |
4c3c3844 DE |
57 | |
58 | wxRegionIteratorGeneric& operator=(const wxRegionIteratorGeneric& iterator); | |
59 | ||
60 | void Reset() { m_current = 0; } | |
61 | void Reset(const wxRegionGeneric& region); | |
62 | ||
63 | operator bool () const { return HaveRects(); } | |
64 | bool HaveRects() const; | |
65 | ||
66 | wxRegionIteratorGeneric& operator++(); | |
67 | wxRegionIteratorGeneric operator++(int); | |
68 | ||
69 | long GetX() const; | |
70 | long GetY() const; | |
71 | long GetW() const; | |
72 | long GetWidth() const { return GetW(); } | |
73 | long GetH() const; | |
74 | long GetHeight() const { return GetH(); } | |
75 | wxRect GetRect() const; | |
76 | private: | |
77 | long m_current; | |
78 | wxRegionGeneric m_region; | |
79 | }; | |
80 | ||
8a16d737 | 81 | #endif // _WX_GENERIC_REGION_H__ |