]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/contrib/ogl/ogl.i
Another package name fix
[wxWidgets.git] / wxPython / contrib / ogl / ogl.i
index f821f35b9c9548ab241f5a4ee929219b14aed357..45e7595d0a8f582f89879ce6b574a214b1d71c89 100644 (file)
 // 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"
 %pythoncode { wx = _core }
 %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);
 
-%include _ogl_rename.i
+MAKE_CONST_WXSTRING_NOSWIG(EmptyString);
 
 %include _ogldefs.i
 %include _oglbasic.i
@@ -147,7 +155,10 @@ enum {
 
 //---------------------------------------------------------------------------
 
+MustHaveApp(wxOGLInitialize);
 void wxOGLInitialize();
+
+MustHaveApp(wxOGLCleanUp);
 void wxOGLCleanUp();
 
 
@@ -158,7 +169,7 @@ void wxOGLCleanUp();
 // work for any class for the VERY generic cases, but beyond that the helper
 // needs to know more about the type.
 wxList* wxPy_wxListHelper(PyObject* pyList, const wxChar* className) {
-    bool blocked = wxPyBeginBlockThreads();
+    wxPyBlock_t blocked = wxPyBeginBlockThreads();
     if (!PyList_Check(pyList)) {
         PyErr_SetString(PyExc_TypeError, "Expected a list object.");
         wxPyEndBlockThreads(blocked);
@@ -191,7 +202,7 @@ wxList* wxPy_wxListHelper(PyObject* pyList, const wxChar* className) {
 //---------------------------------------------------------------------------
 
 wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList) {
-    bool blocked = wxPyBeginBlockThreads();
+    wxPyBlock_t blocked = wxPyBeginBlockThreads();
     if (!PyList_Check(pyList)) {
         PyErr_SetString(PyExc_TypeError, "Expected a list object.");
         wxPyEndBlockThreads(blocked);
@@ -232,7 +243,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 +258,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,22 +267,23 @@ PyObject*  wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source) {
 
 //---------------------------------------------------------------------------
 
-PyObject* wxPy_ConvertRealPointList(wxListBase* list) {
-      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_ConvertRealPointList(wxListBase* listbase) {
+    wxList*     list = (wxList*)listbase;
+    PyObject*   pyList;
+    PyObject*   pyObj;
+    wxObject*   wxObj;
+    wxNode*     node = list->GetFirst();
+    
+    wxPyBlock_t 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;
 }
 
 //---------------------------------------------------------------------------
@@ -283,11 +295,11 @@ PyObject* wxPy_ConvertShapeList(wxListBase* listbase) {
     wxObject*   wxObj;
     wxNode*     node = list->GetFirst();
 
-    bool blocked = wxPyBeginBlockThreads();
+    wxPyBlock_t blocked = wxPyBeginBlockThreads();
     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();
     }