X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dd9f7fea29e3f8bb61861f52984b7943512346ac..42f8298f6f42d5d63bb3caf65682b7d9d9f8b702:/wxPython/contrib/ogl/_oglshapes.i diff --git a/wxPython/contrib/ogl/_oglshapes.i b/wxPython/contrib/ogl/_oglshapes.i index db2111178f..10ed873632 100644 --- a/wxPython/contrib/ogl/_oglshapes.i +++ b/wxPython/contrib/ogl/_oglshapes.i @@ -22,6 +22,15 @@ enum { }; //--------------------------------------------------------------------------- + +%typemap(in) (int points, wxPoint* points_array ) { + $2 = wxPoint_LIST_helper($input, &$1); + if ($2 == NULL) SWIG_fail; +} +%typemap(freearg) (int points, wxPoint* points_array ) { + if ($2) delete [] $2; +} + //--------------------------------------------------------------------------- class wxPseudoMetaFile : public wxObject { @@ -69,9 +78,9 @@ public: void DrawEllipse(const wxRect& rect); void DrawPoint(const wxPoint& pt); void DrawText(const wxString& text, const wxPoint& pt); - void DrawLines(int PCOUNT, wxPoint* points); - void DrawPolygon(int PCOUNT, wxPoint* points, int flags = 0); - void DrawSpline(int PCOUNT, wxPoint* points); + void DrawLines(int points, wxPoint* points_array); + void DrawPolygon(int points, wxPoint* points_array, int flags = 0); + void DrawSpline(int points, wxPoint* points_array); void SetClippingRect(const wxRect& rect); void DestroyClippingRect(); void SetPen(wxPen* pen, bool isOutline = FALSE); @@ -124,13 +133,14 @@ public: class wxPyRectangleShape : public wxPyShape { public: - %addtofunc wxPyRectangleShape "self._setOORandCallbackInfo(PyRectangleShape)" + %pythonAppend wxPyRectangleShape "self._setOORandCallbackInfo(PyRectangleShape)" wxPyRectangleShape(double width = 0.0, double height = 0.0); void _setCallbackInfo(PyObject* self, PyObject* _class); void SetCornerRadius(double radius); - + double GetCornerRadius(); + void base_OnDelete(); void base_OnDraw(wxDC& dc); void base_OnDrawContents(wxDC& dc); @@ -143,8 +153,8 @@ public: void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); void base_OnSize(double x, double y); - bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); - void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); + bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -154,7 +164,7 @@ public: void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); void base_OnDrawControlPoints(wxDC& dc); void base_OnEraseControlPoints(wxDC& dc); - void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); + void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true); void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); @@ -171,7 +181,7 @@ public: class wxPyControlPoint : public wxPyRectangleShape { public: - %addtofunc wxPyControlPoint "self._setOORandCallbackInfo(PyControlPoint)" + %pythonAppend wxPyControlPoint "self._setOORandCallbackInfo(PyControlPoint)" wxPyControlPoint(wxPyShapeCanvas *the_canvas = NULL, wxPyShape *object = NULL, @@ -194,8 +204,8 @@ public: void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); void base_OnSize(double x, double y); - bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); - void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); + bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -205,7 +215,7 @@ public: void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); void base_OnDrawControlPoints(wxDC& dc); void base_OnEraseControlPoints(wxDC& dc); - void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); + void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true); void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); @@ -222,7 +232,7 @@ public: class wxPyBitmapShape : public wxPyRectangleShape { public: - %addtofunc wxPyBitmapShape "self._setOORandCallbackInfo(PyBitmapShape)" + %pythonAppend wxPyBitmapShape "self._setOORandCallbackInfo(PyBitmapShape)" wxPyBitmapShape(); @@ -245,8 +255,8 @@ public: void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); void base_OnSize(double x, double y); - bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); - void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); + bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -256,7 +266,7 @@ public: void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); void base_OnDrawControlPoints(wxDC& dc); void base_OnEraseControlPoints(wxDC& dc); - void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); + void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true); void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); @@ -272,7 +282,7 @@ public: class wxPyDrawnShape : public wxPyRectangleShape { public: - %addtofunc wxPyDrawnShape "self._setOORandCallbackInfo(PyDrawnShape)" + %pythonAppend wxPyDrawnShape "self._setOORandCallbackInfo(PyDrawnShape)" wxPyDrawnShape(); @@ -285,12 +295,14 @@ public: void DrawAtAngle(int angle); void DrawEllipticArc(const wxRect& rect, double startAngle, double endAngle); void DrawLine(const wxPoint& point1, const wxPoint& point2); - void DrawLines(int PCOUNT, wxPoint* points); + void DrawLines(int points, wxPoint* points_array); void DrawPoint(const wxPoint& point); - void DrawPolygon(int PCOUNT, wxPoint* points, int flags = 0); + + void DrawPolygon(int points, wxPoint* points_array, int flags = 0); + void DrawRectangle(const wxRect& rect); void DrawRoundedRectangle(const wxRect& rect, double radius); - void DrawSpline(int PCOUNT, wxPoint* points); + void DrawSpline(int points, wxPoint* points_array); void DrawText(const wxString& text, const wxPoint& point); int GetAngle(); @@ -323,8 +335,8 @@ public: void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); void base_OnSize(double x, double y); - bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); - void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); + bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -334,7 +346,7 @@ public: void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); void base_OnDrawControlPoints(wxDC& dc); void base_OnEraseControlPoints(wxDC& dc); - void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); + void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true); void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); @@ -377,7 +389,7 @@ public: class wxPyCompositeShape : public wxPyRectangleShape { public: - %addtofunc wxPyCompositeShape "self._setOORandCallbackInfo(PyCompositeShape)" + %pythonAppend wxPyCompositeShape "self._setOORandCallbackInfo(PyCompositeShape)" wxPyCompositeShape(); @@ -400,9 +412,9 @@ public: } } - %name(AddSimpleConstraint)wxOGLConstraint* AddConstraint(int type, + %Rename(AddSimpleConstraint, wxOGLConstraint*, AddConstraint(int type, wxPyShape *constraining, - wxPyShape *constrained); + wxPyShape *constrained)); void CalculateSize(); bool ContainsDivision(wxPyDivisionShape *division); @@ -445,8 +457,8 @@ public: void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); void base_OnSize(double x, double y); - bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); - void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); + bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -456,7 +468,7 @@ public: void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); void base_OnDrawControlPoints(wxDC& dc); void base_OnEraseControlPoints(wxDC& dc); - void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); + void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true); void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); @@ -475,7 +487,7 @@ public: class wxPyDividedShape : public wxPyRectangleShape { public: - %addtofunc wxPyDividedShape "self._setOORandCallbackInfo(PyDividedShape)" + %pythonAppend wxPyDividedShape "self._setOORandCallbackInfo(PyDividedShape)" wxPyDividedShape(double width = 0.0, double height = 0.0); @@ -496,8 +508,8 @@ public: void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); void base_OnSize(double x, double y); - bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); - void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); + bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -507,7 +519,7 @@ public: void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); void base_OnDrawControlPoints(wxDC& dc); void base_OnEraseControlPoints(wxDC& dc); - void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); + void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true); void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); @@ -525,10 +537,13 @@ public: class wxPyDivisionShape : public wxPyCompositeShape { public: - %addtofunc wxPyDivisionShape "self._setOORandCallbackInfo(PyDivisionShape)" + %pythonAppend wxPyDivisionShape "self._setOORandCallbackInfo(PyDivisionShape)" + %typemap(out) wxPyDivisionShape*; // turn off this typemap wxPyDivisionShape(); + %typemap(out) wxPyDivisionShape* { $result = wxPyMake_wxShapeEvtHandler($1, $owner); } + void _setCallbackInfo(PyObject* self, PyObject* _class); void AdjustBottom(double bottom, bool test); @@ -571,8 +586,8 @@ public: void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); void base_OnSize(double x, double y); - bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); - void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); + bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -582,7 +597,7 @@ public: void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); void base_OnDrawControlPoints(wxDC& dc); void base_OnEraseControlPoints(wxDC& dc); - void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); + void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true); void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);