]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/contrib/glcanvas/gtk/glcanvas.cpp
In GetPath(), don't append separator if there's already one at the end
[wxWidgets.git] / wxPython / contrib / glcanvas / gtk / glcanvas.cpp
index a03a8a72b7d0f9b89f6073ef53349d2810b3e9d8..b0410dfdb566b4b2c12712a2f4957628f15c0709 100644 (file)
 #      define SWIGEXPORT(a) __declspec(dllexport) a
 #   else
 #      if defined(__BORLANDC__)
 #      define SWIGEXPORT(a) __declspec(dllexport) a
 #   else
 #      if defined(__BORLANDC__)
-#          define SWIGEXPORT(a) a _export 
+#          define SWIGEXPORT(a) a _export
 #      else
 #      else
-#          define SWIGEXPORT(a) a 
+#          define SWIGEXPORT(a) a
 #      endif
 #   endif
 #else
 #      endif
 #   endif
 #else
-#   define SWIGEXPORT(a) a 
+#   define SWIGEXPORT(a) a
 #endif
 
 #endif
 
+#include "Python.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 #ifdef __cplusplus
 extern "C" {
 #endif
-#include "Python.h"
+
 extern void SWIG_MakePtr(char *, void *, char *);
 extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
 extern char *SWIG_GetPtr(char *, void **, char *);
 extern void SWIG_MakePtr(char *, void *, char *);
 extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
 extern char *SWIG_GetPtr(char *, void **, char *);
@@ -61,57 +63,36 @@ extern PyObject *SWIG_newvarlink(void);
 #endif
 
 
 #endif
 
 
-static PyObject* l_output_helper(PyObject* target, PyObject* o) {
-    PyObject*   o2;
-    if (!target) {                   
-        target = o;
-    } else if (target == Py_None) {  
-        Py_DECREF(Py_None);
-        target = o;
-    } else {                         
-        if (!PyList_Check(target)) {
-            o2 = target;
-            target = PyList_New(0);
-            PyList_Append(target, o2);
-           Py_XDECREF(o2);
-        }
-        PyList_Append(target,o);
-       Py_XDECREF(o);
-    }
-    return target;
-}
 
 static PyObject* t_output_helper(PyObject* target, PyObject* o) {
     PyObject*   o2;
     PyObject*   o3;
 
 
 static PyObject* t_output_helper(PyObject* target, PyObject* o) {
     PyObject*   o2;
     PyObject*   o3;
 
-    if (!target) {                   
+    if (!target) {
         target = o;
         target = o;
-    } else if (target == Py_None) {  
+    } else if (target == Py_None) {
         Py_DECREF(Py_None);
         target = o;
         Py_DECREF(Py_None);
         target = o;
-    } else {                         
+    } else {
         if (!PyTuple_Check(target)) {
             o2 = target;
             target = PyTuple_New(1);
             PyTuple_SetItem(target, 0, o2);
         }
         if (!PyTuple_Check(target)) {
             o2 = target;
             target = PyTuple_New(1);
             PyTuple_SetItem(target, 0, o2);
         }
-        o3 = PyTuple_New(1);            
-        PyTuple_SetItem(o3, 0, o);      
+        o3 = PyTuple_New(1);
+        PyTuple_SetItem(o3, 0, o);
 
         o2 = target;
 
         o2 = target;
-        target = PySequence_Concat(o2, o3); 
-        Py_DECREF(o2);                      
+        target = PySequence_Concat(o2, o3);
+        Py_DECREF(o2);
         Py_DECREF(o3);
     }
     return target;
 }
 
         Py_DECREF(o3);
     }
     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
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -155,10 +136,11 @@ static PyObject *_wrap_new_wxGLContext(PyObject *self, PyObject *args, PyObject
         }
     }
 {
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (wxGLContext *)new_wxGLContext(_arg0,_arg1,*_arg2);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxGLContext *)new_wxGLContext(_arg0,_arg1,*_arg2);
 
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLContext_p");
         _resultobj = Py_BuildValue("s",_ptemp);
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLContext_p");
         _resultobj = Py_BuildValue("s",_ptemp);
@@ -187,10 +169,11 @@ static PyObject *_wrap_delete_wxGLContext(PyObject *self, PyObject *args, PyObje
         }
     }
 {
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        delete_wxGLContext(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    delete_wxGLContext(_arg0);
 
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
@@ -214,10 +197,11 @@ static PyObject *_wrap_wxGLContext_SetCurrent(PyObject *self, PyObject *args, Py
         }
     }
 {
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxGLContext_SetCurrent(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxGLContext_SetCurrent(_arg0);
 
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
@@ -242,10 +226,11 @@ static PyObject *_wrap_wxGLContext_SetColour(PyObject *self, PyObject *args, PyO
         }
     }
 {
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxGLContext_SetColour(_arg0,_arg1);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxGLContext_SetColour(_arg0,_arg1);
 
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
@@ -269,10 +254,11 @@ static PyObject *_wrap_wxGLContext_SwapBuffers(PyObject *self, PyObject *args, P
         }
     }
 {
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxGLContext_SwapBuffers(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxGLContext_SwapBuffers(_arg0);
 
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
@@ -296,10 +282,11 @@ static PyObject *_wrap_wxGLContext_SetupPixelFormat(PyObject *self, PyObject *ar
         }
     }
 {
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxGLContext_SetupPixelFormat(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxGLContext_SetupPixelFormat(_arg0);
 
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
@@ -332,10 +319,11 @@ static PyObject *_wrap_wxGLContext_SetupPalette(PyObject *self, PyObject *args,
         }
     }
 {
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxGLContext_SetupPalette(_arg0,*_arg1);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxGLContext_SetupPalette(_arg0,*_arg1);
 
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
@@ -361,10 +349,11 @@ static PyObject *_wrap_wxGLContext_CreateDefaultPalette(PyObject *self, PyObject
         }
     }
 {
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = new wxPalette (wxGLContext_CreateDefaultPalette(_arg0));
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = new wxPalette (wxGLContext_CreateDefaultPalette(_arg0));
 
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
 }    SWIG_MakePtr(_ptemp, (void *) _result,"_wxPalette_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }    SWIG_MakePtr(_ptemp, (void *) _result,"_wxPalette_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
@@ -390,10 +379,11 @@ static PyObject *_wrap_wxGLContext_GetPalette(PyObject *self, PyObject *args, Py
         }
     }
 {
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (wxPalette *)wxGLContext_GetPalette(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxPalette *)wxGLContext_GetPalette(_arg0);
 
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxPalette_p");
         _resultobj = Py_BuildValue("s",_ptemp);
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxPalette_p");
         _resultobj = Py_BuildValue("s",_ptemp);
@@ -423,30 +413,15 @@ static PyObject *_wrap_wxGLContext_GetWindow(PyObject *self, PyObject *args, PyO
         }
     }
 {
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (wxWindow *)wxGLContext_GetWindow(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxWindow *)wxGLContext_GetWindow(_arg0);
 
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
 }{ _resultobj = wxPyMake_wxObject(_result); }
     return _resultobj;
 }
 
 }{ _resultobj = wxPyMake_wxObject(_result); }
     return _resultobj;
 }
 
-static void *SwigwxGLCanvasTowxScrolledWindow(void *ptr) {
-    wxGLCanvas *src;
-    wxScrolledWindow *dest;
-    src = (wxGLCanvas *) ptr;
-    dest = (wxScrolledWindow *) src;
-    return (void *) dest;
-}
-
-static void *SwigwxGLCanvasTowxPanel(void *ptr) {
-    wxGLCanvas *src;
-    wxPanel *dest;
-    src = (wxGLCanvas *) ptr;
-    dest = (wxPanel *) src;
-    return (void *) dest;
-}
-
 static void *SwigwxGLCanvasTowxWindow(void *ptr) {
     wxGLCanvas *src;
     wxWindow *dest;
 static void *SwigwxGLCanvasTowxWindow(void *ptr) {
     wxGLCanvas *src;
     wxWindow *dest;
@@ -480,7 +455,7 @@ static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject *
     wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition;
     wxSize * _arg3 = (wxSize *) &wxDefaultSize;
     long  _arg4 = (long ) 0;
     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;
     int * _arg6 = (int *) NULL;
     wxPalette * _arg7 = (wxPalette *) &wxNullPalette;
     PyObject * _argo0 = 0;
@@ -488,6 +463,7 @@ static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject *
     PyObject * _obj2 = 0;
     wxSize  temp0;
     PyObject * _obj3 = 0;
     PyObject * _obj2 = 0;
     wxSize  temp0;
     PyObject * _obj3 = 0;
+    PyObject * _obj5 = 0;
     int * temp1;
     PyObject * _obj6 = 0;
     PyObject * _argo7 = 0;
     int * temp1;
     PyObject * _obj6 = 0;
     PyObject * _argo7 = 0;
@@ -495,7 +471,7 @@ static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject *
     char _ptemp[128];
 
     self = self;
     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; }
         return NULL;
     if (_argo0) {
         if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -515,6 +491,12 @@ static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject *
     _arg3 = &temp0;
     if (! wxSize_helper(_obj3, &_arg3))
         return NULL;
     _arg3 = &temp0;
     if (! wxSize_helper(_obj3, &_arg3))
         return NULL;
+}
+    if (_obj5)
+{
+    _arg5 = wxString_in_helper(_obj5);
+    if (_arg5 == NULL)
+        return NULL;
 }
     if (_obj6)
 {
 }
     if (_obj6)
 {
@@ -537,10 +519,11 @@ static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject *
         }
     }
 {
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (wxGLCanvas *)new_wxGLCanvas(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5,_arg6,*_arg7);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxGLCanvas *)new_wxGLCanvas(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,_arg6,*_arg7);
 
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
         _resultobj = Py_BuildValue("s",_ptemp);
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
         _resultobj = Py_BuildValue("s",_ptemp);
@@ -548,6 +531,10 @@ static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject *
         Py_INCREF(Py_None);
         _resultobj = Py_None;
     }
         Py_INCREF(Py_None);
         _resultobj = Py_None;
     }
+{
+    if (_obj5)
+        delete _arg5;
+}
 {
     delete [] _arg6;
 }
 {
     delete [] _arg6;
 }
@@ -564,7 +551,7 @@ static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args,
     wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition;
     wxSize * _arg4 = (wxSize *) &wxDefaultSize;
     long  _arg5 = (long ) 0;
     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;
     int * _arg7 = (int *) NULL;
     wxPalette * _arg8 = (wxPalette *) &wxNullPalette;
     PyObject * _argo0 = 0;
@@ -573,6 +560,7 @@ static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args,
     PyObject * _obj3 = 0;
     wxSize  temp0;
     PyObject * _obj4 = 0;
     PyObject * _obj3 = 0;
     wxSize  temp0;
     PyObject * _obj4 = 0;
+    PyObject * _obj6 = 0;
     int * temp1;
     PyObject * _obj7 = 0;
     PyObject * _argo8 = 0;
     int * temp1;
     PyObject * _obj7 = 0;
     PyObject * _argo8 = 0;
@@ -580,7 +568,7 @@ static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args,
     char _ptemp[128];
 
     self = self;
     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; }
         return NULL;
     if (_argo0) {
         if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -607,6 +595,12 @@ static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args,
     _arg4 = &temp0;
     if (! wxSize_helper(_obj4, &_arg4))
         return NULL;
     _arg4 = &temp0;
     if (! wxSize_helper(_obj4, &_arg4))
         return NULL;
+}
+    if (_obj6)
+{
+    _arg6 = wxString_in_helper(_obj6);
+    if (_arg6 == NULL)
+        return NULL;
 }
     if (_obj7)
 {
 }
     if (_obj7)
 {
@@ -629,10 +623,11 @@ static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args,
         }
     }
 {
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (wxGLCanvas *)new_wxGLCanvasWithContext(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6,_arg7,*_arg8);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxGLCanvas *)new_wxGLCanvasWithContext(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7,*_arg8);
 
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
         _resultobj = Py_BuildValue("s",_ptemp);
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
         _resultobj = Py_BuildValue("s",_ptemp);
@@ -640,6 +635,10 @@ static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args,
         Py_INCREF(Py_None);
         _resultobj = Py_None;
     }
         Py_INCREF(Py_None);
         _resultobj = Py_None;
     }
+{
+    if (_obj6)
+        delete _arg6;
+}
 {
     delete [] _arg7;
 }
 {
     delete [] _arg7;
 }
@@ -664,10 +663,11 @@ static PyObject *_wrap_wxGLCanvas_SetCurrent(PyObject *self, PyObject *args, PyO
         }
     }
 {
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxGLCanvas_SetCurrent(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxGLCanvas_SetCurrent(_arg0);
 
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
@@ -692,10 +692,11 @@ static PyObject *_wrap_wxGLCanvas_SetColour(PyObject *self, PyObject *args, PyOb
         }
     }
 {
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxGLCanvas_SetColour(_arg0,_arg1);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxGLCanvas_SetColour(_arg0,_arg1);
 
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
@@ -719,10 +720,11 @@ static PyObject *_wrap_wxGLCanvas_SwapBuffers(PyObject *self, PyObject *args, Py
         }
     }
 {
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxGLCanvas_SwapBuffers(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxGLCanvas_SwapBuffers(_arg0);
 
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
@@ -748,10 +750,11 @@ static PyObject *_wrap_wxGLCanvas_GetContext(PyObject *self, PyObject *args, PyO
         }
     }
 {
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (wxGLContext *)wxGLCanvas_GetContext(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxGLContext *)wxGLCanvas_GetContext(_arg0);
 
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLContext_p");
         _resultobj = Py_BuildValue("s",_ptemp);
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLContext_p");
         _resultobj = Py_BuildValue("s",_ptemp);
@@ -798,15 +801,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxPrintQuality","_EBool",0},
     { "_wxPrintQuality","_size_t",0},
     { "_wxPrintQuality","_time_t",0},
     { "_wxPrintQuality","_EBool",0},
     { "_wxPrintQuality","_size_t",0},
     { "_wxPrintQuality","_time_t",0},
-    { "_class_wxEvtHandler","_class_wxGLCanvas",SwigwxGLCanvasTowxEvtHandler},
-    { "_class_wxEvtHandler","_wxGLCanvas",SwigwxGLCanvasTowxEvtHandler},
     { "_byte","_unsigned_char",0},
     { "_long","_unsigned_long",0},
     { "_long","_signed_long",0},
     { "_byte","_unsigned_char",0},
     { "_long","_unsigned_long",0},
     { "_long","_signed_long",0},
-    { "_class_wxObject","_class_wxGLCanvas",SwigwxGLCanvasTowxObject},
-    { "_class_wxObject","_wxGLCanvas",SwigwxGLCanvasTowxObject},
-    { "_class_wxObject","_class_wxGLContext",SwigwxGLContextTowxObject},
-    { "_class_wxObject","_wxGLContext",SwigwxGLContextTowxObject},
     { "_size_t","_wxCoord",0},
     { "_size_t","_wxPrintQuality",0},
     { "_size_t","_time_t",0},
     { "_size_t","_wxCoord",0},
     { "_size_t","_wxPrintQuality",0},
     { "_size_t","_time_t",0},
@@ -814,8 +811,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_size_t","_int",0},
     { "_size_t","_wxWindowID",0},
     { "_size_t","_uint",0},
     { "_size_t","_int",0},
     { "_size_t","_wxWindowID",0},
     { "_size_t","_uint",0},
-    { "_wxPanel","_class_wxGLCanvas",SwigwxGLCanvasTowxPanel},
-    { "_wxPanel","_wxGLCanvas",SwigwxGLCanvasTowxPanel},
     { "_uint","_wxCoord",0},
     { "_uint","_wxPrintQuality",0},
     { "_uint","_time_t",0},
     { "_uint","_wxCoord",0},
     { "_uint","_wxPrintQuality",0},
     { "_uint","_time_t",0},
@@ -833,8 +828,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_EBool","_wxWindowID",0},
     { "_unsigned_long","_long",0},
     { "_wxNativeFontInfo","_struct_wxNativeFontInfo",0},
     { "_EBool","_wxWindowID",0},
     { "_unsigned_long","_long",0},
     { "_wxNativeFontInfo","_struct_wxNativeFontInfo",0},
-    { "_class_wxPanel","_class_wxGLCanvas",SwigwxGLCanvasTowxPanel},
-    { "_class_wxPanel","_wxGLCanvas",SwigwxGLCanvasTowxPanel},
     { "_signed_int","_wxCoord",0},
     { "_signed_int","_wxPrintQuality",0},
     { "_signed_int","_EBool",0},
     { "_signed_int","_wxCoord",0},
     { "_signed_int","_wxPrintQuality",0},
     { "_signed_int","_EBool",0},
@@ -847,16 +840,10 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_unsigned_short","_wxDateTime_t",0},
     { "_unsigned_short","_WXTYPE",0},
     { "_unsigned_short","_short",0},
     { "_unsigned_short","_wxDateTime_t",0},
     { "_unsigned_short","_WXTYPE",0},
     { "_unsigned_short","_short",0},
-    { "_class_wxWindow","_class_wxGLCanvas",SwigwxGLCanvasTowxWindow},
-    { "_class_wxWindow","_wxGLCanvas",SwigwxGLCanvasTowxWindow},
-    { "_wxObject","_class_wxGLCanvas",SwigwxGLCanvasTowxObject},
     { "_wxObject","_wxGLCanvas",SwigwxGLCanvasTowxObject},
     { "_wxObject","_wxGLCanvas",SwigwxGLCanvasTowxObject},
-    { "_wxObject","_class_wxGLContext",SwigwxGLContextTowxObject},
     { "_wxObject","_wxGLContext",SwigwxGLContextTowxObject},
     { "_signed_short","_WXTYPE",0},
     { "_signed_short","_short",0},
     { "_wxObject","_wxGLContext",SwigwxGLContextTowxObject},
     { "_signed_short","_WXTYPE",0},
     { "_signed_short","_short",0},
-    { "_wxScrolledWindow","_class_wxGLCanvas",SwigwxGLCanvasTowxScrolledWindow},
-    { "_wxScrolledWindow","_wxGLCanvas",SwigwxGLCanvasTowxScrolledWindow},
     { "_unsigned_char","_byte",0},
     { "_unsigned_int","_wxCoord",0},
     { "_unsigned_int","_wxPrintQuality",0},
     { "_unsigned_char","_byte",0},
     { "_unsigned_int","_wxCoord",0},
     { "_unsigned_int","_wxPrintQuality",0},
@@ -906,11 +893,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxCoord","_size_t",0},
     { "_wxCoord","_time_t",0},
     { "_wxCoord","_wxPrintQuality",0},
     { "_wxCoord","_size_t",0},
     { "_wxCoord","_time_t",0},
     { "_wxCoord","_wxPrintQuality",0},
-    { "_wxEvtHandler","_class_wxGLCanvas",SwigwxGLCanvasTowxEvtHandler},
     { "_wxEvtHandler","_wxGLCanvas",SwigwxGLCanvasTowxEvtHandler},
     { "_wxEvtHandler","_wxGLCanvas",SwigwxGLCanvasTowxEvtHandler},
-    { "_class_wxScrolledWindow","_class_wxGLCanvas",SwigwxGLCanvasTowxScrolledWindow},
-    { "_class_wxScrolledWindow","_wxGLCanvas",SwigwxGLCanvasTowxScrolledWindow},
-    { "_wxWindow","_class_wxGLCanvas",SwigwxGLCanvasTowxWindow},
     { "_wxWindow","_wxGLCanvas",SwigwxGLCanvasTowxWindow},
 {0,0,0}};
 
     { "_wxWindow","_wxGLCanvas",SwigwxGLCanvasTowxWindow},
 {0,0,0}};
 
@@ -923,6 +906,22 @@ SWIGEXPORT(void) initglcanvasc() {
         SWIG_globals = SWIG_newvarlink();
         m = Py_InitModule("glcanvasc", glcanvascMethods);
         d = PyModule_GetDict(m);
         SWIG_globals = SWIG_newvarlink();
         m = Py_InitModule("glcanvasc", glcanvascMethods);
         d = PyModule_GetDict(m);
+        PyDict_SetItemString(d,"WX_GL_RGBA", PyInt_FromLong((long) WX_GL_RGBA));
+        PyDict_SetItemString(d,"WX_GL_BUFFER_SIZE", PyInt_FromLong((long) WX_GL_BUFFER_SIZE));
+        PyDict_SetItemString(d,"WX_GL_LEVEL", PyInt_FromLong((long) WX_GL_LEVEL));
+        PyDict_SetItemString(d,"WX_GL_DOUBLEBUFFER", PyInt_FromLong((long) WX_GL_DOUBLEBUFFER));
+        PyDict_SetItemString(d,"WX_GL_STEREO", PyInt_FromLong((long) WX_GL_STEREO));
+        PyDict_SetItemString(d,"WX_GL_AUX_BUFFERS", PyInt_FromLong((long) WX_GL_AUX_BUFFERS));
+        PyDict_SetItemString(d,"WX_GL_MIN_RED", PyInt_FromLong((long) WX_GL_MIN_RED));
+        PyDict_SetItemString(d,"WX_GL_MIN_GREEN", PyInt_FromLong((long) WX_GL_MIN_GREEN));
+        PyDict_SetItemString(d,"WX_GL_MIN_BLUE", PyInt_FromLong((long) WX_GL_MIN_BLUE));
+        PyDict_SetItemString(d,"WX_GL_MIN_ALPHA", PyInt_FromLong((long) WX_GL_MIN_ALPHA));
+        PyDict_SetItemString(d,"WX_GL_DEPTH_SIZE", PyInt_FromLong((long) WX_GL_DEPTH_SIZE));
+        PyDict_SetItemString(d,"WX_GL_STENCIL_SIZE", PyInt_FromLong((long) WX_GL_STENCIL_SIZE));
+        PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_RED", PyInt_FromLong((long) WX_GL_MIN_ACCUM_RED));
+        PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_GREEN", PyInt_FromLong((long) WX_GL_MIN_ACCUM_GREEN));
+        PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_BLUE", PyInt_FromLong((long) WX_GL_MIN_ACCUM_BLUE));
+        PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_ALPHA", PyInt_FromLong((long) WX_GL_MIN_ACCUM_ALPHA));
 
 
     wxClassInfo::CleanUpClasses();
 
 
     wxClassInfo::CleanUpClasses();