]>
Commit | Line | Data |
---|---|---|
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 | ||
14 | // not a %module | |
15 | ||
16 | ||
17 | //--------------------------------------------------------------------------- | |
18 | ||
19 | enum { | |
20 | oglMETAFLAGS_OUTLINE, | |
21 | oglMETAFLAGS_ATTACHMENTS | |
22 | }; | |
23 | ||
24 | //--------------------------------------------------------------------------- | |
25 | //--------------------------------------------------------------------------- | |
26 | ||
27 | class wxPseudoMetaFile : public wxObject { | |
28 | public: | |
29 | wxPseudoMetaFile(); | |
30 | ~wxPseudoMetaFile(); | |
31 | ||
32 | void Draw(wxDC& dc, double xoffset, double yoffset); | |
33 | #ifdef wxUSE_PROLOGIO | |
34 | void WriteAttributes(wxExpr *clause, int whichAngle); | |
35 | void ReadAttributes(wxExpr *clause, int whichAngle); | |
36 | #endif | |
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); | |
43 | bool LoadFromMetaFile(const wxString& filename, double *width, double *height); | |
44 | void GetBounds(double *minX, double *minY, double *maxX, double *maxY); | |
45 | void CalculateSize(wxPyDrawnShape* shape); | |
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); | |
72 | void DrawLines(int PCOUNT, wxPoint* points); | |
73 | void DrawPolygon(int PCOUNT, wxPoint* points, int flags = 0); | |
74 | void DrawSpline(int PCOUNT, wxPoint* points); | |
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 | %{ | |
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 | ||
123 | %} | |
124 | ||
125 | class wxPyRectangleShape : public wxPyShape { | |
126 | public: | |
127 | %addtofunc wxPyRectangleShape "self._setOORandCallbackInfo(PyRectangleShape)" | |
128 | ||
129 | wxPyRectangleShape(double width = 0.0, double height = 0.0); | |
130 | void _setCallbackInfo(PyObject* self, PyObject* _class); | |
131 | ||
132 | void SetCornerRadius(double radius); | |
133 | double GetCornerRadius(); | |
134 | ||
135 | void base_OnDelete(); | |
136 | void base_OnDraw(wxDC& dc); | |
137 | void base_OnDrawContents(wxDC& dc); | |
138 | void base_OnDrawBranches(wxDC& dc, bool erase = FALSE); | |
139 | void base_OnMoveLinks(wxDC& dc); | |
140 | void base_OnErase(wxDC& dc); | |
141 | void base_OnEraseContents(wxDC& dc); | |
142 | void base_OnHighlight(wxDC& dc); | |
143 | void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0); | |
144 | void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); | |
145 | void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); | |
146 | void base_OnSize(double x, double y); | |
147 | bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); | |
148 | void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); | |
149 | void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); | |
150 | void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); | |
151 | void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); | |
152 | void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0); | |
153 | void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0); | |
154 | void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0); | |
155 | void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); | |
156 | void base_OnDrawControlPoints(wxDC& dc); | |
157 | void base_OnEraseControlPoints(wxDC& dc); | |
158 | void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); | |
159 | void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); | |
160 | void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); | |
161 | void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); | |
162 | void base_OnBeginSize(double w, double h); | |
163 | void base_OnEndSize(double w, double h); | |
164 | // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering); | |
165 | }; | |
166 | ||
167 | //--------------------------------------------------------------------------- | |
168 | ||
169 | %{ | |
170 | WXSHAPE_IMP_CALLBACKS(wxPyControlPoint, wxControlPoint); | |
171 | %} | |
172 | ||
173 | class wxPyControlPoint : public wxPyRectangleShape { | |
174 | public: | |
175 | %addtofunc wxPyControlPoint "self._setOORandCallbackInfo(PyControlPoint)" | |
176 | ||
177 | wxPyControlPoint(wxPyShapeCanvas *the_canvas = NULL, | |
178 | wxPyShape *object = NULL, | |
179 | double size = 0.0, double the_xoffset = 0.0, | |
180 | double the_yoffset = 0.0, int the_type = 0); | |
181 | ||
182 | void _setCallbackInfo(PyObject* self, PyObject* _class); | |
183 | ||
184 | void SetCornerRadius(double radius); | |
185 | ||
186 | void base_OnDelete(); | |
187 | void base_OnDraw(wxDC& dc); | |
188 | void base_OnDrawContents(wxDC& dc); | |
189 | void base_OnDrawBranches(wxDC& dc, bool erase = FALSE); | |
190 | void base_OnMoveLinks(wxDC& dc); | |
191 | void base_OnErase(wxDC& dc); | |
192 | void base_OnEraseContents(wxDC& dc); | |
193 | void base_OnHighlight(wxDC& dc); | |
194 | void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0); | |
195 | void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); | |
196 | void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); | |
197 | void base_OnSize(double x, double y); | |
198 | bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); | |
199 | void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); | |
200 | void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); | |
201 | void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); | |
202 | void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); | |
203 | void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0); | |
204 | void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0); | |
205 | void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0); | |
206 | void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); | |
207 | void base_OnDrawControlPoints(wxDC& dc); | |
208 | void base_OnEraseControlPoints(wxDC& dc); | |
209 | void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); | |
210 | void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); | |
211 | void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); | |
212 | void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); | |
213 | void base_OnBeginSize(double w, double h); | |
214 | void base_OnEndSize(double w, double h); | |
215 | // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering); | |
216 | }; | |
217 | ||
218 | //--------------------------------------------------------------------------- | |
219 | %{ | |
220 | WXSHAPE_IMP_CALLBACKS(wxPyBitmapShape, wxBitmapShape); | |
221 | %} | |
222 | ||
223 | ||
224 | class wxPyBitmapShape : public wxPyRectangleShape { | |
225 | public: | |
226 | %addtofunc wxPyBitmapShape "self._setOORandCallbackInfo(PyBitmapShape)" | |
227 | ||
228 | wxPyBitmapShape(); | |
229 | ||
230 | void _setCallbackInfo(PyObject* self, PyObject* _class); | |
231 | ||
232 | wxBitmap& GetBitmap(); | |
233 | wxString GetFilename(); | |
234 | void SetBitmap(const wxBitmap& bitmap); | |
235 | void SetFilename(const wxString& filename); | |
236 | ||
237 | void base_OnDelete(); | |
238 | void base_OnDraw(wxDC& dc); | |
239 | void base_OnDrawContents(wxDC& dc); | |
240 | void base_OnDrawBranches(wxDC& dc, bool erase = FALSE); | |
241 | void base_OnMoveLinks(wxDC& dc); | |
242 | void base_OnErase(wxDC& dc); | |
243 | void base_OnEraseContents(wxDC& dc); | |
244 | void base_OnHighlight(wxDC& dc); | |
245 | void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0); | |
246 | void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); | |
247 | void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); | |
248 | void base_OnSize(double x, double y); | |
249 | bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); | |
250 | void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); | |
251 | void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); | |
252 | void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); | |
253 | void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); | |
254 | void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0); | |
255 | void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0); | |
256 | void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0); | |
257 | void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); | |
258 | void base_OnDrawControlPoints(wxDC& dc); | |
259 | void base_OnEraseControlPoints(wxDC& dc); | |
260 | void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); | |
261 | void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); | |
262 | void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); | |
263 | void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); | |
264 | void base_OnBeginSize(double w, double h); | |
265 | void base_OnEndSize(double w, double h); | |
266 | // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering); | |
267 | }; | |
268 | ||
269 | //--------------------------------------------------------------------------- | |
270 | %{ | |
271 | WXSHAPE_IMP_CALLBACKS(wxPyDrawnShape, wxDrawnShape); | |
272 | %} | |
273 | ||
274 | class wxPyDrawnShape : public wxPyRectangleShape { | |
275 | public: | |
276 | %addtofunc wxPyDrawnShape "self._setOORandCallbackInfo(PyDrawnShape)" | |
277 | ||
278 | wxPyDrawnShape(); | |
279 | ||
280 | void _setCallbackInfo(PyObject* self, PyObject* _class); | |
281 | ||
282 | void CalculateSize(); | |
283 | void DestroyClippingRect(); | |
284 | void DrawArc(const wxPoint& centrePoint, const wxPoint& startPoint, | |
285 | const wxPoint& endPoint); | |
286 | void DrawAtAngle(int angle); | |
287 | void DrawEllipticArc(const wxRect& rect, double startAngle, double endAngle); | |
288 | void DrawLine(const wxPoint& point1, const wxPoint& point2); | |
289 | void DrawLines(int PCOUNT, wxPoint* points); | |
290 | void DrawPoint(const wxPoint& point); | |
291 | void DrawPolygon(int PCOUNT, wxPoint* points, int flags = 0); | |
292 | void DrawRectangle(const wxRect& rect); | |
293 | void DrawRoundedRectangle(const wxRect& rect, double radius); | |
294 | void DrawSpline(int PCOUNT, wxPoint* points); | |
295 | void DrawText(const wxString& text, const wxPoint& point); | |
296 | int GetAngle(); | |
297 | ||
298 | wxPseudoMetaFile& GetMetaFile(); | |
299 | ||
300 | double GetRotation(); | |
301 | bool LoadFromMetaFile(const wxString& filename); | |
302 | void Rotate(double x, double y, double theta); | |
303 | void SetClippingRect(const wxRect& rect); | |
304 | void SetDrawnBackgroundColour(const wxColour& colour); | |
305 | void SetDrawnBackgroundMode(int mode); | |
306 | void SetDrawnBrush(wxBrush* pen, bool isOutline = FALSE); | |
307 | void SetDrawnFont(wxFont* font); | |
308 | void SetDrawnPen(wxPen* pen, bool isOutline = FALSE); | |
309 | void SetDrawnTextColour(const wxColour& colour); | |
310 | void Scale(double sx, double sy); | |
311 | void SetSaveToFile(bool save); | |
312 | void Translate(double x, double y); | |
313 | ||
314 | ||
315 | void base_OnDelete(); | |
316 | void base_OnDraw(wxDC& dc); | |
317 | void base_OnDrawContents(wxDC& dc); | |
318 | void base_OnDrawBranches(wxDC& dc, bool erase = FALSE); | |
319 | void base_OnMoveLinks(wxDC& dc); | |
320 | void base_OnErase(wxDC& dc); | |
321 | void base_OnEraseContents(wxDC& dc); | |
322 | void base_OnHighlight(wxDC& dc); | |
323 | void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0); | |
324 | void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); | |
325 | void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); | |
326 | void base_OnSize(double x, double y); | |
327 | bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); | |
328 | void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); | |
329 | void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); | |
330 | void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); | |
331 | void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); | |
332 | void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0); | |
333 | void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0); | |
334 | void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0); | |
335 | void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); | |
336 | void base_OnDrawControlPoints(wxDC& dc); | |
337 | void base_OnEraseControlPoints(wxDC& dc); | |
338 | void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); | |
339 | void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); | |
340 | void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); | |
341 | void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); | |
342 | void base_OnBeginSize(double w, double h); | |
343 | void base_OnEndSize(double w, double h); | |
344 | // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering); | |
345 | ||
346 | }; | |
347 | ||
348 | ||
349 | //--------------------------------------------------------------------------- | |
350 | ||
351 | class wxOGLConstraint : public wxObject { | |
352 | public: | |
353 | //wxOGLConstraint(int type, wxPyShape *constraining, wxList& constrained); | |
354 | %extend { | |
355 | wxOGLConstraint(int type, wxPyShape *constraining, PyObject* constrained) { | |
356 | wxList* list = wxPy_wxListHelper(constrained, wxT("wxPyShape")); | |
357 | wxOGLConstraint* rv = new wxOGLConstraint(type, constraining, *list); | |
358 | delete list; | |
359 | return rv; | |
360 | } | |
361 | } | |
362 | ||
363 | //~wxOGLConstraint(); The wxCompositShape takes ownership of the constraint | |
364 | ||
365 | bool Evaluate(); | |
366 | void SetSpacing(double x, double y); | |
367 | bool Equals(double a, double b); | |
368 | ||
369 | }; | |
370 | ||
371 | ||
372 | ||
373 | //--------------------------------------------------------------------------- | |
374 | ||
375 | %{ | |
376 | WXSHAPE_IMP_CALLBACKS(wxPyCompositeShape, wxCompositeShape); | |
377 | %} | |
378 | ||
379 | class wxPyCompositeShape : public wxPyRectangleShape { | |
380 | public: | |
381 | %addtofunc wxPyCompositeShape "self._setOORandCallbackInfo(PyCompositeShape)" | |
382 | ||
383 | wxPyCompositeShape(); | |
384 | ||
385 | void _setCallbackInfo(PyObject* self, PyObject* _class); | |
386 | ||
387 | void AddChild(wxPyShape *child, wxPyShape *addAfter = NULL); | |
388 | wxOGLConstraint * AddConstraint(wxOGLConstraint *constraint); | |
389 | ||
390 | ||
391 | //wxOGLConstraint * AddConstraint(int type, | |
392 | // wxPyShape *constraining, | |
393 | // wxList& constrained); | |
394 | %extend { | |
395 | wxOGLConstraint * AddConstrainedShapes(int type, wxPyShape *constraining, | |
396 | PyObject* constrained) { | |
397 | wxList* list = wxPy_wxListHelper(constrained, wxT("wxPyShape")); | |
398 | wxOGLConstraint* rv = self->AddConstraint(type, constraining, *list); | |
399 | delete list; | |
400 | return rv; | |
401 | } | |
402 | } | |
403 | ||
404 | %name(AddSimpleConstraint)wxOGLConstraint* AddConstraint(int type, | |
405 | wxPyShape *constraining, | |
406 | wxPyShape *constrained); | |
407 | ||
408 | void CalculateSize(); | |
409 | bool ContainsDivision(wxPyDivisionShape *division); | |
410 | void DeleteConstraint(wxOGLConstraint *constraint); | |
411 | void DeleteConstraintsInvolvingChild(wxPyShape *child); | |
412 | ||
413 | // **** Needs an output typemap | |
414 | //wxOGLConstraint * FindConstraint(long id, wxPyCompositeShape **actualComposite); | |
415 | ||
416 | wxPyShape * FindContainerImage(); | |
417 | ||
418 | // wxList& GetConstraints(); | |
419 | // wxList& GetDivisions(); | |
420 | %extend { | |
421 | PyObject* GetConstraints() { | |
422 | wxList& list = self->GetConstraints(); | |
423 | return wxPy_ConvertList(&list); | |
424 | } | |
425 | ||
426 | PyObject* GetDivisions() { | |
427 | wxList& list = self->GetDivisions(); | |
428 | return wxPy_ConvertShapeList(&list); | |
429 | } | |
430 | } | |
431 | ||
432 | void MakeContainer(); | |
433 | bool Recompute(); | |
434 | void RemoveChild(wxPyShape *child); | |
435 | ||
436 | ||
437 | void base_OnDelete(); | |
438 | void base_OnDraw(wxDC& dc); | |
439 | void base_OnDrawContents(wxDC& dc); | |
440 | void base_OnDrawBranches(wxDC& dc, bool erase = FALSE); | |
441 | void base_OnMoveLinks(wxDC& dc); | |
442 | void base_OnErase(wxDC& dc); | |
443 | void base_OnEraseContents(wxDC& dc); | |
444 | void base_OnHighlight(wxDC& dc); | |
445 | void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0); | |
446 | void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); | |
447 | void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); | |
448 | void base_OnSize(double x, double y); | |
449 | bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); | |
450 | void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); | |
451 | void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); | |
452 | void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); | |
453 | void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); | |
454 | void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0); | |
455 | void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0); | |
456 | void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0); | |
457 | void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); | |
458 | void base_OnDrawControlPoints(wxDC& dc); | |
459 | void base_OnEraseControlPoints(wxDC& dc); | |
460 | void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); | |
461 | void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); | |
462 | void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); | |
463 | void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); | |
464 | void base_OnBeginSize(double w, double h); | |
465 | void base_OnEndSize(double w, double h); | |
466 | // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering); | |
467 | ||
468 | }; | |
469 | ||
470 | ||
471 | //--------------------------------------------------------------------------- | |
472 | ||
473 | %{ | |
474 | WXSHAPE_IMP_CALLBACKS(wxPyDividedShape, wxDividedShape); | |
475 | %} | |
476 | ||
477 | class wxPyDividedShape : public wxPyRectangleShape { | |
478 | public: | |
479 | %addtofunc wxPyDividedShape "self._setOORandCallbackInfo(PyDividedShape)" | |
480 | ||
481 | wxPyDividedShape(double width = 0.0, double height = 0.0); | |
482 | ||
483 | void _setCallbackInfo(PyObject* self, PyObject* _class); | |
484 | ||
485 | void EditRegions(); | |
486 | void SetRegionSizes(); | |
487 | ||
488 | void base_OnDelete(); | |
489 | void base_OnDraw(wxDC& dc); | |
490 | void base_OnDrawContents(wxDC& dc); | |
491 | void base_OnDrawBranches(wxDC& dc, bool erase = FALSE); | |
492 | void base_OnMoveLinks(wxDC& dc); | |
493 | void base_OnErase(wxDC& dc); | |
494 | void base_OnEraseContents(wxDC& dc); | |
495 | void base_OnHighlight(wxDC& dc); | |
496 | void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0); | |
497 | void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); | |
498 | void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); | |
499 | void base_OnSize(double x, double y); | |
500 | bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); | |
501 | void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); | |
502 | void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); | |
503 | void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); | |
504 | void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); | |
505 | void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0); | |
506 | void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0); | |
507 | void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0); | |
508 | void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); | |
509 | void base_OnDrawControlPoints(wxDC& dc); | |
510 | void base_OnEraseControlPoints(wxDC& dc); | |
511 | void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); | |
512 | void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); | |
513 | void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); | |
514 | void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); | |
515 | void base_OnBeginSize(double w, double h); | |
516 | void base_OnEndSize(double w, double h); | |
517 | // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering); | |
518 | ||
519 | }; | |
520 | ||
521 | ||
522 | //--------------------------------------------------------------------------- | |
523 | %{ | |
524 | WXSHAPE_IMP_CALLBACKS(wxPyDivisionShape, wxDivisionShape); | |
525 | %} | |
526 | ||
527 | class wxPyDivisionShape : public wxPyCompositeShape { | |
528 | public: | |
529 | %addtofunc wxPyDivisionShape "self._setOORandCallbackInfo(PyDivisionShape)" | |
530 | ||
531 | wxPyDivisionShape(); | |
532 | ||
533 | void _setCallbackInfo(PyObject* self, PyObject* _class); | |
534 | ||
535 | void AdjustBottom(double bottom, bool test); | |
536 | void AdjustLeft(double left, bool test); | |
537 | void AdjustRight(double right, bool test); | |
538 | void AdjustTop(double top, bool test); | |
539 | void Divide(int direction); | |
540 | void EditEdge(int side); | |
541 | wxPyDivisionShape * GetBottomSide(); | |
542 | int GetHandleSide(); | |
543 | wxPyDivisionShape * GetLeftSide(); | |
544 | wxString GetLeftSideColour(); | |
545 | wxPen * GetLeftSidePen(); | |
546 | wxPyDivisionShape * GetRightSide(); | |
547 | wxPyDivisionShape * GetTopSide(); | |
548 | wxPen * GetTopSidePen(); | |
549 | void ResizeAdjoining(int side, double newPos, bool test); | |
550 | void PopupMenu(double x, double y); | |
551 | void SetBottomSide(wxPyDivisionShape *shape); | |
552 | void SetHandleSide(int side); | |
553 | void SetLeftSide(wxPyDivisionShape *shape); | |
554 | void SetLeftSideColour(const wxString& colour); | |
555 | void SetLeftSidePen(wxPen *pen); | |
556 | void SetRightSide(wxPyDivisionShape *shape); | |
557 | void SetTopSide(wxPyDivisionShape *shape); | |
558 | void SetTopSideColour(const wxString& colour); | |
559 | void SetTopSidePen(wxPen *pen); | |
560 | ||
561 | ||
562 | ||
563 | void base_OnDelete(); | |
564 | void base_OnDraw(wxDC& dc); | |
565 | void base_OnDrawContents(wxDC& dc); | |
566 | void base_OnDrawBranches(wxDC& dc, bool erase = FALSE); | |
567 | void base_OnMoveLinks(wxDC& dc); | |
568 | void base_OnErase(wxDC& dc); | |
569 | void base_OnEraseContents(wxDC& dc); | |
570 | void base_OnHighlight(wxDC& dc); | |
571 | void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0); | |
572 | void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); | |
573 | void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); | |
574 | void base_OnSize(double x, double y); | |
575 | bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); | |
576 | void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); | |
577 | void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); | |
578 | void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); | |
579 | void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); | |
580 | void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0); | |
581 | void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0); | |
582 | void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0); | |
583 | void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); | |
584 | void base_OnDrawControlPoints(wxDC& dc); | |
585 | void base_OnEraseControlPoints(wxDC& dc); | |
586 | void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); | |
587 | void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); | |
588 | void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); | |
589 | void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); | |
590 | void base_OnBeginSize(double w, double h); | |
591 | void base_OnEndSize(double w, double h); | |
592 | // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering); | |
593 | ||
594 | }; | |
595 | ||
596 | ||
597 | ||
598 | //--------------------------------------------------------------------------- | |
599 |