]> git.saurik.com Git - wxWidgets.git/blame - wxPython/SWIG/swig-1.3.27.patch
Add Get/SetBitmapHover
[wxWidgets.git] / wxPython / SWIG / swig-1.3.27.patch
CommitLineData
2f810297
RD
1Index: Doc/Manual/Python.html
2===================================================================
3RCS file: /cvsroot/swig/SWIG/Doc/Manual/Python.html,v
4retrieving revision 1.31
5diff -u -4 -r1.31 Python.html
6--- Doc/Manual/Python.html 6 Oct 2005 21:49:58 -0000 1.31
dd400cf4 7+++ Doc/Manual/Python.html 29 Jan 2006 02:05:55 -0000
2f810297
RD
8@@ -4461,10 +4461,10 @@
9 <H2><a name="Python_nn65"></a>26.10 Docstring Features</H2>
10
11
12 <p>
13-Usign docstrings in Python code is becoming more and more important
14-ans more tools are coming on the scene that take advantage of them,
15+Using docstrings in Python code is becoming more and more important
16+and more tools are coming on the scene that take advantage of them,
17 everything from full-blown documentaiton generators to class browsers
18 and popup call-tips in Python-aware IDEs. Given the way that SWIG
19 generates the proxy code by default, your users will normally get
20 something like <tt>"function_name(*args)"</tt> in the popup calltip of
21Index: Lib/swig.swg
22===================================================================
23RCS file: /cvsroot/swig/SWIG/Lib/swig.swg,v
24retrieving revision 1.49
25diff -u -4 -r1.49 swig.swg
26--- Lib/swig.swg 15 Oct 2005 00:15:30 -0000 1.49
dd400cf4 27+++ Lib/swig.swg 29 Jan 2006 02:05:55 -0000
2f810297
RD
28@@ -51,9 +51,9 @@
29
30 #define %nodefault %feature("nodefault","1")
31 #define %default %feature("nodefault","0")
32 #define %clearnodefault %feature("nodefault","")
33-#define %makedefault %cleardefault
34+#define %makedefault %clearnodefault
35
36 /* the %exception directive */
37
38 #ifdef SWIGCSHARP
39Index: Lib/swiginit.swg
40===================================================================
41RCS file: /cvsroot/swig/SWIG/Lib/swiginit.swg,v
42retrieving revision 1.5
43diff -u -4 -r1.5 swiginit.swg
44--- Lib/swiginit.swg 12 Sep 2005 23:25:03 -0000 1.5
dd400cf4 45+++ Lib/swiginit.swg 29 Jan 2006 02:05:55 -0000
2f810297
RD
46@@ -40,14 +40,19 @@
47 **/
48
49 #ifdef __cplusplus
50 extern "C" {
51+#if 0
52+} /* c-mode */
53+#endif
54+#endif
55+
56+#if 0
57+#define SWIGRUNTIME_DEBUG
58 #endif
59
60 SWIGRUNTIME void
61 SWIG_InitializeModule(void *clientdata) {
62- swig_type_info *type, *ret;
63- swig_cast_info *cast;
64 size_t i;
65 swig_module_info *module_head;
66 static int init_run = 0;
67
68@@ -71,18 +76,35 @@
69 SWIG_SetModule(clientdata, &swig_module);
70 }
71
72 /* Now work on filling in swig_module.types */
73+#ifdef SWIGRUNTIME_DEBUG
74+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
75+#endif
76 for (i = 0; i < swig_module.size; ++i) {
77- type = 0;
78+ swig_type_info *type = 0;
79+ swig_type_info *ret;
80+ swig_cast_info *cast;
81+
82+#ifdef SWIGRUNTIME_DEBUG
83+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
84+#endif
85
86 /* if there is another module already loaded */
87 if (swig_module.next != &swig_module) {
88 type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
89 }
90 if (type) {
91 /* Overwrite clientdata field */
92- if (swig_module.type_initial[i]->clientdata) type->clientdata = swig_module.type_initial[i]->clientdata;
93+#ifdef SWIGRUNTIME_DEBUG
94+ printf("SWIG_InitializeModule: found type %s\n", type->name);
95+#endif
96+ if (swig_module.type_initial[i]->clientdata) {
97+ type->clientdata = swig_module.type_initial[i]->clientdata;
98+#ifdef SWIGRUNTIME_DEBUG
99+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
100+#endif
101+ }
102 } else {
103 type = swig_module.type_initial[i];
104 }
105
106@@ -91,31 +113,66 @@
107 while (cast->type) {
108
109 /* Don't need to add information already in the list */
110 ret = 0;
111+#ifdef SWIGRUNTIME_DEBUG
112+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
113+#endif
114 if (swig_module.next != &swig_module) {
115 ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
116+#ifdef SWIGRUNTIME_DEBUG
117+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
118+#endif
119 }
120- if (ret && type == swig_module.type_initial[i]) {
121- cast->type = ret;
122- ret = 0;
123+ if (ret) {
124+ if (type == swig_module.type_initial[i]) {
125+#ifdef SWIGRUNTIME_DEBUG
126+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
127+#endif
128+ cast->type = ret;
129+ ret = 0;
130+ } else {
131+ /* Check for casting already in the list */
132+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
133+#ifdef SWIGRUNTIME_DEBUG
134+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
135+#endif
136+ if (!ocast) ret = 0;
137+ }
138 }
139-
140+
141 if (!ret) {
142+#ifdef SWIGRUNTIME_DEBUG
143+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
144+#endif
145 if (type->cast) {
146 type->cast->prev = cast;
147 cast->next = type->cast;
148 }
149 type->cast = cast;
150 }
151-
152 cast++;
153 }
154-
155 /* Set entry in modules->types array equal to the type */
156 swig_module.types[i] = type;
157 }
158 swig_module.types[i] = 0;
159+
160+#ifdef SWIGRUNTIME_DEBUG
161+ printf("**** SWIG_InitializeModule: Cast List ******\n");
162+ for (i = 0; i < swig_module.size; ++i) {
163+ int j = 0;
164+ swig_cast_info *cast = swig_module.cast_initial[i];
165+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
166+ while (cast->type) {
167+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
168+ cast++;
169+ ++j;
170+ }
171+ printf("---- Total casts: %d\n",j);
172+ }
173+ printf("**** SWIG_InitializeModule: Cast List ******\n");
174+#endif
175 }
176
177 /* This function will propagate the clientdata field of type to
178 * any new swig_type_info structures that have been added into the list
179@@ -145,6 +202,9 @@
180 }
181 }
182
183 #ifdef __cplusplus
184+#if 0
185+{ /* c-mode */
186+#endif
187 }
188 #endif
189Index: Source/Modules/python.cxx
190===================================================================
191RCS file: /cvsroot/swig/SWIG/Source/Modules/python.cxx,v
192retrieving revision 1.107
193diff -u -4 -r1.107 python.cxx
194--- Source/Modules/python.cxx 7 Oct 2005 13:17:41 -0000 1.107
dd400cf4 195+++ Source/Modules/python.cxx 29 Jan 2006 02:05:56 -0000
2f810297
RD
196@@ -36,9 +36,8 @@
197 static File *f_directors_h = 0;
198 static File *f_init = 0;
199 static File *f_shadow_py = 0;
200 static String *f_shadow = 0;
201-static String *f_shadow_imports = 0;
202 static String *f_shadow_stubs = 0;
203
204 static String *methods;
205 static String *class_name;
dd400cf4
RD
206@@ -281,8 +280,20 @@
207 Swig_banner(f_runtime);
208
209 Printf(f_runtime,"#define SWIGPYTHON\n");
210
211+ String *package_version = NewString(PACKAGE_VERSION);
212+ char *token = strtok(Char(package_version), ".");
213+ String *vers = NewString("#define SWIG_VERSION 0x");
214+ while (token) {
215+ int len = strlen(token);
216+ Printf(vers, "%s%s", (len == 1) ? "0" : "", token);
217+ token = strtok(NULL, ".");
218+ }
219+ Printf(f_runtime, "%s\n", vers);
220+ Delete(package_version);
221+ Delete(vers);
222+
223 if (directorsEnabled()) {
224 Printf(f_runtime,"#define SWIG_DIRECTORS\n");
225 }
226
227@@ -322,9 +333,8 @@
2f810297
RD
228 }
229 Delete(filen); filen = NULL;
230
231 f_shadow = NewString("");
232- f_shadow_imports = NewString("");
233 f_shadow_stubs = NewString("");
234
235 Swig_register_filebyname("shadow",f_shadow);
236 Swig_register_filebyname("python",f_shadow);
dd400cf4 237@@ -343,8 +353,10 @@
2f810297
RD
238 if (mod_docstring && Len(mod_docstring)) {
239 Printv(f_shadow, "\n\"\"\"\n", mod_docstring, "\n\"\"\"\n", NIL);
240 Delete(mod_docstring); mod_docstring = NULL;
241 }
242+
243+ Printf(f_shadow,"\nimport %s\n\n", module);
244
245 /* if (!modern) */
246 /* always needed, a class can be forced to be no-modern, such as an exception */
247 {
dd400cf4 248@@ -445,10 +457,8 @@
2f810297
RD
249 Printf(f_wrappers,"}\n");
250 Printf(f_wrappers,"#endif\n");
251
252 if (shadow) {
253- Printf(f_shadow_imports,"\nimport %s\n", module);
254- Printv(f_shadow_py, f_shadow_imports, "\n",NIL);
255 Printv(f_shadow_py, f_shadow, "\n",NIL);
256 Printv(f_shadow_py, f_shadow_stubs, "\n",NIL);
257
258 Close(f_shadow_py);
dd400cf4 259@@ -507,12 +517,9 @@
2f810297
RD
260 }
261
262 // finally, output the name of the imported module
263 Printf(import, "%s\n", modname);
264-
265- if (!Strstr(f_shadow_imports, import)) {
266- Printf(f_shadow_imports, "%s", import);
267- }
268+ Printf(f_shadow, "%s", import);
269 Delete(import);
270 }
271 }
272 return Language::importDirective(n);
dd400cf4 273@@ -774,10 +781,15 @@
2f810297
RD
274
275 // Do the param type too?
276 if (showTypes) {
277 type = SwigType_base(type);
278- lookup = Swig_symbol_clookup(type, 0);
279- if (lookup) type = Getattr(lookup, "sym:name");
280+ SwigType* qt = SwigType_typedef_resolve_all(type);
281+ if (SwigType_isenum(qt))
282+ type = NewString("int");
283+ else {
284+ lookup = Swig_symbol_clookup(type, 0);
285+ if (lookup) type = Getattr(lookup, "sym:name");
286+ }
287 Printf(doc, "%s ", type);
288 }
289
290 if (name) {