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 /////////////////////////////////////////////////////////////////////////////
17 //---------------------------------------------------------------------------
20 WXSHAPE_IMP_CALLBACKS(wxPyEllipseShape, wxEllipseShape);
23 class wxPyEllipseShape : public wxPyShape {
25 %addtofunc wxPyEllipseShape "self._setOORandCallbackInfo(PyEllipseShape)"
27 wxPyEllipseShape(double width = 0.0, double height = 0.0);
29 void _setCallbackInfo(PyObject* self, PyObject* _class);
31 void base_OnDraw(wxDC& dc);
32 void base_OnDrawContents(wxDC& dc);
33 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
34 void base_OnMoveLinks(wxDC& dc);
35 void base_OnErase(wxDC& dc);
36 void base_OnEraseContents(wxDC& dc);
37 void base_OnHighlight(wxDC& dc);
38 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
39 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
40 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
41 void base_OnSize(double x, double y);
42 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
43 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
44 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
45 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
46 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
47 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
48 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
49 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
50 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
51 void base_OnDrawControlPoints(wxDC& dc);
52 void base_OnEraseControlPoints(wxDC& dc);
53 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True);
54 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
55 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
56 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
57 void base_OnBeginSize(double w, double h);
58 void base_OnEndSize(double w, double h);
59 // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
62 //---------------------------------------------------------------------------
64 WXSHAPE_IMP_CALLBACKS(wxPyCircleShape, wxCircleShape);
67 class wxPyCircleShape : public wxPyEllipseShape {
69 %addtofunc wxPyCircleShape "self._setOORandCallbackInfo(PyCircleShape)"
71 wxPyCircleShape(double width = 0.0);
73 void _setCallbackInfo(PyObject* self, PyObject* _class);
75 void base_OnDraw(wxDC& dc);
76 void base_OnDrawContents(wxDC& dc);
77 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
78 void base_OnMoveLinks(wxDC& dc);
79 void base_OnErase(wxDC& dc);
80 void base_OnEraseContents(wxDC& dc);
81 void base_OnHighlight(wxDC& dc);
82 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
83 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
84 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
85 void base_OnSize(double x, double y);
86 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
87 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
88 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
89 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
90 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
91 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
92 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
93 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
94 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
95 void base_OnDrawControlPoints(wxDC& dc);
96 void base_OnEraseControlPoints(wxDC& dc);
97 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True);
98 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
99 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
100 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
101 void base_OnBeginSize(double w, double h);
102 void base_OnEndSize(double w, double h);
103 // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
106 //---------------------------------------------------------------------------
107 //---------------------------------------------------------------------------
109 class wxArrowHead : public wxObject {
111 wxArrowHead(int type = 0,
115 const wxString& name = wxPyEmptyString,
116 wxPseudoMetaFile *mf = NULL,
122 void SetPosition(int pos);
128 void SetXOffset(double x);
129 void SetYOffset(double y);
130 wxPseudoMetaFile *GetMetaFile();
133 double GetArrowSize();
134 void SetSize(double size);
135 void SetSpacing(double sp);
137 //---------------------------------------------------------------------------
139 WXSHAPE_IMP_CALLBACKS(wxPyLineShape, wxLineShape);
142 class wxPyLineShape : public wxPyShape {
144 %addtofunc wxPyLineShape "self._setOORandCallbackInfo(PyLineShape)"
148 void _setCallbackInfo(PyObject* self, PyObject* _class);
150 void AddArrow(int type, int end = ARROW_POSITION_END,
151 double arrowSize = 10.0, double xOffset = 0.0,
152 const wxString& name = wxPyEmptyString, wxPseudoMetaFile *mf = NULL,
155 //void AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int end);
157 void AddArrowOrdered(wxArrowHead *arrow, PyObject* referenceList, int end) {
158 wxList* list = wxPy_wxListHelper(referenceList, wxT("wxArrowHead"));
159 self->AddArrowOrdered(arrow, *list, end);
163 bool ClearArrow(const wxString& name);
164 void ClearArrowsAtPosition(int position = -1);
165 void DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool proportionalOffset);
166 %name(DeleteArrowHeadId)bool DeleteArrowHead(long arrowId);
167 bool DeleteArrowHead(int position, const wxString& name);
168 bool DeleteLineControlPoint();
169 void DrawArrows(wxDC& dc);
170 void DrawRegion(wxDC& dc, wxShapeRegion *region, double x, double y);
171 void EraseRegion(wxDC& dc, wxShapeRegion *region, double x, double y);
172 %name(FindArrowHeadId)wxArrowHead * FindArrowHead(long arrowId);
173 wxArrowHead * FindArrowHead(int position, const wxString& name);
174 void FindLineEndPoints(double *OUTPUT, double *OUTPUT,
175 double *OUTPUT, double *OUTPUT);
176 int FindLinePosition(double x, double y);
177 double FindMinimumWidth();
178 void FindNth(wxPyShape *image, int *OUTPUT, int *OUTPUT, bool incoming);
179 int GetAttachmentFrom();
180 int GetAttachmentTo();
181 void GetEnds(double *OUTPUT, double *OUTPUT, double *OUTPUT, double *OUTPUT);
182 wxPyShape * GetFrom();
183 void GetLabelPosition(int position, double *OUTPUT, double *OUTPUT);
184 wxRealPoint * GetNextControlPoint(wxPyShape *shape);
187 void InsertLineControlPoint(wxDC* dc);
188 bool IsEnd(wxPyShape *shape);
190 void MakeLineControlPoints(int n);
192 // inline wxList *GetLineControlPoints() { return m_lineControlPoints; }
194 PyObject* GetLineControlPoints() {
195 wxList* list = self->GetLineControlPoints();
196 return wxPy_ConvertShapeList(list);
200 void SetAttachmentFrom(int fromAttach);
201 void SetAttachments(int fromAttach, int toAttach);
202 void SetAttachmentTo(int toAttach);
203 void SetEnds(double x1, double y1, double x2, double y2);
204 void SetFrom(wxPyShape *object);
205 void SetIgnoreOffsets(bool ignore);
206 void SetSpline(bool spline);
207 void SetTo(wxPyShape *object);
208 void Straighten(wxDC* dc = NULL);
212 void base_OnDraw(wxDC& dc);
213 void base_OnDrawContents(wxDC& dc);
214 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
215 void base_OnMoveLinks(wxDC& dc);
216 void base_OnErase(wxDC& dc);
217 void base_OnEraseContents(wxDC& dc);
218 void base_OnHighlight(wxDC& dc);
219 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
220 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
221 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
222 void base_OnSize(double x, double y);
223 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
224 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
225 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
226 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
227 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
228 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
229 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
230 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
231 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
232 void base_OnDrawControlPoints(wxDC& dc);
233 void base_OnEraseControlPoints(wxDC& dc);
234 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True);
235 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
236 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
237 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
238 void base_OnBeginSize(double w, double h);
239 void base_OnEndSize(double w, double h);
240 // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
243 //---------------------------------------------------------------------------
245 WXSHAPE_IMP_CALLBACKS(wxPyPolygonShape, wxPolygonShape);
248 class wxPyPolygonShape : public wxPyShape {
250 %addtofunc wxPyPolygonShape "self._setOORandCallbackInfo(PyPolygonShape)"
254 void _setCallbackInfo(PyObject* self, PyObject* _class);
257 // void Create(wxList* points);
259 PyObject* Create(PyObject* points) {
260 wxList* list = wxPy_wxRealPoint_ListHelper(points);
270 void AddPolygonPoint(int pos = 0);
271 void CalculatePolygonCentre();
272 void DeletePolygonPoint(int pos = 0);
274 // wxList* GetPoints();
276 PyObject* GetPoints() {
277 wxList* list = self->GetPoints();
281 wxNode* node = list->GetFirst();
283 wxPyBeginBlockThreads();
284 pyList = PyList_New(0);
286 wxObj = node->GetData();
287 pyObj = wxPyConstructObject(wxObj, wxT("wxRealPoint"), 0);
288 PyList_Append(pyList, pyObj);
289 node = node->GetNext();
291 wxPyEndBlockThreads();
296 void UpdateOriginalPoints();
298 void base_OnDraw(wxDC& dc);
299 void base_OnDrawContents(wxDC& dc);
300 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
301 void base_OnMoveLinks(wxDC& dc);
302 void base_OnErase(wxDC& dc);
303 void base_OnEraseContents(wxDC& dc);
304 void base_OnHighlight(wxDC& dc);
305 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
306 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
307 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
308 void base_OnSize(double x, double y);
309 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
310 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
311 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
312 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
313 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
314 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
315 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
316 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
317 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
318 void base_OnDrawControlPoints(wxDC& dc);
319 void base_OnEraseControlPoints(wxDC& dc);
320 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True);
321 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
322 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
323 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
324 void base_OnBeginSize(double w, double h);
325 void base_OnEndSize(double w, double h);
326 // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
328 //---------------------------------------------------------------------------
330 WXSHAPE_IMP_CALLBACKS(wxPyTextShape, wxTextShape);
333 class wxPyTextShape : public wxPyRectangleShape {
335 %addtofunc wxPyTextShape "self._setOORandCallbackInfo(PyTextShape)"
337 wxPyTextShape(double width = 0.0, double height = 0.0);
339 void _setCallbackInfo(PyObject* self, PyObject* _class);
341 void base_OnDelete();
342 void base_OnDraw(wxDC& dc);
343 void base_OnDrawContents(wxDC& dc);
344 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
345 void base_OnMoveLinks(wxDC& dc);
346 void base_OnErase(wxDC& dc);
347 void base_OnEraseContents(wxDC& dc);
348 void base_OnHighlight(wxDC& dc);
349 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
350 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
351 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
352 void base_OnSize(double x, double y);
353 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
354 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
355 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
356 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
357 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
358 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
359 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
360 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
361 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
362 void base_OnDrawControlPoints(wxDC& dc);
363 void base_OnEraseControlPoints(wxDC& dc);
364 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True);
365 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
366 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
367 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
368 void base_OnBeginSize(double w, double h);
369 void base_OnEndSize(double w, double h);
370 // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
373 //---------------------------------------------------------------------------