X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d14a1e28567de23c586bc80017073d0c39f8d18f..728f972bcef8d6b01f5f67cb77060d23098d8877:/wxPython/contrib/ogl/_oglshapes2.i diff --git a/wxPython/contrib/ogl/_oglshapes2.i b/wxPython/contrib/ogl/_oglshapes2.i index 4a243e61fa..ef79bd7e70 100644 --- a/wxPython/contrib/ogl/_oglshapes2.i +++ b/wxPython/contrib/ogl/_oglshapes2.i @@ -22,7 +22,7 @@ class wxPyEllipseShape : public wxPyShape { public: - %addtofunc wxPyEllipseShape "self._setOORandCallbackInfo(PyEllipseShape)" + %pythonAppend wxPyEllipseShape "self._setOORandCallbackInfo(PyEllipseShape)" wxPyEllipseShape(double width = 0.0, double height = 0.0); @@ -39,8 +39,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); @@ -50,7 +50,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); @@ -66,7 +66,7 @@ public: class wxPyCircleShape : public wxPyEllipseShape { public: - %addtofunc wxPyCircleShape "self._setOORandCallbackInfo(PyCircleShape)" + %pythonAppend wxPyCircleShape "self._setOORandCallbackInfo(PyCircleShape)" wxPyCircleShape(double width = 0.0); @@ -83,8 +83,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); @@ -94,7 +94,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); @@ -141,7 +141,7 @@ public: class wxPyLineShape : public wxPyShape { public: - %addtofunc wxPyLineShape "self._setOORandCallbackInfo(PyLineShape)" + %pythonAppend wxPyLineShape "self._setOORandCallbackInfo(PyLineShape)" wxPyLineShape(); @@ -163,13 +163,13 @@ public: bool ClearArrow(const wxString& name); void ClearArrowsAtPosition(int position = -1); void DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool proportionalOffset); - %name(DeleteArrowHeadId)bool DeleteArrowHead(long arrowId); + %Rename(DeleteArrowHeadId, bool, DeleteArrowHead(long arrowId)); bool DeleteArrowHead(int position, const wxString& name); bool DeleteLineControlPoint(); void DrawArrows(wxDC& dc); void DrawRegion(wxDC& dc, wxShapeRegion *region, double x, double y); void EraseRegion(wxDC& dc, wxShapeRegion *region, double x, double y); - %name(FindArrowHeadId)wxArrowHead * FindArrowHead(long arrowId); + %Rename(FindArrowHeadId, wxArrowHead *, FindArrowHead(long arrowId)); wxArrowHead * FindArrowHead(int position, const wxString& name); void FindLineEndPoints(double *OUTPUT, double *OUTPUT, double *OUTPUT, double *OUTPUT); @@ -193,7 +193,27 @@ public: %extend { PyObject* GetLineControlPoints() { wxList* list = self->GetLineControlPoints(); - return wxPy_ConvertShapeList(list); + return wxPy_ConvertRealPointList(list); + } + + // part of Patch# 893337 + void SetLineControlPoints(PyObject* list) { + wxList* real_point_list = wxPy_wxRealPoint_ListHelper(list); + self->MakeLineControlPoints((int)(real_point_list->GetCount())); + wxList* old_control_points = self->GetLineControlPoints(); + wxNode* old_node = old_control_points->GetFirst(); + wxNode* real_node = real_point_list->GetFirst(); + while(old_node) + { + wxRealPoint* old_point = (wxRealPoint*)old_node->GetData(); + wxRealPoint* new_point = (wxRealPoint*)real_node->GetData(); + old_point->x = new_point->x; + old_point->y = new_point->y; + old_node = old_node->GetNext(); + real_node = real_node->GetNext(); + } + self->ClearPointList(*real_point_list); + delete real_point_list; } } @@ -209,6 +229,13 @@ public: void Unlink(); + void SetAlignmentOrientation(bool isEnd, bool isHoriz); + void SetAlignmentType(bool isEnd, int alignType); + bool GetAlignmentOrientation(bool isEnd); + int GetAlignmentType(bool isEnd); + int GetAlignmentStart() const; + int GetAlignmentEnd() const; + void base_OnDraw(wxDC& dc); void base_OnDrawContents(wxDC& dc); void base_OnDrawBranches(wxDC& dc, bool erase = FALSE); @@ -220,8 +247,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); @@ -231,7 +258,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); @@ -247,7 +274,7 @@ public: class wxPyPolygonShape : public wxPyShape { public: - %addtofunc wxPyPolygonShape "self._setOORandCallbackInfo(PyPolygonShape)" + %pythonAppend wxPyPolygonShape "self._setOORandCallbackInfo(PyPolygonShape)" wxPyPolygonShape(); @@ -275,12 +302,17 @@ public: %extend { PyObject* GetPoints() { wxList* list = self->GetPoints(); + return wxPy_ConvertRealPointList(list); + } + + PyObject* GetOriginalPoints() { + wxList* list = self->GetOriginalPoints(); PyObject* pyList; PyObject* pyObj; wxObject* wxObj; wxNode* node = list->GetFirst(); - wxPyBeginBlockThreads(); + wxPyBlock_t blocked = wxPyBeginBlockThreads(); pyList = PyList_New(0); while (node) { wxObj = node->GetData(); @@ -288,11 +320,17 @@ public: PyList_Append(pyList, pyObj); node = node->GetNext(); } - wxPyEndBlockThreads(); + wxPyEndBlockThreads(blocked); return pyList; - } + } } + double GetOriginalWidth() const; + double GetOriginalHeight() const; + + void SetOriginalWidth(double w); + void SetOriginalHeight(double h); + void UpdateOriginalPoints(); void base_OnDraw(wxDC& dc); @@ -306,8 +344,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); @@ -317,7 +355,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); @@ -332,7 +370,7 @@ public: class wxPyTextShape : public wxPyRectangleShape { public: - %addtofunc wxPyTextShape "self._setOORandCallbackInfo(PyTextShape)" + %pythonAppend wxPyTextShape "self._setOORandCallbackInfo(PyTextShape)" wxPyTextShape(double width = 0.0, double height = 0.0); @@ -350,8 +388,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); @@ -361,7 +399,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);