]> git.saurik.com Git - wxWidgets.git/blob - wxPython/contrib/ogl/oglshapes2.i
don't define wxUSE_OWNER_DRAWN for wxUniv
[wxWidgets.git] / wxPython / contrib / ogl / oglshapes2.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: oglshapes2.i
3 // Purpose: SWIG definitions for the wxWindows Object Graphics Library
4 //
5 // Author: Robin Dunn
6 //
7 // Created: 3-Sept-1999
8 // RCS-ID: $Id$
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
12
13
14 %module oglshapes2
15
16 %{
17 #include "export.h"
18 #include "oglhelpers.h"
19 %}
20
21 //---------------------------------------------------------------------------
22
23 %include typemaps.i
24 %include my_typemaps.i
25
26 %extern wx.i
27 %import windows.i
28 %extern _defs.i
29 %extern misc.i
30 %extern gdi.i
31
32 %include _ogldefs.i
33
34 %import oglbasic.i
35 %import oglshapes.i
36
37
38 %pragma(python) code = "import wx"
39
40 //---------------------------------------------------------------------------
41 //---------------------------------------------------------------------------
42 %{
43 WXSHAPE_IMP_CALLBACKS(wxPyEllipseShape, wxEllipseShape);
44 %}
45
46 class wxPyEllipseShape : public wxPyShape {
47 public:
48 wxPyEllipseShape(double width = 0.0, double height = 0.0);
49
50 void _setSelf(PyObject* self, PyObject* _class);
51 %pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyEllipseShape)"
52
53 void base_OnDraw(wxDC& dc);
54 void base_OnDrawContents(wxDC& dc);
55 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
56 void base_OnMoveLinks(wxDC& dc);
57 void base_OnErase(wxDC& dc);
58 void base_OnEraseContents(wxDC& dc);
59 void base_OnHighlight(wxDC& dc);
60 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
61 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
62 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
63 void base_OnSize(double x, double y);
64 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
65 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
66 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
67 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
68 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
69 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
70 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
71 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
72 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
73 void base_OnDrawControlPoints(wxDC& dc);
74 void base_OnEraseControlPoints(wxDC& dc);
75 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
76 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
77 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
78 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
79 void base_OnBeginSize(double w, double h);
80 void base_OnEndSize(double w, double h);
81 // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
82 };
83
84 //---------------------------------------------------------------------------
85 %{
86 WXSHAPE_IMP_CALLBACKS(wxPyCircleShape, wxCircleShape);
87 %}
88
89 class wxPyCircleShape : public wxPyEllipseShape {
90 public:
91 wxPyCircleShape(double width = 0.0);
92
93 void _setSelf(PyObject* self, PyObject* _class);
94 %pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyCircleShape)"
95
96 void base_OnDraw(wxDC& dc);
97 void base_OnDrawContents(wxDC& dc);
98 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
99 void base_OnMoveLinks(wxDC& dc);
100 void base_OnErase(wxDC& dc);
101 void base_OnEraseContents(wxDC& dc);
102 void base_OnHighlight(wxDC& dc);
103 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
104 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
105 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
106 void base_OnSize(double x, double y);
107 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
108 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
109 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
110 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
111 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
112 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
113 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
114 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
115 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
116 void base_OnDrawControlPoints(wxDC& dc);
117 void base_OnEraseControlPoints(wxDC& dc);
118 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
119 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
120 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
121 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
122 void base_OnBeginSize(double w, double h);
123 void base_OnEndSize(double w, double h);
124 // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
125 };
126 //---------------------------------------------------------------------------
127 //---------------------------------------------------------------------------
128 class wxArrowHead : public wxObject {
129 public:
130 wxArrowHead(int type = 0,
131 int end = 0,
132 double size = 0.0,
133 double dist = 0.0,
134 const char * name = "",
135 wxPseudoMetaFile *mf = NULL,
136 long arrowId = -1);
137 ~wxArrowHead();
138
139 int _GetType();
140 int GetPosition();
141 void SetPosition(int pos);
142 double GetXOffset();
143 double GetYOffset();
144 double GetSpacing();
145 double GetSize();
146 wxString GetName();
147 void SetXOffset(double x);
148 void SetYOffset(double y);
149 wxPseudoMetaFile *GetMetaFile();
150 long GetId();
151 int GetArrowEnd();
152 double GetArrowSize();
153 void SetSize(double size);
154 void SetSpacing(double sp);
155 };
156 //---------------------------------------------------------------------------
157 %{
158 WXSHAPE_IMP_CALLBACKS(wxPyLineShape, wxLineShape);
159 %}
160
161 class wxPyLineShape : public wxPyShape {
162 public:
163 wxPyLineShape();
164
165 void _setSelf(PyObject* self, PyObject* _class);
166 %pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyLineShape)"
167
168 void AddArrow(int type, int end = ARROW_POSITION_END,
169 double arrowSize = 10.0, double xOffset = 0.0,
170 char* name = "", wxPseudoMetaFile *mf = NULL,
171 long arrowId = -1);
172
173 //void AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int end);
174 %addmethods {
175 void AddArrowOrdered(wxArrowHead *arrow, PyObject* referenceList, int end) {
176 wxList* list = wxPy_wxListHelper(referenceList, "_wxArrowHead_p");
177 self->AddArrowOrdered(arrow, *list, end);
178 delete list;
179 }
180 }
181 bool ClearArrow(const wxString& name);
182 void ClearArrowsAtPosition(int position = -1);
183 void DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool proportionalOffset);
184 %name(DeleteArrowHeadId)bool DeleteArrowHead(long arrowId);
185 bool DeleteArrowHead(int position, const wxString& name);
186 bool DeleteLineControlPoint();
187 void DrawArrows(wxDC& dc);
188 void DrawRegion(wxDC& dc, wxShapeRegion *region, double x, double y);
189 void EraseRegion(wxDC& dc, wxShapeRegion *region, double x, double y);
190 %name(FindArrowHeadId)wxArrowHead * FindArrowHead(long arrowId);
191 wxArrowHead * FindArrowHead(int position, const wxString& name);
192 void FindLineEndPoints(double *OUTPUT, double *OUTPUT,
193 double *OUTPUT, double *OUTPUT);
194 int FindLinePosition(double x, double y);
195 double FindMinimumWidth();
196 void FindNth(wxPyShape *image, int *OUTPUT, int *OUTPUT, bool incoming);
197 int GetAttachmentFrom();
198 int GetAttachmentTo();
199 void GetEnds(double *OUTPUT, double *OUTPUT, double *OUTPUT, double *OUTPUT);
200 wxPyShape * GetFrom();
201 void GetLabelPosition(int position, double *OUTPUT, double *OUTPUT);
202 wxPoint * GetNextControlPoint(wxPyShape *shape);
203 wxPyShape * GetTo();
204 void Initialise();
205 void InsertLineControlPoint(wxDC* dc);
206 bool IsEnd(wxPyShape *shape);
207 bool IsSpline();
208 void MakeLineControlPoints(int n);
209
210 // inline wxList *GetLineControlPoints() { return m_lineControlPoints; }
211 %addmethods {
212 PyObject* GetLineControlPoints() {
213 wxList* list = self->GetLineControlPoints();
214 return wxPy_ConvertList(list, "wxPyControlPoint");
215 }
216 }
217
218 void SetAttachmentFrom(int fromAttach);
219 void SetAttachments(int fromAttach, int toAttach);
220 void SetAttachmentTo(int toAttach);
221 void SetEnds(double x1, double y1, double x2, double y2);
222 void SetFrom(wxPyShape *object);
223 void SetIgnoreOffsets(bool ignore);
224 void SetSpline(bool spline);
225 void SetTo(wxPyShape *object);
226 void Straighten(wxDC* dc = NULL);
227 void Unlink();
228
229
230 void base_OnDraw(wxDC& dc);
231 void base_OnDrawContents(wxDC& dc);
232 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
233 void base_OnMoveLinks(wxDC& dc);
234 void base_OnErase(wxDC& dc);
235 void base_OnEraseContents(wxDC& dc);
236 void base_OnHighlight(wxDC& dc);
237 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
238 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
239 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
240 void base_OnSize(double x, double y);
241 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
242 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
243 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
244 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
245 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
246 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
247 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
248 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
249 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
250 void base_OnDrawControlPoints(wxDC& dc);
251 void base_OnEraseControlPoints(wxDC& dc);
252 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
253 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
254 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
255 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
256 void base_OnBeginSize(double w, double h);
257 void base_OnEndSize(double w, double h);
258 // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
259 };
260
261 //---------------------------------------------------------------------------
262 %{
263 WXSHAPE_IMP_CALLBACKS(wxPyPolygonShape, wxPolygonShape);
264 %}
265
266 class wxPyPolygonShape : public wxPyShape {
267 public:
268 wxPyPolygonShape();
269
270 void _setSelf(PyObject* self, PyObject* _class);
271 %pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyPolygonShape)"
272
273
274 // void Create(wxList* points);
275 %addmethods {
276 PyObject* Create(PyObject* points) {
277 wxList* list = wxPy_wxRealPoint_ListHelper(points);
278 if (list) {
279 self->Create(list);
280 Py_INCREF(Py_None);
281 return Py_None;
282 }
283 else return NULL;
284 }
285 }
286
287 void AddPolygonPoint(int pos = 0);
288 void CalculatePolygonCentre();
289 void DeletePolygonPoint(int pos = 0);
290
291 // wxList* GetPoints();
292 %addmethods {
293 PyObject* GetPoints() {
294 wxList* list = self->GetPoints();
295 return wxPy_ConvertList(list, "wxRealPoint");
296 }
297 }
298
299 void UpdateOriginalPoints();
300
301
302 void base_OnDraw(wxDC& dc);
303 void base_OnDrawContents(wxDC& dc);
304 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
305 void base_OnMoveLinks(wxDC& dc);
306 void base_OnErase(wxDC& dc);
307 void base_OnEraseContents(wxDC& dc);
308 void base_OnHighlight(wxDC& dc);
309 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
310 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
311 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
312 void base_OnSize(double x, double y);
313 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
314 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
315 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
316 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
317 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
318 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
319 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
320 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
321 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
322 void base_OnDrawControlPoints(wxDC& dc);
323 void base_OnEraseControlPoints(wxDC& dc);
324 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
325 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
326 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
327 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
328 void base_OnBeginSize(double w, double h);
329 void base_OnEndSize(double w, double h);
330 // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
331 };
332 //---------------------------------------------------------------------------
333 %{
334 WXSHAPE_IMP_CALLBACKS(wxPyTextShape, wxTextShape);
335 %}
336
337 class wxPyTextShape : public wxPyRectangleShape {
338 public:
339 wxPyTextShape(double width = 0.0, double height = 0.0);
340
341 void _setSelf(PyObject* self, PyObject* _class);
342 %pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyTextShape)"
343
344
345 void base_OnDelete();
346 void base_OnDraw(wxDC& dc);
347 void base_OnDrawContents(wxDC& dc);
348 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
349 void base_OnMoveLinks(wxDC& dc);
350 void base_OnErase(wxDC& dc);
351 void base_OnEraseContents(wxDC& dc);
352 void base_OnHighlight(wxDC& dc);
353 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
354 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
355 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
356 void base_OnSize(double x, double y);
357 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
358 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
359 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
360 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
361 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
362 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
363 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
364 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
365 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
366 void base_OnDrawControlPoints(wxDC& dc);
367 void base_OnEraseControlPoints(wxDC& dc);
368 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
369 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
370 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
371 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
372 void base_OnBeginSize(double w, double h);
373 void base_OnEndSize(double w, double h);
374 // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
375
376 };
377 //---------------------------------------------------------------------------