1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|
Description: Use unpatched version of SWIG to generate Python wrappers
Author: Olly Betts <olly@survex.com>
Forwarded: no
Last-Update: 2013-10-15
--- wxwidgets2.9-2.9.5.0+dfsg2.orig/wxPython/src/_defs.i
+++ wxwidgets2.9-2.9.5.0+dfsg2/wxPython/src/_defs.i
@@ -33,7 +33,7 @@
// For all items that don't have a %rename already, give them a %rename that
// removes the leading 'wx' (except for wxEVT_* items.)
-%rename("%(wxpy)s") "";
+%rename("%(regex/^wx(?!EVT)//)s") "";
// For now, just supress the warning about using Python keywords as parameter
// names. Will need to come back later and correct these rather than just
diff --git a/wxPython/config.py b/wxPython/config.py
index 4fbd83f..56e6b1d 100644
--- a/wxPython/config.py
+++ b/wxPython/config.py
@@ -1221,7 +1221,7 @@ swig_args += i_files_includes
if USE_SWIG:
SVER = swig_version()
- if int(SVER[-2:]) >= 29:
+ if SVER >= '2' or int(SVER[-2:]) >= 29:
swig_args += [ '-fastdispatch',
'-fvirtual',
'-fastinit',
diff --git a/wxPython/pyfragments.swg b/wxPython/pyfragments.swg
new file mode 100644
index 0000000..f3e3edb
--- /dev/null
+++ b/wxPython/pyfragments.swg
@@ -0,0 +1,3 @@
+// Change the exception message used for TypeErrors to make a little more
+// sense.
+#define %argfail_fmt(_type,_name,_argn) "in method '" `_name` "', expected argument " `_argn`" of type '" `_type`"'"
diff --git a/wxPython/src/_core_api.i b/wxPython/src/_core_api.i
index d773ce1..9cdd441 100644
--- a/wxPython/src/_core_api.i
+++ b/wxPython/src/_core_api.i
@@ -82,7 +82,7 @@ PyObject* wxPyConstructObject(void* ptr,
swig_type_info* swigType = wxPyFindSwigType(className);
wxCHECK_MSG(swigType != NULL, NULL, wxT("Unknown type in wxPyConstructObject"));
- return SWIG_Python_NewPointerObj(ptr, swigType, setThisOwn);
+ return SWIG_NewPointerObj(ptr, swigType, setThisOwn);
}
@@ -125,7 +125,7 @@ PyObject* wxPyMakeSwigPtr(void* ptr, const wxString& className) {
}
%}
-#else // SWIG_VERSION >= 1.3.28
+#elif SWIG_VERSION < 0x010337 // SWIG_VERSION >= 1.3.28 and < 1.3.37
%{
// Make a SWIGified pointer object suitable for a .this attribute
PyObject* wxPyMakeSwigPtr(void* ptr, const wxString& className) {
@@ -139,6 +139,20 @@ PyObject* wxPyMakeSwigPtr(void* ptr, const wxString& className) {
return robj;
}
%}
+#else // SWIG_VERSION >= 1.3.37
+%{
+// Make a SWIGified pointer object suitable for a .this attribute
+PyObject* wxPyMakeSwigPtr(void* ptr, const wxString& className) {
+
+ PyObject* robj = NULL;
+
+ swig_type_info* swigType = wxPyFindSwigType(className);
+ wxCHECK_MSG(swigType != NULL, NULL, wxT("Unknown type in wxPyMakeSwigPtr"));
+
+ robj = SwigPyObject_New(ptr, swigType, 0);
+ return robj;
+}
+%}
#endif
@@ -161,7 +175,11 @@ bool wxPySwigInstance_Check(PyObject* obj) {
PyObject* this_attr = PyObject_GetAttr(obj, this_str);
if (this_attr) {
+#if SWIG_VERSION < 0x010337
bool retval = (PySwigObject_Check(this_attr) != 0);
+#else
+ bool retval = (SwigPyObject_Check(this_attr) != 0);
+#endif
Py_DECREF(this_attr);
return retval;
}
diff --git a/wxPython/src/_icon.i b/wxPython/src/_icon.i
index 963f8d1..f4d7704 100644
--- a/wxPython/src/_icon.i
+++ b/wxPython/src/_icon.i
@@ -204,7 +204,7 @@ are replaced", "",
DocDeclStr(
- const wxIcon& , GetIcon( const wxSize& size, int flags = wxIconBundle::FALLBACK_SYSTEM ) const,
+ wxIcon , GetIcon( const wxSize& size, int flags = wxIconBundle::FALLBACK_SYSTEM ) const,
"Returns the icon with the given size; if no such icon exists, returns
the icon with size wxSYS_ICON_[XY]; if no such icon exists, returns
the first icon in the bundle", "");
|