X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/54f9ee450905e98296e6afd1376b3d1e06a1e00f..42f8298f6f42d5d63bb3caf65682b7d9d9f8b702:/wxPython/contrib/ogl/ogl.i diff --git a/wxPython/contrib/ogl/ogl.i b/wxPython/contrib/ogl/ogl.i index b7cb72c772..3dc1464e04 100644 --- a/wxPython/contrib/ogl/ogl.i +++ b/wxPython/contrib/ogl/ogl.i @@ -10,8 +10,12 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// +%define DOCSTRING +"The Object Graphics Library provides for simple drawing and manipulation +of 2D objects. (This version is deprecated, please use wx.lib.ogl instead.)" +%enddef -%module ogl +%module(package="wx", docstring=DOCSTRING) ogl %{ #include "wx/wxPython/wxPython.h" @@ -24,7 +28,13 @@ %import windows.i %pythoncode { wx = _core } -%pythoncode { __docfilter__ = wx.__docfilter__ } +%pythoncode { __docfilter__ = wx.__DocFilter(globals()) } + +%pythoncode { + import warnings + warnings.warn("This module is deprecated. Please use the wx.lib.ogl package instead.", + DeprecationWarning, stacklevel=2) +} MAKE_CONST_WXSTRING_NOSWIG(EmptyString); @@ -147,7 +157,10 @@ enum { //--------------------------------------------------------------------------- +MustHaveApp(wxOGLInitialize); void wxOGLInitialize(); + +MustHaveApp(wxOGLCleanUp); void wxOGLCleanUp(); @@ -232,7 +245,7 @@ wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList) { //--------------------------------------------------------------------------- -PyObject* wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source) { +PyObject* wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source, bool setThisOwn) { PyObject* target = NULL; if (source && wxIsKindOf(source, wxShapeEvtHandler)) { @@ -247,7 +260,7 @@ PyObject* wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source) { } } if (! target) { - target = wxPyMake_wxObject2(source, FALSE); + target = wxPyMake_wxObject2(source, setThisOwn, false); if (target != Py_None) ((wxShapeEvtHandler*)source)->SetClientObject(new wxPyOORClientData(target)); } @@ -256,6 +269,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; @@ -267,7 +301,7 @@ PyObject* wxPy_ConvertShapeList(wxListBase* listbase) { pyList = PyList_New(0); while (node) { wxObj = node->GetData(); - pyObj = wxPyMake_wxShapeEvtHandler((wxShapeEvtHandler*)wxObj); + pyObj = wxPyMake_wxShapeEvtHandler((wxShapeEvtHandler*)wxObj, false); PyList_Append(pyList, pyObj); node = node->GetNext(); }