]> git.saurik.com Git - wxWidgets.git/blame - wxPython/contrib/ogl/_oglshapes.i
New wxDesigner-less version of the MimeTypesManager demo
[wxWidgets.git] / wxPython / contrib / ogl / _oglshapes.i
CommitLineData
e91a9dfc
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: oglshapes.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
d14a1e28 14// not a %module
e91a9dfc 15
e91a9dfc
RD
16
17//---------------------------------------------------------------------------
7b443969
RD
18
19enum {
20 oglMETAFLAGS_OUTLINE,
21 oglMETAFLAGS_ATTACHMENTS
22};
23
e91a9dfc
RD
24//---------------------------------------------------------------------------
25//---------------------------------------------------------------------------
26
9416aa89 27class wxPseudoMetaFile : public wxObject {
e91a9dfc
RD
28public:
29 wxPseudoMetaFile();
30 ~wxPseudoMetaFile();
31
32 void Draw(wxDC& dc, double xoffset, double yoffset);
1e4a197e 33#ifdef wxUSE_PROLOGIO
e91a9dfc
RD
34 void WriteAttributes(wxExpr *clause, int whichAngle);
35 void ReadAttributes(wxExpr *clause, int whichAngle);
1e4a197e 36#endif
e91a9dfc
RD
37 void Clear();
38 void Copy(wxPseudoMetaFile& copy);
39 void Scale(double sx, double sy);
40 void ScaleTo(double w, double h);
41 void Translate(double x, double y);
42 void Rotate(double x, double y, double theta);
1e4a197e 43 bool LoadFromMetaFile(const wxString& filename, double *width, double *height);
e91a9dfc 44 void GetBounds(double *minX, double *minY, double *maxX, double *maxY);
3bd1e033 45 void CalculateSize(wxPyDrawnShape* shape);
e91a9dfc
RD
46
47 // **** fix these... is it even possible? these are lists of various GDI opperations (not the objects...)
48 // wxList& GetOutlineColours();
49 // wxList& GetFillColours();
50 // wxList& GetOps();
51
52 void SetRotateable(bool rot);
53 bool GetRotateable();
54 void SetSize(double w, double h);
55 void SetFillBrush(wxBrush* brush);
56 wxBrush* GetFillBrush();
57 void SetOutlinePen(wxPen* pen);
58 wxPen* GetOutlinePen();
59 void SetOutlineOp(int op);
60 int GetOutlineOp();
61
62
63 bool IsValid();
64 void DrawLine(const wxPoint& pt1, const wxPoint& pt2);
65 void DrawRectangle(const wxRect& rect);
66 void DrawRoundedRectangle(const wxRect& rect, double radius);
67 void DrawArc(const wxPoint& centrePt, const wxPoint& startPt, const wxPoint& endPt);
68 void DrawEllipticArc(const wxRect& rect, double startAngle, double endAngle);
69 void DrawEllipse(const wxRect& rect);
70 void DrawPoint(const wxPoint& pt);
71 void DrawText(const wxString& text, const wxPoint& pt);
eec92d76
RD
72 void DrawLines(int PCOUNT, wxPoint* points);
73 void DrawPolygon(int PCOUNT, wxPoint* points, int flags = 0);
74 void DrawSpline(int PCOUNT, wxPoint* points);
e91a9dfc
RD
75 void SetClippingRect(const wxRect& rect);
76 void DestroyClippingRect();
77 void SetPen(wxPen* pen, bool isOutline = FALSE);
78 void SetBrush(wxBrush* brush, bool isFill = FALSE);
79 void SetFont(wxFont* font);
80 void SetTextColour(const wxColour& colour);
81 void SetBackgroundColour(const wxColour& colour);
82 void SetBackgroundMode(int mode);
83};
84
85
86//---------------------------------------------------------------------------
87
88%{
b8be6cea
RD
89// Using this macro can sometimes provoke an Internal Compiler Error in MSVC
90// 6, so instead I'l just expand it out by hand...
91// WXSHAPE_IMP_CALLBACKS(wxPyRectangleShape, wxRectangleShape);
92
93 IMP_PYCALLBACK__ (wxPyRectangleShape, wxRectangleShape, OnDelete);
94 IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnDraw);
95 IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnDrawContents);
96 IMP_PYCALLBACK__DCBOOL (wxPyRectangleShape, wxRectangleShape, OnDrawBranches);
97 IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnMoveLinks);
98 IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnErase);
99 IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnEraseContents);
100 IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnHighlight);
101 IMP_PYCALLBACK__2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnLeftClick);
102 IMP_PYCALLBACK__2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnLeftDoubleClick);
103 IMP_PYCALLBACK__2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnRightClick);
104 IMP_PYCALLBACK__2DBL (wxPyRectangleShape, wxRectangleShape, OnSize);
105 IMP_PYCALLBACK_BOOL_DC4DBLBOOL (wxPyRectangleShape, wxRectangleShape, OnMovePre);
106 IMP_PYCALLBACK__DC4DBLBOOL (wxPyRectangleShape, wxRectangleShape, OnMovePost);
107 IMP_PYCALLBACK__BOOL2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnDragLeft);
108 IMP_PYCALLBACK__2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnBeginDragLeft);
109 IMP_PYCALLBACK__2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnEndDragLeft);
110 IMP_PYCALLBACK__BOOL2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnDragRight);
111 IMP_PYCALLBACK__2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnBeginDragRight);
112 IMP_PYCALLBACK__2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnEndDragRight);
113 IMP_PYCALLBACK__DC4DBL (wxPyRectangleShape, wxRectangleShape, OnDrawOutline);
114 IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnDrawControlPoints);
115 IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnEraseControlPoints);
116 IMP_PYCALLBACK__DCBOOL (wxPyRectangleShape, wxRectangleShape, OnMoveLink);
117 IMP_PYCALLBACK__WXCPBOOL2DBL2INT(wxPyRectangleShape, wxRectangleShape, OnSizingDragLeft);
118 IMP_PYCALLBACK__WXCP2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnSizingBeginDragLeft);
119 IMP_PYCALLBACK__WXCP2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnSizingEndDragLeft);
120 IMP_PYCALLBACK__2DBL (wxPyRectangleShape, wxRectangleShape, OnBeginSize);
121 IMP_PYCALLBACK__2DBL (wxPyRectangleShape, wxRectangleShape, OnEndSize)
122
e91a9dfc
RD
123%}
124
125class wxPyRectangleShape : public wxPyShape {
126public:
d14a1e28
RD
127 %addtofunc wxPyRectangleShape "self._setOORandCallbackInfo(PyRectangleShape)"
128
e91a9dfc 129 wxPyRectangleShape(double width = 0.0, double height = 0.0);
0122b7e3 130 void _setCallbackInfo(PyObject* self, PyObject* _class);
e91a9dfc
RD
131
132 void SetCornerRadius(double radius);
133
134 void base_OnDelete();
135 void base_OnDraw(wxDC& dc);
136 void base_OnDrawContents(wxDC& dc);
137 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
138 void base_OnMoveLinks(wxDC& dc);
139 void base_OnErase(wxDC& dc);
140 void base_OnEraseContents(wxDC& dc);
141 void base_OnHighlight(wxDC& dc);
142 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
143 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
144 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
145 void base_OnSize(double x, double y);
dd9f7fea
RD
146 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
147 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
e91a9dfc
RD
148 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
149 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
150 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
151 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
152 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
153 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
154 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
155 void base_OnDrawControlPoints(wxDC& dc);
156 void base_OnEraseControlPoints(wxDC& dc);
dd9f7fea 157 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True);
2348eaee
RD
158 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
159 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
160 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
161 void base_OnBeginSize(double w, double h);
162 void base_OnEndSize(double w, double h);
163// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
164};
165
166//---------------------------------------------------------------------------
167
168%{
169 WXSHAPE_IMP_CALLBACKS(wxPyControlPoint, wxControlPoint);
170%}
171
172class wxPyControlPoint : public wxPyRectangleShape {
173public:
d14a1e28
RD
174 %addtofunc wxPyControlPoint "self._setOORandCallbackInfo(PyControlPoint)"
175
2348eaee
RD
176 wxPyControlPoint(wxPyShapeCanvas *the_canvas = NULL,
177 wxPyShape *object = NULL,
178 double size = 0.0, double the_xoffset = 0.0,
179 double the_yoffset = 0.0, int the_type = 0);
180
0122b7e3 181 void _setCallbackInfo(PyObject* self, PyObject* _class);
2348eaee
RD
182
183 void SetCornerRadius(double radius);
184
185 void base_OnDelete();
186 void base_OnDraw(wxDC& dc);
187 void base_OnDrawContents(wxDC& dc);
188 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
189 void base_OnMoveLinks(wxDC& dc);
190 void base_OnErase(wxDC& dc);
191 void base_OnEraseContents(wxDC& dc);
192 void base_OnHighlight(wxDC& dc);
193 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
194 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
195 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
196 void base_OnSize(double x, double y);
dd9f7fea
RD
197 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
198 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
2348eaee
RD
199 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
200 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
201 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
202 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
203 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
204 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
205 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
206 void base_OnDrawControlPoints(wxDC& dc);
207 void base_OnEraseControlPoints(wxDC& dc);
dd9f7fea 208 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True);
2348eaee
RD
209 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
210 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
211 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
e91a9dfc
RD
212 void base_OnBeginSize(double w, double h);
213 void base_OnEndSize(double w, double h);
214// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
215};
216
217//---------------------------------------------------------------------------
218%{
219 WXSHAPE_IMP_CALLBACKS(wxPyBitmapShape, wxBitmapShape);
220%}
221
222
223class wxPyBitmapShape : public wxPyRectangleShape {
224public:
d14a1e28
RD
225 %addtofunc wxPyBitmapShape "self._setOORandCallbackInfo(PyBitmapShape)"
226
e91a9dfc
RD
227 wxPyBitmapShape();
228
0122b7e3 229 void _setCallbackInfo(PyObject* self, PyObject* _class);
e91a9dfc
RD
230
231 wxBitmap& GetBitmap();
232 wxString GetFilename();
233 void SetBitmap(const wxBitmap& bitmap);
234 void SetFilename(const wxString& filename);
235
236 void base_OnDelete();
237 void base_OnDraw(wxDC& dc);
238 void base_OnDrawContents(wxDC& dc);
239 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
240 void base_OnMoveLinks(wxDC& dc);
241 void base_OnErase(wxDC& dc);
242 void base_OnEraseContents(wxDC& dc);
243 void base_OnHighlight(wxDC& dc);
244 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
245 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
246 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
247 void base_OnSize(double x, double y);
dd9f7fea
RD
248 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
249 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
e91a9dfc
RD
250 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
251 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
252 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
253 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
254 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
255 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
256 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
257 void base_OnDrawControlPoints(wxDC& dc);
258 void base_OnEraseControlPoints(wxDC& dc);
dd9f7fea 259 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True);
2348eaee
RD
260 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
261 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
262 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
e91a9dfc
RD
263 void base_OnBeginSize(double w, double h);
264 void base_OnEndSize(double w, double h);
265// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
266};
267
268//---------------------------------------------------------------------------
269%{
270 WXSHAPE_IMP_CALLBACKS(wxPyDrawnShape, wxDrawnShape);
271%}
272
273class wxPyDrawnShape : public wxPyRectangleShape {
274public:
d14a1e28
RD
275 %addtofunc wxPyDrawnShape "self._setOORandCallbackInfo(PyDrawnShape)"
276
e91a9dfc
RD
277 wxPyDrawnShape();
278
0122b7e3 279 void _setCallbackInfo(PyObject* self, PyObject* _class);
e91a9dfc
RD
280
281 void CalculateSize();
282 void DestroyClippingRect();
283 void DrawArc(const wxPoint& centrePoint, const wxPoint& startPoint,
284 const wxPoint& endPoint);
285 void DrawAtAngle(int angle);
286 void DrawEllipticArc(const wxRect& rect, double startAngle, double endAngle);
287 void DrawLine(const wxPoint& point1, const wxPoint& point2);
eec92d76 288 void DrawLines(int PCOUNT, wxPoint* points);
e91a9dfc 289 void DrawPoint(const wxPoint& point);
eec92d76 290 void DrawPolygon(int PCOUNT, wxPoint* points, int flags = 0);
e91a9dfc
RD
291 void DrawRectangle(const wxRect& rect);
292 void DrawRoundedRectangle(const wxRect& rect, double radius);
eec92d76 293 void DrawSpline(int PCOUNT, wxPoint* points);
e91a9dfc
RD
294 void DrawText(const wxString& text, const wxPoint& point);
295 int GetAngle();
296
297 wxPseudoMetaFile& GetMetaFile();
298
299 double GetRotation();
1e4a197e 300 bool LoadFromMetaFile(const wxString& filename);
e91a9dfc
RD
301 void Rotate(double x, double y, double theta);
302 void SetClippingRect(const wxRect& rect);
303 void SetDrawnBackgroundColour(const wxColour& colour);
304 void SetDrawnBackgroundMode(int mode);
305 void SetDrawnBrush(wxBrush* pen, bool isOutline = FALSE);
306 void SetDrawnFont(wxFont* font);
307 void SetDrawnPen(wxPen* pen, bool isOutline = FALSE);
308 void SetDrawnTextColour(const wxColour& colour);
309 void Scale(double sx, double sy);
310 void SetSaveToFile(bool save);
311 void Translate(double x, double y);
312
313
314 void base_OnDelete();
315 void base_OnDraw(wxDC& dc);
316 void base_OnDrawContents(wxDC& dc);
317 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
318 void base_OnMoveLinks(wxDC& dc);
319 void base_OnErase(wxDC& dc);
320 void base_OnEraseContents(wxDC& dc);
321 void base_OnHighlight(wxDC& dc);
322 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
323 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
324 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
325 void base_OnSize(double x, double y);
dd9f7fea
RD
326 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
327 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
e91a9dfc
RD
328 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
329 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
330 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
331 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
332 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
333 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
334 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
335 void base_OnDrawControlPoints(wxDC& dc);
336 void base_OnEraseControlPoints(wxDC& dc);
dd9f7fea 337 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True);
2348eaee
RD
338 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
339 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
340 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
e91a9dfc
RD
341 void base_OnBeginSize(double w, double h);
342 void base_OnEndSize(double w, double h);
343// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
344
345};
346
347
348//---------------------------------------------------------------------------
349
9416aa89 350class wxOGLConstraint : public wxObject {
e91a9dfc
RD
351public:
352 //wxOGLConstraint(int type, wxPyShape *constraining, wxList& constrained);
d14a1e28 353 %extend {
e91a9dfc 354 wxOGLConstraint(int type, wxPyShape *constraining, PyObject* constrained) {
d14a1e28 355 wxList* list = wxPy_wxListHelper(constrained, wxT("wxPyShape"));
e91a9dfc
RD
356 wxOGLConstraint* rv = new wxOGLConstraint(type, constraining, *list);
357 delete list;
358 return rv;
359 }
360 }
9ae9011b
RD
361
362 //~wxOGLConstraint(); The wxCompositShape takes ownership of the constraint
e91a9dfc
RD
363
364 bool Evaluate();
365 void SetSpacing(double x, double y);
366 bool Equals(double a, double b);
367
368};
369
370
371
372//---------------------------------------------------------------------------
373
374%{
375 WXSHAPE_IMP_CALLBACKS(wxPyCompositeShape, wxCompositeShape);
376%}
377
378class wxPyCompositeShape : public wxPyRectangleShape {
379public:
d14a1e28
RD
380 %addtofunc wxPyCompositeShape "self._setOORandCallbackInfo(PyCompositeShape)"
381
e91a9dfc
RD
382 wxPyCompositeShape();
383
0122b7e3 384 void _setCallbackInfo(PyObject* self, PyObject* _class);
d14a1e28 385
e91a9dfc 386 void AddChild(wxPyShape *child, wxPyShape *addAfter = NULL);
e91a9dfc
RD
387 wxOGLConstraint * AddConstraint(wxOGLConstraint *constraint);
388
714d23b4 389
e91a9dfc
RD
390 //wxOGLConstraint * AddConstraint(int type,
391 // wxPyShape *constraining,
392 // wxList& constrained);
d14a1e28 393 %extend {
714d23b4
RD
394 wxOGLConstraint * AddConstrainedShapes(int type, wxPyShape *constraining,
395 PyObject* constrained) {
d14a1e28 396 wxList* list = wxPy_wxListHelper(constrained, wxT("wxPyShape"));
714d23b4
RD
397 wxOGLConstraint* rv = self->AddConstraint(type, constraining, *list);
398 delete list;
399 return rv;
400 }
401 }
e91a9dfc
RD
402
403 %name(AddSimpleConstraint)wxOGLConstraint* AddConstraint(int type,
404 wxPyShape *constraining,
405 wxPyShape *constrained);
406
407 void CalculateSize();
408 bool ContainsDivision(wxPyDivisionShape *division);
409 void DeleteConstraint(wxOGLConstraint *constraint);
410 void DeleteConstraintsInvolvingChild(wxPyShape *child);
411
412 // **** Needs an output typemap
413 //wxOGLConstraint * FindConstraint(long id, wxPyCompositeShape **actualComposite);
414
415 wxPyShape * FindContainerImage();
416
417 // wxList& GetConstraints();
418 // wxList& GetDivisions();
d14a1e28 419 %extend {
e91a9dfc
RD
420 PyObject* GetConstraints() {
421 wxList& list = self->GetConstraints();
d14a1e28 422 return wxPy_ConvertList(&list);
e91a9dfc
RD
423 }
424
425 PyObject* GetDivisions() {
426 wxList& list = self->GetDivisions();
d14a1e28 427 return wxPy_ConvertShapeList(&list);
e91a9dfc
RD
428 }
429 }
430
431 void MakeContainer();
432 bool Recompute();
433 void RemoveChild(wxPyShape *child);
434
435
436 void base_OnDelete();
437 void base_OnDraw(wxDC& dc);
438 void base_OnDrawContents(wxDC& dc);
439 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
440 void base_OnMoveLinks(wxDC& dc);
441 void base_OnErase(wxDC& dc);
442 void base_OnEraseContents(wxDC& dc);
443 void base_OnHighlight(wxDC& dc);
444 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
445 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
446 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
447 void base_OnSize(double x, double y);
dd9f7fea
RD
448 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
449 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
e91a9dfc
RD
450 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
451 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
452 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
453 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
454 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
455 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
456 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
457 void base_OnDrawControlPoints(wxDC& dc);
458 void base_OnEraseControlPoints(wxDC& dc);
dd9f7fea 459 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True);
2348eaee
RD
460 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
461 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
462 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
e91a9dfc
RD
463 void base_OnBeginSize(double w, double h);
464 void base_OnEndSize(double w, double h);
465// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
466
467};
468
469
470//---------------------------------------------------------------------------
471
472%{
473 WXSHAPE_IMP_CALLBACKS(wxPyDividedShape, wxDividedShape);
474%}
475
476class wxPyDividedShape : public wxPyRectangleShape {
477public:
d14a1e28
RD
478 %addtofunc wxPyDividedShape "self._setOORandCallbackInfo(PyDividedShape)"
479
e91a9dfc
RD
480 wxPyDividedShape(double width = 0.0, double height = 0.0);
481
0122b7e3 482 void _setCallbackInfo(PyObject* self, PyObject* _class);
e91a9dfc
RD
483
484 void EditRegions();
485 void SetRegionSizes();
486
487 void base_OnDelete();
488 void base_OnDraw(wxDC& dc);
489 void base_OnDrawContents(wxDC& dc);
490 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
491 void base_OnMoveLinks(wxDC& dc);
492 void base_OnErase(wxDC& dc);
493 void base_OnEraseContents(wxDC& dc);
494 void base_OnHighlight(wxDC& dc);
495 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
496 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
497 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
498 void base_OnSize(double x, double y);
dd9f7fea
RD
499 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
500 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
e91a9dfc
RD
501 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
502 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
503 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
504 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
505 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
506 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
507 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
508 void base_OnDrawControlPoints(wxDC& dc);
509 void base_OnEraseControlPoints(wxDC& dc);
dd9f7fea 510 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True);
2348eaee
RD
511 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
512 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
513 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
e91a9dfc
RD
514 void base_OnBeginSize(double w, double h);
515 void base_OnEndSize(double w, double h);
516// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
517
518};
519
520
521//---------------------------------------------------------------------------
522%{
523 WXSHAPE_IMP_CALLBACKS(wxPyDivisionShape, wxDivisionShape);
524%}
525
526class wxPyDivisionShape : public wxPyCompositeShape {
527public:
d14a1e28
RD
528 %addtofunc wxPyDivisionShape "self._setOORandCallbackInfo(PyDivisionShape)"
529
e91a9dfc
RD
530 wxPyDivisionShape();
531
0122b7e3 532 void _setCallbackInfo(PyObject* self, PyObject* _class);
e91a9dfc
RD
533
534 void AdjustBottom(double bottom, bool test);
535 void AdjustLeft(double left, bool test);
536 void AdjustRight(double right, bool test);
537 void AdjustTop(double top, bool test);
538 void Divide(int direction);
539 void EditEdge(int side);
540 wxPyDivisionShape * GetBottomSide();
541 int GetHandleSide();
542 wxPyDivisionShape * GetLeftSide();
543 wxString GetLeftSideColour();
544 wxPen * GetLeftSidePen();
545 wxPyDivisionShape * GetRightSide();
546 wxPyDivisionShape * GetTopSide();
547 wxPen * GetTopSidePen();
548 void ResizeAdjoining(int side, double newPos, bool test);
549 void PopupMenu(double x, double y);
550 void SetBottomSide(wxPyDivisionShape *shape);
551 void SetHandleSide(int side);
552 void SetLeftSide(wxPyDivisionShape *shape);
553 void SetLeftSideColour(const wxString& colour);
554 void SetLeftSidePen(wxPen *pen);
555 void SetRightSide(wxPyDivisionShape *shape);
556 void SetTopSide(wxPyDivisionShape *shape);
557 void SetTopSideColour(const wxString& colour);
558 void SetTopSidePen(wxPen *pen);
559
560
561
562 void base_OnDelete();
563 void base_OnDraw(wxDC& dc);
564 void base_OnDrawContents(wxDC& dc);
565 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
566 void base_OnMoveLinks(wxDC& dc);
567 void base_OnErase(wxDC& dc);
568 void base_OnEraseContents(wxDC& dc);
569 void base_OnHighlight(wxDC& dc);
570 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
571 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
572 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
573 void base_OnSize(double x, double y);
dd9f7fea
RD
574 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
575 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True);
e91a9dfc
RD
576 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
577 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
578 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
579 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
580 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
581 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
582 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
583 void base_OnDrawControlPoints(wxDC& dc);
584 void base_OnEraseControlPoints(wxDC& dc);
dd9f7fea 585 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True);
2348eaee
RD
586 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
587 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
588 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
e91a9dfc
RD
589 void base_OnBeginSize(double w, double h);
590 void base_OnEndSize(double w, double h);
591// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
592
593};
594
595
596
597//---------------------------------------------------------------------------
598