]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/generic/region.h
Use wxGetTranslation() instead of _() in the public headers.
[wxWidgets.git] / include / wx / generic / region.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/generic/region.h
3// Purpose: generic wxRegion class
4// Author: David Elliott
5// Modified by:
6// Created: 2004/04/12
7// Copyright: (c) 2004 David Elliott
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
11#ifndef _WX_GENERIC_REGION_H__
12#define _WX_GENERIC_REGION_H__
13
14class WXDLLIMPEXP_CORE wxRegionGeneric : public wxRegionBase
15{
16public:
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);
23 wxRegionGeneric();
24 virtual ~wxRegionGeneric();
25
26 // wxRegionBase pure virtuals
27 virtual void Clear();
28 virtual bool IsEmpty() const;
29
30protected:
31 virtual wxGDIRefData *CreateGDIRefData() const;
32 virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
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
47 friend class WXDLLIMPEXP_FWD_CORE wxRegionIteratorGeneric;
48};
49
50class WXDLLIMPEXP_CORE wxRegionIteratorGeneric : public wxObject
51{
52public:
53 wxRegionIteratorGeneric();
54 wxRegionIteratorGeneric(const wxRegionGeneric& region);
55 wxRegionIteratorGeneric(const wxRegionIteratorGeneric& iterator);
56 virtual ~wxRegionIteratorGeneric();
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;
76private:
77 long m_current;
78 wxRegionGeneric m_region;
79};
80
81#endif // _WX_GENERIC_REGION_H__