]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mgl/region.h
wxAnimationCtrl fix to display inactive bitmap at start (patch 1590192)
[wxWidgets.git] / include / wx / mgl / region.h
CommitLineData
32b8ec41
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: region.h
3// Purpose: wxRegion class
4// Author: Vaclav Slavik
5// Created: 2001/03/12
6// RCS-ID: $Id$
52750c2e 7// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
65571936 8// Licence: wxWindows licence
32b8ec41
VZ
9/////////////////////////////////////////////////////////////////////////////
10
8a16d737
VZ
11#ifndef _WX_MGL_REGION_H_
12#define _WX_MGL_REGION_H_
32b8ec41 13
32b8ec41 14#include "wx/list.h"
32b8ec41 15
32b8ec41
VZ
16class MGLRegion;
17
8a16d737 18class WXDLLEXPORT wxRegion : public wxRegionBase
32b8ec41 19{
32b8ec41 20public:
8a16d737 21 wxRegion();
32b8ec41
VZ
22 wxRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
23 wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight);
24 wxRegion(const wxRect& rect);
25 wxRegion(const MGLRegion& region);
85f6b408
VS
26 wxRegion( const wxBitmap& bmp)
27 {
28 Union(bmp);
29 }
1542ea39 30 wxRegion( const wxBitmap& bmp,
85f6b408 31 const wxColour& transColour, int tolerance = 0)
1542ea39
RD
32 {
33 Union(bmp, transColour, tolerance);
34 }
32b8ec41 35
d3c7fc99 36 virtual ~wxRegion();
32b8ec41 37
8a16d737
VZ
38 // wxRegionBase methods
39 virtual void Clear();
40 virtual bool IsEmpty() const;
1542ea39 41
32b8ec41
VZ
42 // implementation from now on:
43 const MGLRegion& GetMGLRegion() const;
6d7ee9e8
VS
44
45protected:
46 // ref counting code
47 virtual wxObjectRefData *CreateRefData() const;
48 virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
8a16d737
VZ
49
50 // wxRegionBase pure virtuals
51 virtual bool DoIsEqual(const wxRegion& region) const;
52 virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const;
53 virtual wxRegionContain DoContainsPoint(wxCoord x, wxCoord y) const;
54 virtual wxRegionContain DoContainsRect(const wxRect& rect) const;
55
56 virtual bool DoOffset(wxCoord x, wxCoord y);
57 virtual bool DoUnionWithRect(const wxRect& rect);
58 virtual bool DoUnionWithRegion(const wxRegion& region);
59 virtual bool DoIntersect(const wxRegion& region);
60 virtual bool DoSubtract(const wxRegion& region);
61 virtual bool DoXor(const wxRegion& region);
62
63private:
64 DECLARE_DYNAMIC_CLASS(wxRegion);
65 friend class WXDLLEXPORT wxRegionIterator;
32b8ec41
VZ
66};
67
68
69WX_DECLARE_EXPORTED_LIST(wxRect, wxRegionRectList);
70
1542ea39 71class WXDLLEXPORT wxRegionIterator : public wxObject
32b8ec41 72{
32b8ec41
VZ
73public:
74 wxRegionIterator(void);
75 wxRegionIterator(const wxRegion& region);
d3c7fc99 76 virtual ~wxRegionIterator(void);
32b8ec41
VZ
77
78 void Reset(void) { m_currentNode = NULL; }
79 void Reset(const wxRegion& region);
80
32b8ec41 81 operator bool (void) const { return (m_currentNode != NULL); }
32b8ec41
VZ
82
83 bool HaveRects(void) const { return (m_currentNode != NULL); }
84
85 void operator ++ (void);
86 void operator ++ (int);
87
88 wxCoord GetX(void) const;
89 wxCoord GetY(void) const;
90 wxCoord GetW(void) const;
91 wxCoord GetWidth(void) const { return GetW(); }
92 wxCoord GetH(void) const;
93 wxCoord GetHeight(void) const { return GetH(); }
94 wxRect GetRect() const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); }
95
96private:
97 wxRegionRectList m_rects;
98 wxRegionRectList::Node *m_currentNode;
8a16d737
VZ
99
100 DECLARE_DYNAMIC_CLASS(wxRegionIterator);
32b8ec41
VZ
101};
102
8a16d737 103#endif // _WX_MGL_REGION_H_