]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/region.h
minor changes a bit everywhere + a small wxLog change (Enable()/IsEnabled()
[wxWidgets.git] / include / wx / gtk / region.h
CommitLineData
c801d85f
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: region.h
3// Purpose:
4// Author: Robert Roebling
5// Created: 01/02/97
6// Id:
7// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
11#ifndef __REGIONH__
12#define __REGIONH__
13
14#ifdef __GNUG__
15#pragma interface
16#endif
17
18#include "wx/list.h"
19#include "wx/gdiobj.h"
20#include "wx/gdicmn.h"
21
22//-----------------------------------------------------------------------------
23// classes
24//-----------------------------------------------------------------------------
25
26class wxRegion;
27
28//-----------------------------------------------------------------------------
29// constants
30//-----------------------------------------------------------------------------
31
32enum wxRegionContain
33{
34 wxOutRegion = 0, wxPartRegion = 1, wxInRegion = 2
35};
36
37// So far, for internal use only
38enum wxRegionOp {
39wxRGN_AND, // Creates the intersection of the two combined regions.
40wxRGN_COPY, // Creates a copy of the region identified by hrgnSrc1.
41wxRGN_DIFF, // Combines the parts of hrgnSrc1 that are not part of hrgnSrc2.
42wxRGN_OR, // Creates the union of two combined regions.
43wxRGN_XOR // Creates the union of two combined regions except for any overlapping areas.
44};
45
46//-----------------------------------------------------------------------------
47// wxRegion
48//-----------------------------------------------------------------------------
49
50class wxRegion : public wxGDIObject
51{
52 DECLARE_DYNAMIC_CLASS(wxRegion);
53
54 public:
55
56 wxRegion( long x, long y, long w, long h );
57 wxRegion( const wxPoint& topLeft, const wxPoint& bottomRight );
58 wxRegion( const wxRect& rect );
59 wxRegion(void);
60 ~wxRegion(void);
61
62 inline wxRegion( const wxRegion& r )
63 { Ref(r); }
64 inline wxRegion& operator = ( const wxRegion& r )
65 { Ref(r); return (*this); }
66
67 void Clear(void);
68
69 bool Union( long x, long y, long width, long height );
70 bool Union( const wxRect& rect );
71 bool Union( const wxRegion& region );
72
73 bool Intersect( long x, long y, long width, long height );
74 bool Intersect( const wxRect& rect );
75 bool Intersect( const wxRegion& region );
76
77 bool Subtract( long x, long y, long width, long height );
78 bool Subtract( const wxRect& rect );
79 bool Subtract( const wxRegion& region );
80
81 bool Xor( long x, long y, long width, long height );
82 bool Xor( const wxRect& rect );
83 bool Xor( const wxRegion& region );
84
85 void GetBox( long& x, long& y, long&w, long &h ) const;
86 wxRect GetBox(void) const ;
87
88 bool Empty(void) const;
89
90 wxRegionContain Contains( long x, long y ) const;
91 wxRegionContain Contains( long x, long y, long w, long h ) const;
8429bec1
RR
92 wxRegionContain Contains(const wxPoint& pt) const;
93 wxRegionContain Contains(const wxRect& rect) const;
c801d85f
KB
94
95 public:
8429bec1
RR
96
97 wxList *GetRectList() const;
c801d85f
KB
98 GdkRegion *GetRegion(void) const;
99};
100
8429bec1
RR
101class wxRegionIterator: public wxObject
102{
103 DECLARE_DYNAMIC_CLASS(wxRegionIterator);
104
105 public:
106
107 wxRegionIterator(void);
108 wxRegionIterator(const wxRegion& region);
109
110 void Reset(void) { m_current = 0; }
111 void Reset(const wxRegion& region);
112
113 operator bool (void) const;
114 bool HaveRects(void) const;
115
116 void operator ++ (void);
117 void operator ++ (int);
118
119 long GetX(void) const;
120 long GetY(void) const;
121 long GetW(void) const;
122 long GetWidth(void) const { return GetW(); }
123 long GetH(void) const;
124 long GetHeight(void) const { return GetH(); }
125
126 private:
127
128 long m_current;
129 wxRegion m_region;
130};
131
132
c801d85f
KB
133#endif
134 // __REGIONH__