]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/_region.i
pi --> math.pi
[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);
49 %name(RegionFromBitmap)wxRegion(const wxBitmap& bmp,
50 const wxColour& transColour = wxNullColour,
51 int tolerance = 0);
52#ifndef __WXMAC__
53 %name(RegionFromPoints)wxRegion(int points, wxPoint* points_array,
54 int fillStyle = wxWINDING_RULE);
55#else
56 %extend {
57 %name(RegionFromPoints)wxRegion(int points, wxPoint* points_array,
58 int fillStyle = wxWINDING_RULE) {
81cfe5e1 59 wxPyRaiseNotImplemented();
d14a1e28
RD
60 return NULL;
61 }
62 }
63#endif
64
65 ~wxRegion();
66
67
68 void Clear();
69#ifndef __WXMAC__
70 bool Offset(wxCoord x, wxCoord y);
71#endif
72
73 wxRegionContain Contains(wxCoord x, wxCoord y);
74 %name(ContainsPoint)wxRegionContain Contains(const wxPoint& pt);
75 %name(ContainsRect)wxRegionContain Contains(const wxRect& rect);
76 %name(ContainsRectDim)wxRegionContain Contains(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
77
78 wxRect GetBox();
79
80 bool Intersect(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
81 %name(IntersectRect)bool Intersect(const wxRect& rect);
82 %name(IntersectRegion)bool Intersect(const wxRegion& region);
83
84 bool IsEmpty();
85
86 bool Union(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
87 %name(UnionRect)bool Union(const wxRect& rect);
88 %name(UnionRegion)bool Union(const wxRegion& region);
89
90 bool Subtract(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
91 %name(SubtractRect)bool Subtract(const wxRect& rect);
92 %name(SubtractRegion)bool Subtract(const wxRegion& region);
93
94 bool Xor(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
95 %name(XorRect)bool Xor(const wxRect& rect);
96 %name(XorRegion)bool Xor(const wxRegion& region);
97
98 // Convert the region to a B&W bitmap with the white pixels being inside
99 // the region.
100 wxBitmap ConvertToBitmap();
101
102 // Use the non-transparent pixels of a wxBitmap for the region to combine
103 // with this region. If the bitmap has a mask then it will be used,
104 // otherwise the colour to be treated as transparent may be specified,
105 // along with an optional tolerance value.
106 %name(UnionBitmap)bool Union(const wxBitmap& bmp,
107 const wxColour& transColour = wxNullColour,
108 int tolerance = 0);
109};
110
111
112
ab1f7d2a
RD
113MustHaveApp(wxRegionIterator);
114
d14a1e28
RD
115class wxRegionIterator : public wxObject {
116public:
117 wxRegionIterator(const wxRegion& region);
118 ~wxRegionIterator();
119
120 wxCoord GetX();
121 wxCoord GetY();
122 wxCoord GetW();
123 wxCoord GetWidth();
124 wxCoord GetH();
125 wxCoord GetHeight();
126 wxRect GetRect();
127 bool HaveRects();
128 void Reset();
129
130 %extend {
131 void Next() {
132 (*self) ++;
133 }
134
135 bool __nonzero__() {
136 return self->operator bool();
137 }
138 };
139};
140
141
142
143//---------------------------------------------------------------------------
144//---------------------------------------------------------------------------