X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a95a71334ccdc0377a515e1a23529930e7d86ac9..28bed70aa9162c430ed20e9d8d9983b2dd63cf10:/wxPython/contrib/ogl/mac/ogl_wrap.cpp diff --git a/wxPython/contrib/ogl/mac/ogl_wrap.cpp b/wxPython/contrib/ogl/mac/ogl_wrap.cpp index 3e3e4fcfaa..363436c147 100644 --- a/wxPython/contrib/ogl/mac/ogl_wrap.cpp +++ b/wxPython/contrib/ogl/mac/ogl_wrap.cpp @@ -584,7 +584,25 @@ void wxPyLineShape_AddArrowOrdered(wxPyLineShape *self,wxArrowHead *arrow,PyObje } PyObject *wxPyLineShape_GetLineControlPoints(wxPyLineShape *self){ wxList* list = self->GetLineControlPoints(); - return wxPy_ConvertShapeList(list); + return wxPy_ConvertRealPointList(list); + } +void wxPyLineShape_SetLineControlPoints(wxPyLineShape *self,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; } WXSHAPE_IMP_CALLBACKS(wxPyPolygonShape, wxPolygonShape); @@ -600,21 +618,7 @@ PyObject *wxPyPolygonShape_Create(wxPyPolygonShape *self,PyObject *points){ } PyObject *wxPyPolygonShape_GetPoints(wxPyPolygonShape *self){ wxList* list = self->GetPoints(); - PyObject* pyList; - PyObject* pyObj; - wxObject* wxObj; - wxNode* node = list->GetFirst(); - - bool blocked = wxPyBeginBlockThreads(); - pyList = PyList_New(0); - while (node) { - wxObj = node->GetData(); - pyObj = wxPyConstructObject(wxObj, wxT("wxRealPoint"), 0); - PyList_Append(pyList, pyObj); - node = node->GetNext(); - } - wxPyEndBlockThreads(blocked); - return pyList; + return wxPy_ConvertRealPointList(list); } PyObject *wxPyPolygonShape_GetOriginalPoints(wxPyPolygonShape *self){ wxList* list = self->GetOriginalPoints(); @@ -760,6 +764,27 @@ PyObject* wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source) { //--------------------------------------------------------------------------- +PyObject* wxPy_ConvertRealPointList(wxListBase* listbase) { + wxList* list = (wxList*)listbase; + PyObject* pyList; + PyObject* pyObj; + wxObject* wxObj; + wxNode* node = list->GetFirst(); + + bool blocked = wxPyBeginBlockThreads(); + pyList = PyList_New(0); + while (node) { + wxObj = node->GetData(); + pyObj = wxPyConstructObject(wxObj, wxT("wxRealPoint"), 0); + PyList_Append(pyList, pyObj); + node = node->GetNext(); + } + wxPyEndBlockThreads(blocked); + return pyList; +} + +//--------------------------------------------------------------------------- + PyObject* wxPy_ConvertShapeList(wxListBase* listbase) { wxList* list = (wxList*)listbase; PyObject* pyList; @@ -10227,18 +10252,17 @@ static PyObject *_wrap_PseudoMetaFile_DrawLines(PyObject *self, PyObject *args, wxPoint *arg3 = (wxPoint *) 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "PCOUNT",(char *) "points", NULL + (char *) "self",(char *) "points", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:PseudoMetaFile_DrawLines",kwnames,&obj0,&obj1,&obj2)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:PseudoMetaFile_DrawLines",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxPseudoMetaFile, SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; - arg2 = (int) SWIG_AsInt(obj1); - if (PyErr_Occurred()) SWIG_fail; - if ((SWIG_ConvertPtr(obj2,(void **)(&arg3),SWIGTYPE_p_wxPoint, - SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + arg3 = wxPoint_LIST_helper(obj1, &arg2); + if (arg3 == NULL) SWIG_fail; + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); (arg1)->DrawLines(arg2,arg3); @@ -10247,8 +10271,14 @@ static PyObject *_wrap_PseudoMetaFile_DrawLines(PyObject *self, PyObject *args, if (PyErr_Occurred()) SWIG_fail; } Py_INCREF(Py_None); resultobj = Py_None; + { + if (arg3) delete [] arg3; + } return resultobj; fail: + { + if (arg3) delete [] arg3; + } return NULL; } @@ -10262,20 +10292,19 @@ static PyObject *_wrap_PseudoMetaFile_DrawPolygon(PyObject *self, PyObject *args PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "PCOUNT",(char *) "points",(char *) "flags", NULL + (char *) "self",(char *) "points",(char *) "flags", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|O:PseudoMetaFile_DrawPolygon",kwnames,&obj0,&obj1,&obj2,&obj3)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|O:PseudoMetaFile_DrawPolygon",kwnames,&obj0,&obj1,&obj2)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxPseudoMetaFile, SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; - arg2 = (int) SWIG_AsInt(obj1); - if (PyErr_Occurred()) SWIG_fail; - if ((SWIG_ConvertPtr(obj2,(void **)(&arg3),SWIGTYPE_p_wxPoint, - SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; - if (obj3) { - arg4 = (int) SWIG_AsInt(obj3); + { + arg3 = wxPoint_LIST_helper(obj1, &arg2); + if (arg3 == NULL) SWIG_fail; + } + if (obj2) { + arg4 = (int) SWIG_AsInt(obj2); if (PyErr_Occurred()) SWIG_fail; } { @@ -10286,8 +10315,14 @@ static PyObject *_wrap_PseudoMetaFile_DrawPolygon(PyObject *self, PyObject *args if (PyErr_Occurred()) SWIG_fail; } Py_INCREF(Py_None); resultobj = Py_None; + { + if (arg3) delete [] arg3; + } return resultobj; fail: + { + if (arg3) delete [] arg3; + } return NULL; } @@ -10299,18 +10334,17 @@ static PyObject *_wrap_PseudoMetaFile_DrawSpline(PyObject *self, PyObject *args, wxPoint *arg3 = (wxPoint *) 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "PCOUNT",(char *) "points", NULL + (char *) "self",(char *) "points", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:PseudoMetaFile_DrawSpline",kwnames,&obj0,&obj1,&obj2)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:PseudoMetaFile_DrawSpline",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxPseudoMetaFile, SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; - arg2 = (int) SWIG_AsInt(obj1); - if (PyErr_Occurred()) SWIG_fail; - if ((SWIG_ConvertPtr(obj2,(void **)(&arg3),SWIGTYPE_p_wxPoint, - SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + arg3 = wxPoint_LIST_helper(obj1, &arg2); + if (arg3 == NULL) SWIG_fail; + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); (arg1)->DrawSpline(arg2,arg3); @@ -10319,8 +10353,14 @@ static PyObject *_wrap_PseudoMetaFile_DrawSpline(PyObject *self, PyObject *args, if (PyErr_Occurred()) SWIG_fail; } Py_INCREF(Py_None); resultobj = Py_None; + { + if (arg3) delete [] arg3; + } return resultobj; fail: + { + if (arg3) delete [] arg3; + } return NULL; } @@ -14961,18 +15001,17 @@ static PyObject *_wrap_PyDrawnShape_DrawLines(PyObject *self, PyObject *args, Py wxPoint *arg3 = (wxPoint *) 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "PCOUNT",(char *) "points", NULL + (char *) "self",(char *) "points", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:PyDrawnShape_DrawLines",kwnames,&obj0,&obj1,&obj2)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:PyDrawnShape_DrawLines",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxPyDrawnShape, SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; - arg2 = (int) SWIG_AsInt(obj1); - if (PyErr_Occurred()) SWIG_fail; - if ((SWIG_ConvertPtr(obj2,(void **)(&arg3),SWIGTYPE_p_wxPoint, - SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + arg3 = wxPoint_LIST_helper(obj1, &arg2); + if (arg3 == NULL) SWIG_fail; + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); (arg1)->DrawLines(arg2,arg3); @@ -14981,8 +15020,14 @@ static PyObject *_wrap_PyDrawnShape_DrawLines(PyObject *self, PyObject *args, Py if (PyErr_Occurred()) SWIG_fail; } Py_INCREF(Py_None); resultobj = Py_None; + { + if (arg3) delete [] arg3; + } return resultobj; fail: + { + if (arg3) delete [] arg3; + } return NULL; } @@ -15028,20 +15073,19 @@ static PyObject *_wrap_PyDrawnShape_DrawPolygon(PyObject *self, PyObject *args, PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "PCOUNT",(char *) "points",(char *) "flags", NULL + (char *) "self",(char *) "points",(char *) "flags", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|O:PyDrawnShape_DrawPolygon",kwnames,&obj0,&obj1,&obj2,&obj3)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|O:PyDrawnShape_DrawPolygon",kwnames,&obj0,&obj1,&obj2)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxPyDrawnShape, SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; - arg2 = (int) SWIG_AsInt(obj1); - if (PyErr_Occurred()) SWIG_fail; - if ((SWIG_ConvertPtr(obj2,(void **)(&arg3),SWIGTYPE_p_wxPoint, - SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; - if (obj3) { - arg4 = (int) SWIG_AsInt(obj3); + { + arg3 = wxPoint_LIST_helper(obj1, &arg2); + if (arg3 == NULL) SWIG_fail; + } + if (obj2) { + arg4 = (int) SWIG_AsInt(obj2); if (PyErr_Occurred()) SWIG_fail; } { @@ -15052,8 +15096,14 @@ static PyObject *_wrap_PyDrawnShape_DrawPolygon(PyObject *self, PyObject *args, if (PyErr_Occurred()) SWIG_fail; } Py_INCREF(Py_None); resultobj = Py_None; + { + if (arg3) delete [] arg3; + } return resultobj; fail: + { + if (arg3) delete [] arg3; + } return NULL; } @@ -15133,18 +15183,17 @@ static PyObject *_wrap_PyDrawnShape_DrawSpline(PyObject *self, PyObject *args, P wxPoint *arg3 = (wxPoint *) 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "PCOUNT",(char *) "points", NULL + (char *) "self",(char *) "points", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:PyDrawnShape_DrawSpline",kwnames,&obj0,&obj1,&obj2)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:PyDrawnShape_DrawSpline",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxPyDrawnShape, SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; - arg2 = (int) SWIG_AsInt(obj1); - if (PyErr_Occurred()) SWIG_fail; - if ((SWIG_ConvertPtr(obj2,(void **)(&arg3),SWIGTYPE_p_wxPoint, - SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + arg3 = wxPoint_LIST_helper(obj1, &arg2); + if (arg3 == NULL) SWIG_fail; + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); (arg1)->DrawSpline(arg2,arg3); @@ -15153,8 +15202,14 @@ static PyObject *_wrap_PyDrawnShape_DrawSpline(PyObject *self, PyObject *args, P if (PyErr_Occurred()) SWIG_fail; } Py_INCREF(Py_None); resultobj = Py_None; + { + if (arg3) delete [] arg3; + } return resultobj; fail: + { + if (arg3) delete [] arg3; + } return NULL; } @@ -26383,6 +26438,34 @@ static PyObject *_wrap_PyLineShape_GetLineControlPoints(PyObject *self, PyObject } +static PyObject *_wrap_PyLineShape_SetLineControlPoints(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxPyLineShape *arg1 = (wxPyLineShape *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "list", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:PyLineShape_SetLineControlPoints",kwnames,&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxPyLineShape, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + arg2 = obj1; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxPyLineShape_SetLineControlPoints(arg1,arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + static PyObject *_wrap_PyLineShape_SetAttachmentFrom(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxPyLineShape *arg1 = (wxPyLineShape *) 0 ; @@ -33192,6 +33275,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"PyLineShape_IsSpline", (PyCFunction) _wrap_PyLineShape_IsSpline, METH_VARARGS | METH_KEYWORDS }, { (char *)"PyLineShape_MakeLineControlPoints", (PyCFunction) _wrap_PyLineShape_MakeLineControlPoints, METH_VARARGS | METH_KEYWORDS }, { (char *)"PyLineShape_GetLineControlPoints", (PyCFunction) _wrap_PyLineShape_GetLineControlPoints, METH_VARARGS | METH_KEYWORDS }, + { (char *)"PyLineShape_SetLineControlPoints", (PyCFunction) _wrap_PyLineShape_SetLineControlPoints, METH_VARARGS | METH_KEYWORDS }, { (char *)"PyLineShape_SetAttachmentFrom", (PyCFunction) _wrap_PyLineShape_SetAttachmentFrom, METH_VARARGS | METH_KEYWORDS }, { (char *)"PyLineShape_SetAttachments", (PyCFunction) _wrap_PyLineShape_SetAttachments, METH_VARARGS | METH_KEYWORDS }, { (char *)"PyLineShape_SetAttachmentTo", (PyCFunction) _wrap_PyLineShape_SetAttachmentTo, METH_VARARGS | METH_KEYWORDS },