]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/_region.i
docstrings and other minor tweaks
[wxWidgets.git] / wxPython / src / _region.i
CommitLineData
d14a1e28
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: _imaglist.i
3// Purpose: SWIG interface defs for wxImageList and releated classes
4//
5// Author: Robin Dunn
6//
7// Created: 7-July-1997
8// RCS-ID: $Id$
9// Copyright: (c) 2003 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
13// Not a %module
14
15
16//---------------------------------------------------------------------------
17
18%{
19%}
20
21//---------------------------------------------------------------------------
22
23%typemap(in) (int points, wxPoint* points_array ) {
24 $2 = wxPoint_LIST_helper($input, &$1);
25 if ($2 == NULL) SWIG_fail;
26}
27%typemap(freearg) (int points, wxPoint* points_array ) {
28 if ($2) delete [] $2;
29}
30
31//---------------------------------------------------------------------------
32%newgroup
33
34
35enum wxRegionContain
36{
37 wxOutRegion = 0,
38 wxPartRegion = 1,
39 wxInRegion = 2
40};
41
42
43
ab1f7d2a
RD
44MustHaveApp(wxRegion);
45
d14a1e28
RD
46class wxRegion : public wxGDIObject {
47public:
48 wxRegion(wxCoord x=0, wxCoord y=0, wxCoord width=0, wxCoord height=0);
1b8c7ba6
RD
49 %RenameCtor(RegionFromBitmap, wxRegion(const wxBitmap& bmp));
50 %RenameCtor(RegionFromBitmapColour, wxRegion(const wxBitmap& bmp,
51 const wxColour& transColour,
52 int tolerance = 0));
53 %RenameCtor(RegionFromPoints, wxRegion(int points, wxPoint* points_array,
54 int fillStyle = wxWINDING_RULE));
d14a1e28
RD
55
56 ~wxRegion();
57
58
59 void Clear();
d14a1e28 60 bool Offset(wxCoord x, wxCoord y);
d14a1e28
RD
61
62 wxRegionContain Contains(wxCoord x, wxCoord y);
1b8c7ba6
RD
63 %Rename(ContainsPoint, wxRegionContain, Contains(const wxPoint& pt));
64 %Rename(ContainsRect, wxRegionContain, Contains(const wxRect& rect));
65 %Rename(ContainsRectDim, wxRegionContain, Contains(wxCoord x, wxCoord y, wxCoord w, wxCoord h));
d14a1e28
RD
66
67 wxRect GetBox();
68
69 bool Intersect(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
1b8c7ba6
RD
70 %Rename(IntersectRect, bool, Intersect(const wxRect& rect));
71 %Rename(IntersectRegion, bool, Intersect(const wxRegion& region));
d14a1e28
RD
72
73 bool IsEmpty();
74
75 bool Union(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
1b8c7ba6
RD
76 %Rename(UnionRect, bool, Union(const wxRect& rect));
77 %Rename(UnionRegion, bool, Union(const wxRegion& region));
d14a1e28
RD
78
79 bool Subtract(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
1b8c7ba6
RD
80 %Rename(SubtractRect, bool, Subtract(const wxRect& rect));
81 %Rename(SubtractRegion, bool, Subtract(const wxRegion& region));
d14a1e28
RD
82
83 bool Xor(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
1b8c7ba6
RD
84 %Rename(XorRect, bool, Xor(const wxRect& rect));
85 %Rename(XorRegion, bool, Xor(const wxRegion& region));
d14a1e28
RD
86
87 // Convert the region to a B&W bitmap with the white pixels being inside
88 // the region.
89 wxBitmap ConvertToBitmap();
90
91 // Use the non-transparent pixels of a wxBitmap for the region to combine
92 // with this region. If the bitmap has a mask then it will be used,
93 // otherwise the colour to be treated as transparent may be specified,
94 // along with an optional tolerance value.
1b8c7ba6
RD
95 %Rename(UnionBitmap, bool, Union(const wxBitmap& bmp));
96 %Rename(UnionBitmapColour, bool, Union(const wxBitmap& bmp,
97 const wxColour& transColour,
98 int tolerance = 0));
7012bb9f
RD
99
100
101 %property(Box, GetBox, doc="See `GetBox`");
d14a1e28
RD
102};
103
104
105
ab1f7d2a
RD
106MustHaveApp(wxRegionIterator);
107
d14a1e28
RD
108class wxRegionIterator : public wxObject {
109public:
110 wxRegionIterator(const wxRegion& region);
111 ~wxRegionIterator();
112
113 wxCoord GetX();
114 wxCoord GetY();
115 wxCoord GetW();
116 wxCoord GetWidth();
117 wxCoord GetH();
118 wxCoord GetHeight();
119 wxRect GetRect();
120 bool HaveRects();
121 void Reset();
122
123 %extend {
124 void Next() {
125 (*self) ++;
126 }
127
128 bool __nonzero__() {
129 return self->operator bool();
130 }
131 };
7012bb9f
RD
132
133 %property(H, GetH, doc="See `GetH`");
134 %property(Height, GetHeight, doc="See `GetHeight`");
135 %property(Rect, GetRect, doc="See `GetRect`");
136 %property(W, GetW, doc="See `GetW`");
137 %property(Width, GetWidth, doc="See `GetWidth`");
138 %property(X, GetX, doc="See `GetX`");
139 %property(Y, GetY, doc="See `GetY`");
d14a1e28
RD
140};
141
142
143
144//---------------------------------------------------------------------------
145//---------------------------------------------------------------------------