]> git.saurik.com Git - wxWidgets.git/commitdiff
Changes needed to be able to build with SWIG 1.3.24, 1.3.27 as well as
authorRobin Dunn <robin@alldunn.com>
Sun, 29 Jan 2006 02:33:00 +0000 (02:33 +0000)
committerRobin Dunn <robin@alldunn.com>
Sun, 29 Jan 2006 02:33:00 +0000 (02:33 +0000)
the upcoming 1.3.28, using #if statements on SWIG_VERSION.

Adjustments to ownership of SWIG objects, add some destructors and
explicitly disown non-window objects when their ownership is
transfered to a C++ object.

Since all window objects are owned by their parent, or by themselves,
always set their thisown attribute to False.

Explicitly set thisown to False after any Destroy() methods are
called, so SWIG doesn't try to destroy them again.

Etc.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37205 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/include/wx/wxPython/swigver.h [new file with mode: 0644]
wxPython/setup.py
wxPython/src/helpers.cpp

diff --git a/wxPython/include/wx/wxPython/swigver.h b/wxPython/include/wx/wxPython/swigver.h
new file mode 100644 (file)
index 0000000..bf90522
--- /dev/null
@@ -0,0 +1,3 @@
+// This file was generated by setup.py
+
+#define wxPy_SWIG_VERSION "SWIG-1.3.27"
index 52f77cf5b624f5b3d16e6969940e97cf7d325d52..d672a441966889431c0c7a3c056cc5548b30fd44 100755 (executable)
@@ -76,6 +76,32 @@ RELEASE_NUMBER = RELEASE_VERSION  # for compatibility
 CLEANUP.append('wx/__version__.py')
 
 
+#----------------------------------------------------------------------
+# Write the SWIG version to a header file
+#----------------------------------------------------------------------
+
+if USE_SWIG:
+    try:
+        # It may come on either stdout or stderr, depending on the
+        # version, so read both.
+        i, o, e = os.popen3(SWIG + ' -version', 't')
+        stext = o.read() + e.read()
+        import re
+        match = re.search(r'[0-9]+\.[0-9]+\.[0-9]+$', stext, re.MULTILINE)
+        if not match:
+            raise 'NotFound'
+        SVER = match.group(0)
+        open('include/wx/wxPython/swigver.h', 'w').write('''\
+// This file was generated by setup.py
+
+#define wxPy_SWIG_VERSION "SWIG-%s"
+''' % SVER)
+        msg('Using SWIG-' + SVER)
+
+    except:
+        msg('\nUnable to get SWIG version number\n')
+
+
 #----------------------------------------------------------------------
 # patch distutils if it can't cope with the "classifiers" or
 # "download_url" keywords 
index 13f89c15e60b565c1673d0dd0d1287f1282f0d13..d426e4d00753a26a3f6191eebd109835f8ac33ab 100644 (file)
@@ -15,6 +15,7 @@
 #include <Python.h>
 #include "wx/wxPython/wxPython_int.h"
 #include "wx/wxPython/pyistream.h"
+#include "wx/wxPython/swigver.h"
 
 #ifdef __WXMSW__
 #include <wx/msw/private.h>
@@ -29,8 +30,8 @@
 #include <gdk/gdkprivate.h>
 #include <wx/gtk/win_gtk.h>
 #define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \
-                              GDK_WINDOW_XWINDOW(GTK_PIZZA((wxwin)->m_wxwindow)->bin_window) : \
-                              GDK_WINDOW_XWINDOW((wxwin)->m_widget->window)
+                          GDK_WINDOW_XWINDOW(GTK_PIZZA((wxwin)->m_wxwindow)->bin_window) : \
+                          GDK_WINDOW_XWINDOW((wxwin)->m_widget->window)
 #include <locale.h>
 #endif
 
@@ -690,7 +691,8 @@ PyObject* __wxPySetDictionary(PyObject* /* self */, PyObject* args)
 #else
     _AddInfoString("wx-assertions-off");
 #endif
-
+    _AddInfoString(wxPy_SWIG_VERSION);    
+    
 #undef _AddInfoString
 
     PyObject* PlatInfoTuple = PyList_AsTuple(PlatInfo);