X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/137b5242b1834999da2883c7a68fbde28c6fba37..71aba8333cc915afff9e740c944f7fa7247abacb:/wxPython/contrib/glcanvas/msw/glcanvas.cpp diff --git a/wxPython/contrib/glcanvas/msw/glcanvas.cpp b/wxPython/contrib/glcanvas/msw/glcanvas.cpp index c103574fff..47b3d9c3b0 100644 --- a/wxPython/contrib/glcanvas/msw/glcanvas.cpp +++ b/wxPython/contrib/glcanvas/msw/glcanvas.cpp @@ -19,6 +19,8 @@ /* Implementation : PYTHON */ #define SWIGPYTHON +#include "Python.h" + #include #include /* Definitions for Windows/Unix exporting */ @@ -36,12 +38,9 @@ # define SWIGEXPORT(a) a #endif -#include "Python.h" - #ifdef __cplusplus extern "C" { #endif - extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -55,7 +54,12 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "glcanvasc" -#include "export.h" +#include "wxPython.h" + +#ifdef __WXMAC__ // avoid a bug in Carbon headers +#define scalb scalbn +#endif + #ifdef __WXMSW__ #include "myglcanvas.h" #else @@ -129,8 +133,7 @@ static PyObject *_wrap_new_wxGLContext(PyObject *self, PyObject *args, PyObject } } if (_argo2) { - if (_argo2 == Py_None) { _arg2 = NULL; } - else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxPalette_p")) { + if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxPalette_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of new_wxGLContext. Expected _wxPalette_p."); return NULL; } @@ -211,12 +214,13 @@ static PyObject *_wrap_wxGLContext_SetCurrent(PyObject *self, PyObject *args, Py static PyObject *_wrap_wxGLContext_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxGLContext * _arg0; - char * _arg1; + wxString * _arg1; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxGLContext_SetColour",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLContext_SetColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -225,14 +229,23 @@ static PyObject *_wrap_wxGLContext_SetColour(PyObject *self, PyObject *args, PyO return NULL; } } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxGLContext_SetColour(_arg0,_arg1); + wxGLContext_SetColour(_arg0,*_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} return _resultobj; } @@ -382,8 +395,7 @@ static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject * } } if (_argo7) { - if (_argo7 == Py_None) { _arg7 = NULL; } - else if (SWIG_GetPtrObj(_argo7,(void **) &_arg7,"_wxPalette_p")) { + if (SWIG_GetPtrObj(_argo7,(void **) &_arg7,"_wxPalette_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 8 of new_wxGLCanvas. Expected _wxPalette_p."); return NULL; } @@ -486,8 +498,7 @@ static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args, } } if (_argo8) { - if (_argo8 == Py_None) { _arg8 = NULL; } - else if (SWIG_GetPtrObj(_argo8,(void **) &_arg8,"_wxPalette_p")) { + if (SWIG_GetPtrObj(_argo8,(void **) &_arg8,"_wxPalette_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 9 of new_wxGLCanvasWithContext. Expected _wxPalette_p."); return NULL; } @@ -547,12 +558,13 @@ static PyObject *_wrap_wxGLCanvas_SetCurrent(PyObject *self, PyObject *args, PyO static PyObject *_wrap_wxGLCanvas_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxGLCanvas * _arg0; - char * _arg1; + wxString * _arg1; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxGLCanvas_SetColour",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLCanvas_SetColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -561,14 +573,23 @@ static PyObject *_wrap_wxGLCanvas_SetColour(PyObject *self, PyObject *args, PyOb return NULL; } } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxGLCanvas_SetColour(_arg0,_arg1); + wxGLCanvas_SetColour(_arg0,*_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} return _resultobj; } @@ -702,8 +723,7 @@ static PyObject *_wrap_wxGLCanvas_SetupPalette(PyObject *self, PyObject *args, P } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPalette_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPalette_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxGLCanvas_SetupPalette. Expected _wxPalette_p."); return NULL; } @@ -943,9 +963,6 @@ SWIGEXPORT(void) initglcanvasc() { PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_ALPHA", PyInt_FromLong((long) WX_GL_MIN_ACCUM_ALPHA)); - wxClassInfo::CleanUpClasses(); - wxClassInfo::InitializeClasses(); - { int i; for (i = 0; _swig_mapping[i].n1; i++)