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