]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/region.h
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
18 #include "wx/gdiobj.h"
19 #include "wx/gdicmn.h"
21 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
27 //-----------------------------------------------------------------------------
29 //-----------------------------------------------------------------------------
33 wxOutRegion
= 0, wxPartRegion
= 1, wxInRegion
= 2
36 // So far, for internal use only
38 wxRGN_AND
, // Creates the intersection of the two combined regions.
39 wxRGN_COPY
, // Creates a copy of the region identified by hrgnSrc1.
40 wxRGN_DIFF
, // Combines the parts of hrgnSrc1 that are not part of hrgnSrc2.
41 wxRGN_OR
, // Creates the union of two combined regions.
42 wxRGN_XOR
// Creates the union of two combined regions except for any overlapping areas.
45 //-----------------------------------------------------------------------------
47 //-----------------------------------------------------------------------------
49 class wxRegion
: public wxGDIObject
51 DECLARE_DYNAMIC_CLASS(wxRegion
);
55 wxRegion( long x
, long y
, long w
, long h
);
56 wxRegion( const wxPoint
& topLeft
, const wxPoint
& bottomRight
);
57 wxRegion( const wxRect
& rect
);
61 inline wxRegion( const wxRegion
& r
)
63 inline wxRegion
& operator = ( const wxRegion
& r
)
64 { Ref(r
); return (*this); }
68 bool Union( long x
, long y
, long width
, long height
);
69 bool Union( const wxRect
& rect
);
70 bool Union( const wxRegion
& region
);
72 bool Intersect( long x
, long y
, long width
, long height
);
73 bool Intersect( const wxRect
& rect
);
74 bool Intersect( const wxRegion
& region
);
76 bool Subtract( long x
, long y
, long width
, long height
);
77 bool Subtract( const wxRect
& rect
);
78 bool Subtract( const wxRegion
& region
);
80 bool Xor( long x
, long y
, long width
, long height
);
81 bool Xor( const wxRect
& rect
);
82 bool Xor( const wxRegion
& region
);
84 void GetBox( long& x
, long& y
, long&w
, long &h
) const;
85 wxRect
GetBox(void) const ;
87 bool Empty(void) const;
89 wxRegionContain
Contains( long x
, long y
) const;
90 wxRegionContain
Contains( long x
, long y
, long w
, long h
) const;
91 wxRegionContain
Contains(const wxPoint
& pt
) const;
92 wxRegionContain
Contains(const wxRect
& rect
) const;
96 wxList
*GetRectList() const;
97 GdkRegion
*GetRegion(void) const;
100 class wxRegionIterator
: public wxObject
102 DECLARE_DYNAMIC_CLASS(wxRegionIterator
);
106 wxRegionIterator(void);
107 wxRegionIterator(const wxRegion
& region
);
109 void Reset(void) { m_current
= 0; }
110 void Reset(const wxRegion
& region
);
112 operator bool (void) const;
113 bool HaveRects(void) const;
115 void operator ++ (void);
116 void operator ++ (int);
118 long GetX(void) const;
119 long GetY(void) const;
120 long GetW(void) const;
121 long GetWidth(void) const { return GetW(); }
122 long GetH(void) const;
123 long GetHeight(void) const { return GetH(); }