1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG definitions for the wxWindows Object Graphics Library
7 // Created: 3-Sept-1999
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
18 #include "oglhelpers.h"
21 //---------------------------------------------------------------------------
24 %include my_typemaps.i
38 %pragma(python) code = "import wx"
40 //---------------------------------------------------------------------------
41 //---------------------------------------------------------------------------
43 WXSHAPE_IMP_CALLBACKS(wxPyEllipseShape, wxEllipseShape);
46 class wxPyEllipseShape : public wxPyShape {
48 wxPyEllipseShape(double width = 0.0, double height = 0.0);
50 void _setCallbackInfo(PyObject* self, PyObject* _class);
51 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyEllipseShape)"
52 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
54 void base_OnDraw(wxDC& dc);
55 void base_OnDrawContents(wxDC& dc);
56 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
57 void base_OnMoveLinks(wxDC& dc);
58 void base_OnErase(wxDC& dc);
59 void base_OnEraseContents(wxDC& dc);
60 void base_OnHighlight(wxDC& dc);
61 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
62 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
63 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
64 void base_OnSize(double x, double y);
65 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
66 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
67 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
68 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
69 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
70 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
71 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
72 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
73 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
74 void base_OnDrawControlPoints(wxDC& dc);
75 void base_OnEraseControlPoints(wxDC& dc);
76 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
77 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
78 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
79 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
80 void base_OnBeginSize(double w, double h);
81 void base_OnEndSize(double w, double h);
82 // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
85 //---------------------------------------------------------------------------
87 WXSHAPE_IMP_CALLBACKS(wxPyCircleShape, wxCircleShape);
90 class wxPyCircleShape : public wxPyEllipseShape {
92 wxPyCircleShape(double width = 0.0);
94 void _setCallbackInfo(PyObject* self, PyObject* _class);
95 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyCircleShape)"
96 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
98 void base_OnDraw(wxDC& dc);
99 void base_OnDrawContents(wxDC& dc);
100 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
101 void base_OnMoveLinks(wxDC& dc);
102 void base_OnErase(wxDC& dc);
103 void base_OnEraseContents(wxDC& dc);
104 void base_OnHighlight(wxDC& dc);
105 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
106 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
107 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
108 void base_OnSize(double x, double y);
109 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
110 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
111 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
112 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
113 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
114 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
115 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
116 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
117 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
118 void base_OnDrawControlPoints(wxDC& dc);
119 void base_OnEraseControlPoints(wxDC& dc);
120 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
121 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
122 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
123 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
124 void base_OnBeginSize(double w, double h);
125 void base_OnEndSize(double w, double h);
126 // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
128 //---------------------------------------------------------------------------
129 //---------------------------------------------------------------------------
130 class wxArrowHead : public wxObject {
132 wxArrowHead(int type = 0,
136 const char * name = "",
137 wxPseudoMetaFile *mf = NULL,
143 void SetPosition(int pos);
149 void SetXOffset(double x);
150 void SetYOffset(double y);
151 wxPseudoMetaFile *GetMetaFile();
154 double GetArrowSize();
155 void SetSize(double size);
156 void SetSpacing(double sp);
158 //---------------------------------------------------------------------------
160 WXSHAPE_IMP_CALLBACKS(wxPyLineShape, wxLineShape);
163 class wxPyLineShape : public wxPyShape {
167 void _setCallbackInfo(PyObject* self, PyObject* _class);
168 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyLineShape)"
169 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
171 void AddArrow(int type, int end = ARROW_POSITION_END,
172 double arrowSize = 10.0, double xOffset = 0.0,
173 char* name = "", wxPseudoMetaFile *mf = NULL,
176 //void AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int end);
178 void AddArrowOrdered(wxArrowHead *arrow, PyObject* referenceList, int end) {
179 wxList* list = wxPy_wxListHelper(referenceList, "_wxArrowHead_p");
180 self->AddArrowOrdered(arrow, *list, end);
184 bool ClearArrow(const wxString& name);
185 void ClearArrowsAtPosition(int position = -1);
186 void DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool proportionalOffset);
187 %name(DeleteArrowHeadId)bool DeleteArrowHead(long arrowId);
188 bool DeleteArrowHead(int position, const wxString& name);
189 bool DeleteLineControlPoint();
190 void DrawArrows(wxDC& dc);
191 void DrawRegion(wxDC& dc, wxShapeRegion *region, double x, double y);
192 void EraseRegion(wxDC& dc, wxShapeRegion *region, double x, double y);
193 %name(FindArrowHeadId)wxArrowHead * FindArrowHead(long arrowId);
194 wxArrowHead * FindArrowHead(int position, const wxString& name);
195 void FindLineEndPoints(double *OUTPUT, double *OUTPUT,
196 double *OUTPUT, double *OUTPUT);
197 int FindLinePosition(double x, double y);
198 double FindMinimumWidth();
199 void FindNth(wxPyShape *image, int *OUTPUT, int *OUTPUT, bool incoming);
200 int GetAttachmentFrom();
201 int GetAttachmentTo();
202 void GetEnds(double *OUTPUT, double *OUTPUT, double *OUTPUT, double *OUTPUT);
203 wxPyShape * GetFrom();
204 void GetLabelPosition(int position, double *OUTPUT, double *OUTPUT);
205 wxPoint * GetNextControlPoint(wxPyShape *shape);
208 void InsertLineControlPoint(wxDC* dc);
209 bool IsEnd(wxPyShape *shape);
211 void MakeLineControlPoints(int n);
213 // inline wxList *GetLineControlPoints() { return m_lineControlPoints; }
215 PyObject* GetLineControlPoints() {
216 wxList* list = self->GetLineControlPoints();
217 return wxPy_ConvertList(list, "wxPyControlPoint");
221 void SetAttachmentFrom(int fromAttach);
222 void SetAttachments(int fromAttach, int toAttach);
223 void SetAttachmentTo(int toAttach);
224 void SetEnds(double x1, double y1, double x2, double y2);
225 void SetFrom(wxPyShape *object);
226 void SetIgnoreOffsets(bool ignore);
227 void SetSpline(bool spline);
228 void SetTo(wxPyShape *object);
229 void Straighten(wxDC* dc = NULL);
233 void base_OnDraw(wxDC& dc);
234 void base_OnDrawContents(wxDC& dc);
235 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
236 void base_OnMoveLinks(wxDC& dc);
237 void base_OnErase(wxDC& dc);
238 void base_OnEraseContents(wxDC& dc);
239 void base_OnHighlight(wxDC& dc);
240 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
241 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
242 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
243 void base_OnSize(double x, double y);
244 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
245 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
246 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
247 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
248 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
249 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
250 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
251 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
252 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
253 void base_OnDrawControlPoints(wxDC& dc);
254 void base_OnEraseControlPoints(wxDC& dc);
255 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
256 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
257 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
258 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
259 void base_OnBeginSize(double w, double h);
260 void base_OnEndSize(double w, double h);
261 // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
264 //---------------------------------------------------------------------------
266 WXSHAPE_IMP_CALLBACKS(wxPyPolygonShape, wxPolygonShape);
269 class wxPyPolygonShape : public wxPyShape {
273 void _setCallbackInfo(PyObject* self, PyObject* _class);
274 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyPolygonShape)"
275 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
278 // void Create(wxList* points);
280 PyObject* Create(PyObject* points) {
281 wxList* list = wxPy_wxRealPoint_ListHelper(points);
291 void AddPolygonPoint(int pos = 0);
292 void CalculatePolygonCentre();
293 void DeletePolygonPoint(int pos = 0);
295 // wxList* GetPoints();
297 PyObject* GetPoints() {
298 wxList* list = self->GetPoints();
299 return wxPy_ConvertList(list, "wxRealPoint");
303 void UpdateOriginalPoints();
306 void base_OnDraw(wxDC& dc);
307 void base_OnDrawContents(wxDC& dc);
308 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
309 void base_OnMoveLinks(wxDC& dc);
310 void base_OnErase(wxDC& dc);
311 void base_OnEraseContents(wxDC& dc);
312 void base_OnHighlight(wxDC& dc);
313 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
314 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
315 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
316 void base_OnSize(double x, double y);
317 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
318 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
319 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
320 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
321 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
322 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
323 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
324 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
325 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
326 void base_OnDrawControlPoints(wxDC& dc);
327 void base_OnEraseControlPoints(wxDC& dc);
328 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
329 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
330 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
331 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
332 void base_OnBeginSize(double w, double h);
333 void base_OnEndSize(double w, double h);
334 // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
336 //---------------------------------------------------------------------------
338 WXSHAPE_IMP_CALLBACKS(wxPyTextShape, wxTextShape);
341 class wxPyTextShape : public wxPyRectangleShape {
343 wxPyTextShape(double width = 0.0, double height = 0.0);
345 void _setCallbackInfo(PyObject* self, PyObject* _class);
346 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyTextShape)"
347 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
350 void base_OnDelete();
351 void base_OnDraw(wxDC& dc);
352 void base_OnDrawContents(wxDC& dc);
353 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
354 void base_OnMoveLinks(wxDC& dc);
355 void base_OnErase(wxDC& dc);
356 void base_OnEraseContents(wxDC& dc);
357 void base_OnHighlight(wxDC& dc);
358 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
359 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
360 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
361 void base_OnSize(double x, double y);
362 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
363 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
364 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
365 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
366 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
367 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
368 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
369 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
370 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
371 void base_OnDrawControlPoints(wxDC& dc);
372 void base_OnEraseControlPoints(wxDC& dc);
373 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
374 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
375 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
376 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
377 void base_OnBeginSize(double w, double h);
378 void base_OnEndSize(double w, double h);
379 // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
382 //---------------------------------------------------------------------------