X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4acff284f9516e2a4f0fcfa7bcfa3f497b8005cc..084db46c8b4f3f8d5e6a5f55e09e04f5a680c8a5:/wxPython/contrib/ogl/ogl.cpp diff --git a/wxPython/contrib/ogl/ogl.cpp b/wxPython/contrib/ogl/ogl.cpp index 3c74a41f61..bf4df3b872 100644 --- a/wxPython/contrib/ogl/ogl.cpp +++ b/wxPython/contrib/ogl/ogl.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,7 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "oglc" -#include "export.h" +#include "wxPython.h" #include "oglhelpers.h" @@ -186,6 +185,26 @@ PyObject* wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source) { return target; } +//--------------------------------------------------------------------------- + +PyObject* wxPy_ConvertShapeList(wxListBase* listbase, const char* className) { + wxList* list = (wxList*)listbase; + PyObject* pyList; + PyObject* pyObj; + wxObject* wxObj; + wxNode* node = list->GetFirst(); + + wxPyBeginBlockThreads(); + pyList = PyList_New(0); + while (node) { + wxObj = node->GetData(); + pyObj = wxPyMake_wxShapeEvtHandler((wxShapeEvtHandler*)wxObj); + PyList_Append(pyList, pyObj); + node = node->GetNext(); + } + wxPyEndBlockThreads(); + return pyList; +} //---------------------------------------------------------------------------