X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0e2ff151afc472efd2814c74add5ad4498709d33..f63e3ebbe3272b9690aa2530e0c3048d3f37c7c7:/wxPython/contrib/glcanvas/mac/glcanvas.cpp diff --git a/wxPython/contrib/glcanvas/mac/glcanvas.cpp b/wxPython/contrib/glcanvas/mac/glcanvas.cpp index 7d0a9ded49..45e3207d52 100644 --- a/wxPython/contrib/glcanvas/mac/glcanvas.cpp +++ b/wxPython/contrib/glcanvas/mac/glcanvas.cpp @@ -90,11 +90,9 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { return target; } -#if PYTHON_API_VERSION >= 1009 - static char* wxStringErrorMsg = "String or Unicode type required"; -#else - static char* wxStringErrorMsg = "String type required"; -#endif + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyGLCanvasNameStr(wxT("GLCanvas")); + static const wxString wxPyEmptyString(wxT("")); #ifdef __cplusplus extern "C" { #endif @@ -125,7 +123,7 @@ static PyObject *_wrap_delete_wxGLContext(PyObject *self, PyObject *args, PyObje } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - delete_wxGLContext(_arg0); + delete_wxGLContext(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -153,7 +151,7 @@ static PyObject *_wrap_wxGLContext_SetCurrent(PyObject *self, PyObject *args, Py } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxGLContext_SetCurrent(_arg0); + wxGLContext_SetCurrent(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -182,7 +180,7 @@ static PyObject *_wrap_wxGLContext_SetColour(PyObject *self, PyObject *args, PyO } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxGLContext_SetColour(_arg0,_arg1); + wxGLContext_SetColour(_arg0,_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -210,7 +208,7 @@ static PyObject *_wrap_wxGLContext_SwapBuffers(PyObject *self, PyObject *args, P } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxGLContext_SwapBuffers(_arg0); + wxGLContext_SwapBuffers(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -239,7 +237,7 @@ static PyObject *_wrap_wxGLContext_GetWindow(PyObject *self, PyObject *args, PyO } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxWindow *)wxGLContext_GetWindow(_arg0); + _result = (wxWindow *)wxGLContext_GetWindow(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -280,7 +278,7 @@ static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject * wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) 0; - char * _arg5 = (char *) "GLCanvas"; + wxString * _arg5 = (wxString *) &wxPyGLCanvasNameStr; int * _arg6 = (int *) NULL; wxPalette * _arg7 = (wxPalette *) &wxNullPalette; PyObject * _argo0 = 0; @@ -288,6 +286,7 @@ static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject * PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; + PyObject * _obj5 = 0; int * temp1; PyObject * _obj6 = 0; PyObject * _argo7 = 0; @@ -295,7 +294,7 @@ static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject * char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlsOO:new_wxGLCanvas",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5,&_obj6,&_argo7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlOOO:new_wxGLCanvas",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5,&_obj6,&_argo7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -315,6 +314,12 @@ static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject * _arg3 = &temp0; if (! wxSize_helper(_obj3, &_arg3)) return NULL; +} + if (_obj5) +{ + _arg5 = wxString_in_helper(_obj5); + if (_arg5 == NULL) + return NULL; } if (_obj6) { @@ -338,7 +343,7 @@ static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject * } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxGLCanvas *)new_wxGLCanvas(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5,_arg6,*_arg7); + _result = (wxGLCanvas *)new_wxGLCanvas(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -349,6 +354,10 @@ static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject * Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj5) + delete _arg5; +} { delete [] _arg6; } @@ -365,7 +374,7 @@ static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args, wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) 0; - char * _arg6 = (char *) "GLCanvas"; + wxString * _arg6 = (wxString *) &wxPyGLCanvasNameStr; int * _arg7 = (int *) NULL; wxPalette * _arg8 = (wxPalette *) &wxNullPalette; PyObject * _argo0 = 0; @@ -374,6 +383,7 @@ static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args, PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; int * temp1; PyObject * _obj7 = 0; PyObject * _argo8 = 0; @@ -381,7 +391,7 @@ static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args, char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OiOOlsOO:new_wxGLCanvasWithContext",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6,&_obj7,&_argo8)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OiOOlOOO:new_wxGLCanvasWithContext",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6,&_obj7,&_argo8)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -408,6 +418,12 @@ static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args, _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } if (_obj7) { @@ -431,7 +447,7 @@ static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args, } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxGLCanvas *)new_wxGLCanvasWithContext(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6,_arg7,*_arg8); + _result = (wxGLCanvas *)new_wxGLCanvasWithContext(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7,*_arg8); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -442,6 +458,10 @@ static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args, Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj6) + delete _arg6; +} { delete [] _arg7; } @@ -467,7 +487,7 @@ static PyObject *_wrap_wxGLCanvas_SetCurrent(PyObject *self, PyObject *args, PyO } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxGLCanvas_SetCurrent(_arg0); + wxGLCanvas_SetCurrent(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -496,7 +516,7 @@ static PyObject *_wrap_wxGLCanvas_SetColour(PyObject *self, PyObject *args, PyOb } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxGLCanvas_SetColour(_arg0,_arg1); + wxGLCanvas_SetColour(_arg0,_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -524,7 +544,7 @@ static PyObject *_wrap_wxGLCanvas_SwapBuffers(PyObject *self, PyObject *args, Py } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxGLCanvas_SwapBuffers(_arg0); + wxGLCanvas_SwapBuffers(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -554,7 +574,7 @@ static PyObject *_wrap_wxGLCanvas_GetContext(PyObject *self, PyObject *args, PyO } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxGLContext *)wxGLCanvas_GetContext(_arg0); + _result = (wxGLContext *)wxGLCanvas_GetContext(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL;