diff --git a/contrib/include/wx/stc/stc.h b/contrib/include/wx/stc/stc.h
index b4e6266ed7..10519a61b7 100644
--- a/contrib/include/wx/stc/stc.h
+++ b/contrib/include/wx/stc/stc.h
@@ -1456,7 +1456,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = wxPySTCNameStr);
- %name(PreStyledTextCtrl) wxStyledTextCtrl();
+ %RenameCtor(PreStyledTextCtrl, wxStyledTextCtrl());
#else
wxStyledTextCtrl(wxWindow *parent, wxWindowID id=wxID_ANY,
diff --git a/contrib/src/stc/stc.h.in b/contrib/src/stc/stc.h.in
index fe3f32e90f..6fd444087a 100644
--- a/contrib/src/stc/stc.h.in
+++ b/contrib/src/stc/stc.h.in
@@ -90,7 +90,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = wxPySTCNameStr);
- %%name(PreStyledTextCtrl) wxStyledTextCtrl();
+ %%RenameCtor(PreStyledTextCtrl, wxStyledTextCtrl());
#else
wxStyledTextCtrl(wxWindow *parent, wxWindowID id=wxID_ANY,
diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h
index b4e6266ed7..10519a61b7 100644
--- a/include/wx/stc/stc.h
+++ b/include/wx/stc/stc.h
@@ -1456,7 +1456,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = wxPySTCNameStr);
- %name(PreStyledTextCtrl) wxStyledTextCtrl();
+ %RenameCtor(PreStyledTextCtrl, wxStyledTextCtrl());
#else
wxStyledTextCtrl(wxWindow *parent, wxWindowID id=wxID_ANY,
diff --git a/src/stc/stc.h.in b/src/stc/stc.h.in
index fe3f32e90f..6fd444087a 100644
--- a/src/stc/stc.h.in
+++ b/src/stc/stc.h.in
@@ -90,7 +90,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = wxPySTCNameStr);
- %%name(PreStyledTextCtrl) wxStyledTextCtrl();
+ %%RenameCtor(PreStyledTextCtrl, wxStyledTextCtrl());
#else
wxStyledTextCtrl(wxWindow *parent, wxWindowID id=wxID_ANY,
diff --git a/wxPython/SWIG/README.txt b/wxPython/SWIG/README.txt
index 72f8ee8417..b5a4a4bf5c 100644
--- a/wxPython/SWIG/README.txt
+++ b/wxPython/SWIG/README.txt
@@ -1,5 +1,5 @@
-SWIG 1.3 Patches
-================
+SWIG 1.3.x Patches
+==================
This directory holds a set of patches for the CVS version of SWIG that
are required if you wish to use SWIG for wxPython development, or for
@@ -8,13 +8,42 @@ wxPython. These have been submitted to SWIG's SourceForge patch
tracker, so hopefully they will get incorporated into the main SWIG
source tree soon.
-wxPython currently uses the 1.3.22 version of SWIG, which you can get
-from https://sourceforge.net/projects/swig/, plus the patches in this
+wxPython currently uses the 1.3.24 version of SWIG, which you can get
+from https://sourceforge.net/projects/swig/, plus the patch(es) in this
directory. Download the SWIG sources, apply the patch(es) here and
-then build as normal.
+then build as normal. If you want to use both the patched version of
+SWIG and the stock version, then you can configure the patched version
+to use a different --prefix and then specify that executable when
+running setup.py, like this:
+
+ python setup.py SWIG=/path/to/my/swig [other params]
+
+
+------------------------------------------------------------------------
+
+swig-1.3.24.patch
+
+ A bug was introduced in SWIG 1.3.23 and remains in 1.3.24 that
+ causes compilation problems with wxPython (copies are being made
+ of objects that don't have a copy constructor.) This patch fixes
+ the code generator to use a reference to the object instead of
+ making a copy.
+
+ Part of my autodoc patch was disabled becuase a unit-test failed.
+ I was not able to duplicate the failure so I re-enabled that
+ section of code in this patch.
+
+ Don't generate the autodocs string for a class if it has a
+ docstring attribute.
+
+ Some typos fixed, etc.
+
+------------------------------------------------------------------------
+This patch was added to SWIG's CVS on 10/2/2004 and a modified version
+of it is in 1.3.23 and 1.3.24.
------------------------------------------------------------------------
diff --git a/wxPython/SWIG/swig-1.3.24.patch b/wxPython/SWIG/swig-1.3.24.patch
new file mode 100644
index 0000000000..9ece48450e
--- /dev/null
+++ b/wxPython/SWIG/swig-1.3.24.patch
@@ -0,0 +1,182 @@
+? .configure
+? .emacs.desktop
+? .test
+? mytests
+? switch_cvs.py
+? Source/Modules/mystuff
+Index: Doc/Manual/Python.html
+===================================================================
+RCS file: /cvsroot/swig/SWIG/Doc/Manual/Python.html,v
+retrieving revision 1.20
+diff -u -4 -r1.20 Python.html
+--- Doc/Manual/Python.html 25 Oct 2004 20:42:08 -0000 1.20
++++ Doc/Manual/Python.html 23 Dec 2004 20:14:06 -0000
+@@ -3869,10 +3869,10 @@
+
+
26.10 Docstring Features
+
+
+-Usign docstrings in Python code is becoming more and more important
+-ans more tools are coming on the scene that take advantage of them,
++Using docstrings in Python code is becoming more and more important
++and more tools are coming on the scene that take advantage of them,
+ everything from full-blown documentaiton generators to class browsers
+ and popup call-tips in Python-aware IDEs. Given the way that SWIG
+ generates the proxy code by default, your users will normally get
+ something like "function_name(*args)" in the popup calltip of
+Index: Source/Modules/python.cxx
+===================================================================
+RCS file: /cvsroot/swig/SWIG/Source/Modules/python.cxx,v
+retrieving revision 1.81
+diff -u -4 -r1.81 python.cxx
+--- Source/Modules/python.cxx 13 Dec 2004 22:12:47 -0000 1.81
++++ Source/Modules/python.cxx 23 Dec 2004 20:14:07 -0000
+@@ -74,9 +74,9 @@
+ -modern - Use modern python features only, without compatibility code\n\
+ -apply - Use apply() in proxy classes\n\
+ -new_vwm - New value wrapper mode, use only when everything else fails \n\
+ -new_repr - Use more informative version of __repr__ in proxy classes\n\
+- -old_repr - Use shorter ald old version of __repr__ in proxy classes\n\
++ -old_repr - Use shorter and old version of __repr__ in proxy classes\n\
+ -noexcept - No automatic exception handling\n\
+ -noh - Don't generate the output header file\n\
+ -noproxy - Don't generate proxy classes \n\n";
+
+@@ -749,10 +749,15 @@
+
+ // Do the param type too?
+ if (showTypes) {
+ type = SwigType_base(type);
+- lookup = Swig_symbol_clookup(type, 0);
+- if (lookup) type = Getattr(lookup, "sym:name");
++ SwigType* qt = SwigType_typedef_resolve_all(type);
++ if (SwigType_isenum(qt))
++ type = NewString("int");
++ else {
++ lookup = Swig_symbol_clookup(type, 0);
++ if (lookup) type = Getattr(lookup, "sym:name");
++ }
+ Printf(doc, "%s ", type);
+ }
+
+ if (name) {
+@@ -853,13 +858,19 @@
+ }
+
+ switch ( ad_type ) {
+ case AUTODOC_CLASS:
+- if (CPlusPlus) {
+- Printf(doc, "Proxy of C++ %s class", class_name);
+- } else {
+- Printf(doc, "Proxy of C %s struct", class_name);
+- }
++ {
++ // Only do the autodoc if there isn't a docstring for the class
++ String* str = Getattr(n, "feature:docstring");
++ if (str == NULL || Len(str) == 0) {
++ if (CPlusPlus) {
++ Printf(doc, "Proxy of C++ %s class", class_name);
++ } else {
++ Printf(doc, "Proxy of C %s struct", class_name);
++ }
++ }
++ }
+ break;
+ case AUTODOC_CTOR:
+ if ( Strcmp(class_name, symname) == 0) {
+ String* paramList = make_autodocParmList(n, showTypes);
+@@ -1027,10 +1038,12 @@
+ Printf(methods,"\t { (char *)\"%s\", (PyCFunction) %s, METH_VARARGS | METH_KEYWORDS, ", name, function);
+
+ if (n && Getattr(n,"feature:callback")) {
+ if (have_docstring(n)) {
++ String* ds = docstring(n, AUTODOC_FUNC, "", false);
++ Replaceall(ds, "\n", "\\n");
+ Printf(methods,"(char *)\"%s\\nswig_ptr: %s\"",
+- docstring(n, AUTODOC_FUNC, "", false),
++ ds,
+ Getattr(n,"feature:callback:name"));
+ } else {
+ Printf(methods,"(char *)\"swig_ptr: %s\"",Getattr(n,"feature:callback:name"));
+ }
+@@ -1950,11 +1963,13 @@
+ Printf(f_shadow, modern ? "(object)" : "(_object)");
+ }
+ }
+ Printf(f_shadow,":\n");
+- if ( have_docstring(n) )
+- Printv(f_shadow, tab4, docstring(n, AUTODOC_CLASS, tab4), "\n", NIL);
+-
++ if ( have_docstring(n) ) {
++ String* str = docstring(n, AUTODOC_CLASS, tab4);
++ if (str != NULL && Len(str))
++ Printv(f_shadow, tab4, str, "\n", NIL);
++ }
+ if (!modern) {
+ Printv(f_shadow,tab4,"__swig_setmethods__ = {}\n",NIL);
+ if (Len(base_class)) {
+ Printf(f_shadow,"%sfor _s in [%s]: __swig_setmethods__.update(_s.__swig_setmethods__)\n",tab4,base_class);
+@@ -2139,11 +2154,11 @@
+ Replaceall(pycode,"$action", pyaction);
+ Delete(pyaction);
+ Printv(f_shadow,pycode,"\n",NIL);
+ } else {
+- Printv(f_shadow, tab4, "def ", symname, "(*args", (allow_kwargs ? ", **kwargs" : ""), "): ", NIL);
++ Printv(f_shadow, tab4, "def ", symname, "(*args", (allow_kwargs ? ", **kwargs" : ""), "):", NIL);
+ if (!have_addtofunc(n)) {
+- Printv(f_shadow, "return ", funcCallHelper(Swig_name_member(class_name,symname), allow_kwargs), "\n", NIL);
++ Printv(f_shadow, " return ", funcCallHelper(Swig_name_member(class_name,symname), allow_kwargs), "\n", NIL);
+ } else {
+ Printv(f_shadow, "\n", NIL);
+ if ( have_docstring(n) )
+ Printv(f_shadow, tab8, docstring(n, AUTODOC_METHOD, tab8), "\n", NIL);
+@@ -2175,12 +2190,9 @@
+ return SWIG_OK;
+ }
+
+ if (shadow) {
+- //
+- // static + autodoc/prepend/append + def args not working!!!, disable by now
+- //
+- if (0 && !classic && !Getattr(n,"feature:python:callback") && have_addtofunc(n)) {
++ if ( !classic && !Getattr(n,"feature:python:callback") && have_addtofunc(n)) {
+ int kw = (check_kwargs(n) && !Getattr(n,"sym:overloaded")) ? 1 : 0;
+ Printv(f_shadow, tab4, "def ", symname, "(*args", (kw ? ", **kwargs" : ""), "):\n", NIL);
+ if ( have_docstring(n) )
+ Printv(f_shadow, tab8, docstring(n, AUTODOC_STATICFUNC, tab8), "\n", NIL);
+Index: Source/Swig/cwrap.c
+===================================================================
+RCS file: /cvsroot/swig/SWIG/Source/Swig/cwrap.c,v
+retrieving revision 1.51
+diff -u -4 -r1.51 cwrap.c
+--- Source/Swig/cwrap.c 4 Dec 2004 08:33:02 -0000 1.51
++++ Source/Swig/cwrap.c 23 Dec 2004 20:14:07 -0000
+@@ -172,17 +172,26 @@
+ tycode = SwigType_type(type);
+ if (tycode == T_REFERENCE) {
+ if (pvalue) {
+ SwigType *tvalue;
+- String *defname, *defvalue, *rvalue;
++ String *defname, *defvalue, *rvalue, *qvalue;
+ rvalue = SwigType_typedef_resolve_all(pvalue);
++ qvalue = SwigType_typedef_qualified(rvalue);
+ defname = NewStringf("%s_defvalue", lname);
+ tvalue = Copy(type);
+ SwigType_del_reference(tvalue);
+- defvalue = NewStringf("%s = %s", SwigType_lstr(tvalue,defname), rvalue);
++ tycode = SwigType_type(tvalue);
++ if (tycode != T_USER) {
++ /* plain primitive type, we copy the the def value */
++ defvalue = NewStringf("%s = %s", SwigType_lstr(tvalue,defname),qvalue);
++ } else {
++ /* user type, we copy the reference value */
++ defvalue = NewStringf("%s = %s",SwigType_str(type,defname),qvalue);
++ }
+ Wrapper_add_localv(w,defname, defvalue, NIL);
+ Delete(tvalue);
+ Delete(rvalue);
++ Delete(qvalue);
+ Delete(defname);
+ Delete(defvalue);
+ }
+ } else if (!pvalue && ((tycode == T_POINTER) || (tycode == T_STRING))) {
diff --git a/wxPython/SWIG/swig.python-2.patch b/wxPython/SWIG/swig.python-2.patch
deleted file mode 100644
index 5ff6aacaef..0000000000
--- a/wxPython/SWIG/swig.python-2.patch
+++ /dev/null
@@ -1,891 +0,0 @@
-Index: Doc/Manual/Python.html
-===================================================================
-RCS file: /cvsroot/swig/SWIG/Doc/Manual/Python.html,v
-retrieving revision 1.18
-diff -u -4 -r1.18 Python.html
---- Doc/Manual/Python.html 2 Sep 2004 20:27:14 -0000 1.18
-+++ Doc/Manual/Python.html 23 Sep 2004 00:31:44 -0000
-@@ -86,8 +86,15 @@
- Mapping Python tuples into small arrays
- Mapping sequences to C arrays
- Pointer handling
-
-+Docstring Features
-+
-+Python Packages
-
-
-
-
-@@ -2460,9 +2467,8 @@
- customization features as covered in later sections.
-
- 26.6.2 Adding additional Python code
-
--
- If writing support code in C isn't enough, it is also possible to write code in
- Python. This code gets inserted in to the .py file created by SWIG. One
- use of Python code might be to supply a high-level interface to certain functions.
- For example:
-@@ -2506,8 +2512,46 @@
- soon enough. For now, think of this example as an illustration of
- what can be done without having to rely on any of the more advanced
- customization features.
-
-+Sometimes you may want to replace or modify the wrapper function
-+that SWIG creates in the proxy .py file. The Python module
-+in SWIG provides some features that enable you do do this. First, to
-+entirely replace a proxy function you can use
-+%feature("shadow"). For example:
-+
-+
-+
-+%module example
-+%rename(bar_id) bar(int,double);
-+
-+// Rewrite bar() to allow some nice overloading
-+
-+%feature("shadow") Foo::bar(int) %{
-+def bar(*args):
-+ if len(args) == 3:
-+ return apply(examplec.Foo_bar_id,args)
-+ return apply(examplec.Foo_bar,args)
-+%}
-+
-+class Foo {
-+public:
-+ int bar(int x);
-+ int bar(int x, double y);
-+}
-+
-+
-+
-+
-+Often the proxy function created by SWIG is fine, but you simply want
-+to add code to it without touching the rest of the generated function
-+body. For these cases SWIG provides the "pythonprepend" and
-+"pythonappend" features which do exactly as their names suggest. The
-+"pythonprepend" feature will insert its value at the begining of the
-+proxy function, and "pythonappend" will insert code at the end of the
-+proxy, just before the return statement.
-+
-+
- 26.6.3 Class extension with %extend
-
-
- One of the more interesting features of SWIG is that it can extend
-@@ -3852,6 +3896,197 @@
- that has a this attribute. In addition,
- SWIG_NewPointerObj() can automatically generate a proxy
- class object (if applicable).
-
-+
-+
-+26.10 Docstring Features
-+
-+Usign docstrings in Python code is becoming more and more important
-+ans more tools are coming on the scene that take advantage of them,
-+everything from full-blown documentaiton generators to class browsers
-+and popup call-tips in Python-aware IDEs. Given the way that SWIG
-+generates the proxy code by default, your users will normally get
-+something like "function_name(*args)" in the popup calltip of
-+their IDE which is next to useless when the real function prototype
-+might be something like this:
-+
-+
-+
-+bool function_name(int x, int y, Foo* foo=NULL, Bar* bar=NULL);
-+
-+
-+
-+The features described in this section make it easy for you to add
-+docstrings to your modules, functions and methods that can then be
-+used by the various tools out there to make the programming experience
-+of your users much simpler.
-+
-+
-+26.10.1 Module docstring
-+
-+Python allows a docstring at the begining of the .py file
-+before any other statements, and it is typically used to give a
-+general description of the entire module. SWIG supports this by
-+setting an option of the %module directive. For example:
-+
-+
-+
-+%module(docstring="This is the example module's docstring") example
-+
-+
-+
-+When you have more than just a line or so then you can retain the easy
-+readability of the %module directive by using a macro. For
-+example:
-+
-+
-+
-+%define DOCSTRING
-+"The `XmlResource` class allows program resources defining menus,
-+layout of controls on a panel, etc. to be loaded from an XML file."
-+%enddef
-+
-+%module(docstring=DOCSTRING) xrc
-+
-+
-+
-+
-+26.10.2 %feature("autodoc")
-+
-+As alluded to above SWIG will generate all the function and method
-+proxy wrappers with just "*args" (or "*args, **kwargs" if the -keyword
-+option is used) for a parameter list and will then sort out the
-+individual parameters in the C wrapper code. This is nice and simple
-+for the wrapper code, but makes it difficult to be programmer and tool
-+friendly as anyone looking at the .py file will not be able
-+to find out anything about the parameters that the fuctions accept.
-+
-+But since SWIG does know everything about the fucntion it is
-+possible to generate a docstring containing the parameter types, names
-+and default values. Since many of the doctring tools are adopting a
-+standard of recognizing if the first thing in the docstring is a
-+function prototype then using that instead of what they found from
-+introspeciton, then life is good once more.
-+
-+
SWIG's Python module provides support for the "autodoc" feature,
-+which when attached to a node in the parse tree will cause a docstring
-+to be generated that includes the name of the funciton, parameter
-+names, default values if any, and return type if any. There are also
-+three options for autodoc controlled by the value given to the
-+feature, described below.
-+
-+
%feature("autodoc", "0")
-+
-+When the "0" option is given then the types of the parameters will
-+not be included in the autodoc string. For example, given
-+this function prototype:
-+
-+
-+
-+%feature("autodoc", "0");
-+bool function_name(int x, int y, Foo* foo=NULL, Bar* bar=NULL);
-+
-+
-+
-+Then Python code like this will be generated:
-+
-+
-+
-+def function_name(*args, **kwargs):
-+ """function_name(x, y, foo=None, bar=None) -> bool"""
-+ ...
-+
-+
-+
-+
-+%feature("autodoc", "1")
-+
-+When the "1" option is used then the parameter types will be
-+used in the autodoc string. In addition, an atempt is made to
-+simplify the type name such that it makes more sense to the Python
-+user. Pointer, reference and const info is removed,
-+%rename's are evaluated, etc. (This is not always
-+successful, but works most of the time. See the next section for what
-+to do when it doesn't.) Given the example above, then turning on the
-+parameter types with the "1" option will result in Python code like
-+this:
-+
-+
-+
-+def function_name(*args, **kwargs):
-+ """function_name(int x, int y, Foo foo=None, Bar bar=None) -> bool"""
-+ ...
-+
-+
-+
-+
-+
-+%feature("autodoc", "docstring")
-+
-+Finally, there are times when the automatically generated autodoc
-+string will make no sense for a Python programmer, particularly when a
-+typemap is involved. So if you give an explicit value for the autodoc
-+feature then that string will be used in place of the automatically
-+generated string. For example:
-+
-+
-+
-+%feature("autodoc", "GetPosition() -> (x, y)") GetPosition;
-+void GetPosition(int* OUTPUT, int* OUTPUT);
-+
-+
-+
-+
-+26.10.3 %feature("docstring")
-+
-+In addition to the autodoc strings described above, you can also
-+attach any arbitrary descriptive text to a node in the parse tree with
-+the "docstring" feature. When the proxy module is generated then any
-+docstring associated with classes, function or methods are output.
-+If an item already has an autodoc string then it is combined with the
-+docstring and they are output together. If the docstring is all on a
-+single line then it is output like this::
-+
-+
-+
-+"""This is the docstring"""
-+
-+
-+
-+Otherwise, to aid readability it is output like this:
-+
-+
-+
-+"""
-+This is a multi-line docstring
-+with more than one line.
-+"""
-+
-+
-+
-+26.11 Python Packages
-+
-+Using the package option of the %module directive
-+allows you to specify what Python package that the module will be
-+living in when installed.
-+
-+
-+
-+%module(package="wx") xrc
-+
-+
-+
-+This is useful when the .i file is %imported by
-+another .i file. By default SWIG will assume that the
-+importer is able to find the importee with just the module name, but
-+if they live in separate Python packages then that won't work.
-+However if the importee specifies what its package is with the
-+%module option then the Python code generated for the
-+importer will use that package name when importing the other module
-+and also in base class declarations, etc. if the pacakge name is
-+different than its own.
-+
-+
-+
-