]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/SWIG.patches/SWIG.patch
fixed somebody's poorly done StreamSize-->GetSize transition
[wxWidgets.git] / utils / wxPython / SWIG.patches / SWIG.patch
1 *** cplus.cxx.old Mon Feb 02 15:55:42 1998
2 --- cplus.cxx Fri Aug 28 13:02:50 1998
3 ***************
4 *** 581,612 ****
5 // Class for managing class members (internally)
6 // ----------------------------------------------------------------------
7
8 static char *inherit_base_class = 0;
9
10 - class CPP_class {
11 - public:
12 - char *classname; // Real class name
13 - char *classrename; // New name of class (if applicable)
14 - char *classtype; // class type (struct, union, class)
15 - int strip; // Strip off class declarator
16 - int wextern; // Value of extern wrapper variable for this class
17 - int have_constructor; // Status bit indicating if we've seen a constructor
18 - int have_destructor; // Status bit indicating if a destructor has been seen
19 - int is_abstract; // Status bit indicating if this is an abstract class
20 - int generate_default; // Generate default constructors
21 - int objective_c; // Set if this is an objective C class
22 - int error; // Set if this class can't be generated
23 - int line; // Line number
24 - char **baseclass; // Base classes (if any)
25 - Hash *local; // Hash table for local types
26 - Hash *scope; // Local scope hash table
27 - DocEntry *de; // Documentation entry of class
28 - CPP_member *members; // Linked list of members
29 - CPP_class *next; // Next class
30 - static CPP_class *classlist; // List of all classes stored
31
32 ! CPP_class(char *name, char *ctype) {
33 CPP_class *c;
34 classname = copy_string(name);
35 classtype = copy_string(ctype);
36 classrename = 0;
37 --- 581,593 ----
38 // Class for managing class members (internally)
39 // ----------------------------------------------------------------------
40
41 static char *inherit_base_class = 0;
42 + CPP_class *CPP_class::classlist = 0;
43 + CPP_class *current_class;
44
45
46 ! CPP_class::CPP_class(char *name, char *ctype) {
47 CPP_class *c;
48 classname = copy_string(name);
49 classtype = copy_string(ctype);
50 classrename = 0;
51 ***************
52 *** 642,650 ****
53 // ------------------------------------------------------------------------------
54 // Add a new C++ member to this class
55 // ------------------------------------------------------------------------------
56
57 ! void add_member(CPP_member *m) {
58 CPP_member *cm;
59
60 // Set base class where this was defined
61 if (inherit_base_class)
62 --- 623,631 ----
63 // ------------------------------------------------------------------------------
64 // Add a new C++ member to this class
65 // ------------------------------------------------------------------------------
66
67 ! void CPP_class::add_member(CPP_member *m) {
68 CPP_member *cm;
69
70 // Set base class where this was defined
71 if (inherit_base_class)
72 ***************
73 *** 664,672 ****
74 // ------------------------------------------------------------------------------
75 // Search for a member with the given name. Returns the member on success, 0 on failure
76 // ------------------------------------------------------------------------------
77
78 ! CPP_member *search_member(char *name) {
79 CPP_member *m;
80 char *c;
81 m = members;
82 while (m) {
83 --- 645,653 ----
84 // ------------------------------------------------------------------------------
85 // Search for a member with the given name. Returns the member on success, 0 on failure
86 // ------------------------------------------------------------------------------
87
88 ! CPP_member *CPP_class::search_member(char *name) {
89 CPP_member *m;
90 char *c;
91 m = members;
92 while (m) {
93 ***************
94 *** 680,688 ****
95 // ------------------------------------------------------------------------------
96 // Inherit. Put all the declarations associated with this class into the current
97 // ------------------------------------------------------------------------------
98
99 ! void inherit_decls(int mode) {
100 CPP_member *m;
101 m = members;
102 while (m) {
103 inherit_base_class = m->base;
104 --- 661,669 ----
105 // ------------------------------------------------------------------------------
106 // Inherit. Put all the declarations associated with this class into the current
107 // ------------------------------------------------------------------------------
108
109 ! void CPP_class::inherit_decls(int mode) {
110 CPP_member *m;
111 m = members;
112 while (m) {
113 inherit_base_class = m->base;
114 ***************
115 *** 696,704 ****
116 // ------------------------------------------------------------------------------
117 // Emit all of the declarations associated with this class
118 // ------------------------------------------------------------------------------
119
120 ! void emit_decls() {
121 CPP_member *m = members;
122 int last_scope = name_scope(0);
123 abstract = is_abstract;
124 while (m) {
125 --- 677,685 ----
126 // ------------------------------------------------------------------------------
127 // Emit all of the declarations associated with this class
128 // ------------------------------------------------------------------------------
129
130 ! void CPP_class::emit_decls() {
131 CPP_member *m = members;
132 int last_scope = name_scope(0);
133 abstract = is_abstract;
134 while (m) {
135 ***************
136 *** 713,721 ****
137 // ------------------------------------------------------------------------------
138 // Search for a given class in the list
139 // ------------------------------------------------------------------------------
140
141 ! static CPP_class *search(char *name) {
142 CPP_class *c;
143 c = classlist;
144 if (!name) return 0;
145 while (c) {
146 --- 694,702 ----
147 // ------------------------------------------------------------------------------
148 // Search for a given class in the list
149 // ------------------------------------------------------------------------------
150
151 ! CPP_class *CPP_class::search(char *name) {
152 CPP_class *c;
153 c = classlist;
154 if (!name) return 0;
155 while (c) {
156 ***************
157 *** 729,737 ****
158 // Add default constructors and destructors
159 //
160 // ------------------------------------------------------------------------------
161
162 ! void create_default() {
163 if (!generate_default) return;
164
165 // Try to generate a constructor if not available.
166
167 --- 710,718 ----
168 // Add default constructors and destructors
169 //
170 // ------------------------------------------------------------------------------
171
172 ! void CPP_class::create_default() {
173 if (!generate_default) return;
174
175 // Try to generate a constructor if not available.
176
177 ***************
178 *** 751,764 ****
179 // ------------------------------------------------------------------------------
180 // Dump *all* of the classes saved out to the various
181 // language modules (this does what cplus_close_class used to do)
182 // ------------------------------------------------------------------------------
183 - static void create_all();
184 - };
185 -
186 - CPP_class *CPP_class::classlist = 0;
187 - static CPP_class *current_class;
188 -
189 void CPP_class::create_all() {
190 CPP_class *c;
191 c = classlist;
192 while (c) {
193 --- 732,739 ----
194 *** vector.cxx.old Fri Aug 28 15:23:16 1998
195 --- vector.cxx Fri Aug 28 15:46:52 1998
196 ***************
197 *** 0 ****
198 --- 1,182 ----
199 +
200 + /*******************************************************************************
201 + * Simplified Wrapper and Interface Generator (SWIG)
202 + *
203 + * Dave Beazley
204 + *
205 + * Department of Computer Science Theoretical Division (T-11)
206 + * University of Utah Los Alamos National Laboratory
207 + * Salt Lake City, Utah 84112 Los Alamos, New Mexico 87545
208 + * beazley@cs.utah.edu beazley@lanl.gov
209 + *
210 + * Copyright (c) 1995-1997
211 + * The University of Utah and the Regents of the University of California
212 + * All Rights Reserved
213 + *
214 + * Permission is hereby granted, without written agreement and without
215 + * license or royalty fees, to use, copy, modify, and distribute this
216 + * software and its documentation for any purpose, provided that
217 + * (1) The above copyright notice and the following two paragraphs
218 + * appear in all copies of the source code and (2) redistributions
219 + * including binaries reproduces these notices in the supporting
220 + * documentation. Substantial modifications to this software may be
221 + * copyrighted by their authors and need not follow the licensing terms
222 + * described here, provided that the new terms are clearly indicated in
223 + * all files where they apply.
224 + *
225 + * IN NO EVENT SHALL THE AUTHOR, THE UNIVERSITY OF CALIFORNIA, THE
226 + * UNIVERSITY OF UTAH OR DISTRIBUTORS OF THIS SOFTWARE BE LIABLE TO ANY
227 + * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
228 + * DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
229 + * EVEN IF THE AUTHORS OR ANY OF THE ABOVE PARTIES HAVE BEEN ADVISED OF
230 + * THE POSSIBILITY OF SUCH DAMAGE.
231 + *
232 + * THE AUTHOR, THE UNIVERSITY OF CALIFORNIA, AND THE UNIVERSITY OF UTAH
233 + * SPECIFICALLY DISCLAIM ANY WARRANTIES,INCLUDING, BUT NOT LIMITED TO,
234 + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
235 + * PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND
236 + * THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE,
237 + * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
238 + *
239 + *******************************************************************************/
240 +
241 + #include "internal.h"
242 +
243 + /*******************************************************************************
244 + * $Header$
245 + *
246 + * File : vector.cxx
247 + *
248 + * A very simple Vector class. Allways assumes that memory allocations are
249 + * successful. Should be made more robust...
250 + *
251 + *******************************************************************************/
252 +
253 + void* Vector::s_nullPtr = NULL;
254 +
255 + // -----------------------------------------------------------------------------
256 + // Vector::Vector(size_t allocSize = 8)
257 + //
258 + // Constructor. Creates a new Vector.
259 + //
260 + // Inputs : initial allocation size (optional)
261 + //
262 + // Output : New Vector object.
263 + //
264 + // Side Effects : None
265 + // -----------------------------------------------------------------------------
266 +
267 + Vector::Vector(size_t allocSize)
268 + : m_size(allocSize),
269 + m_count(0),
270 + m_data(0)
271 + {
272 + if (m_size) {
273 + m_data = new void*[m_size];
274 + int i;
275 + for (i=0; i<m_size;i++)
276 + m_data[i] = 0;
277 + }
278 + }
279 +
280 +
281 + // -----------------------------------------------------------------------------
282 + // Vector::~Vector
283 + //
284 + // Destructor. Only cleans up the vector, not its contents!
285 + //
286 + // -----------------------------------------------------------------------------
287 +
288 +
289 + Vector::~Vector() {
290 + if (m_data) {
291 + delete [] m_data;
292 + }
293 +
294 + m_data = 0;
295 + m_size = m_count = 0;
296 + }
297 +
298 +
299 +
300 + // -----------------------------------------------------------------------------
301 + // size_t Vector::extend(size_t newSize)
302 + //
303 + // Extends the vector to at least newSize length. Won't do anything if newSize
304 + // is smaller than the current size of the vector.
305 + //
306 + // Returns the new allocated size.
307 + //
308 + // -----------------------------------------------------------------------------
309 +
310 + #define GRANULARITY 16
311 +
312 + size_t Vector::extend(size_t newSize) {
313 +
314 + if (newSize > m_size) {
315 + newSize = newSize + (GRANULARITY - (newSize % GRANULARITY));
316 +
317 + void** temp = new void*[newSize];
318 + memcpy(temp, m_data, m_size*sizeof(void*));
319 +
320 + int i;
321 + for (i=m_size; i<newSize; i++)
322 + temp[i] = 0;
323 +
324 + delete [] m_data;
325 + m_data = temp;
326 + m_size = newSize;
327 + }
328 + return m_size;
329 + }
330 +
331 +
332 + // -----------------------------------------------------------------------------
333 + // Vector::append(void* object)
334 + //
335 + // Appends the object pointer to vector at index m_count. Increments m_count.
336 + // Returns the new count.
337 + // -----------------------------------------------------------------------------
338 +
339 + size_t Vector::append(void* object) {
340 + if (m_count >= m_size) {
341 + extend(m_count + 1);
342 + }
343 +
344 + m_data[m_count] = object;
345 + m_count += 1;
346 +
347 + return m_count;
348 + }
349 +
350 +
351 + // -----------------------------------------------------------------------------
352 + // Vector::operator[] (size_t idx)
353 + //
354 + // Returns a reference to the void pointer at idx. If idx is beyond the range
355 + // of the vector, returns a reference to s_nullPtr.
356 + //
357 + // -----------------------------------------------------------------------------
358 +
359 + void*& Vector::operator[] (size_t idx) {
360 + if (idx >= m_size) {
361 + s_nullPtr = 0;
362 + return s_nullPtr;
363 + }
364 +
365 + return m_data[idx];
366 + }
367 +
368 +
369 + /***********************************************************************
370 + *
371 + * -- Revision History
372 + * $Log$
373 + * Revision 1.3 1999/07/31 07:54:05 RD
374 + * wxPython 2.1b1:
375 + *
376 + * Added the missing wxWindow.GetUpdateRegion() method.
377 + *
378 + * Made a new change in SWIG (update your patches everybody) that
379 + * provides a fix for global shadow objects that get an exception in
380 + * their __del__ when their extension module has already been deleted.
381 + * It was only a 1 line change in .../SWIG/Modules/pycpp.cxx at about
382 + * line 496 if you want to do it by hand.
383 + *
384 + * It is now possible to run through MainLoop more than once in any one
385 + * process. The cleanup that used to happen as MainLoop completed (and
386 + * prevented it from running again) has been delayed until the wxc module
387 + * is being unloaded by Python.
388 + *
389 + * wxWindow.PopupMenu() now takes a wxPoint instead of x,y. Added
390 + * wxWindow.PopupMenuXY to be consistent with some other methods.
391 + *
392 + * Added wxGrid.SetEditInPlace and wxGrid.GetEditInPlace.
393 + *
394 + * You can now provide your own app.MainLoop method. See
395 + * wxPython/demo/demoMainLoop.py for an example and some explaination.
396 + *
397 + * Got the in-place-edit for the wxTreeCtrl fixed and added some demo
398 + * code to show how to use it.
399 + *
400 + * Put the wxIcon constructor back in for GTK as it now has one that
401 + * matches MSW's.
402 + *
403 + * Added wxGrid.GetCells
404 + *
405 + * Added wxSystemSettings static methods as functions with names like
406 + * wxSystemSettings_GetSystemColour.
407 + *
408 + * Removed wxPyMenu since using menu callbacks have been depreciated in
409 + * wxWindows. Use wxMenu and events instead.
410 + *
411 + * Added alternate wxBitmap constructor (for MSW only) as
412 + * wxBitmapFromData(data, type, width, height, depth = 1)
413 + *
414 + * Added a helper function named wxPyTypeCast that can convert shadow
415 + * objects of one type into shadow objects of another type. (Like doing
416 + * a down-cast.) See the implementation in wx.py for some docs.
417 + *
418 + *
419 + ***********************************************************************/
420 +
421 +
422 +
423 +
424 +
425 +
426 *** makefile.msc.old Mon Jun 23 16:15:32 1997
427 --- makefile.msc Fri Aug 28 11:21:58 1998
428 ***************
429 *** 33,50 ****
430 # Normally, you shouldn't have to change anything below this point #
431 ########################################################################
432
433 LIBOBJS = main.obj scanner.obj symbol.obj include.obj types.obj parms.obj emit.obj newdoc.obj ascii.obj \
434 ! html.obj latex.obj cplus.obj lang.obj hash.obj sstring.obj wrapfunc.obj getopt.obj comment.obj typemap.obj naming.obj
435
436 LIBSRCS = main.cxx scanner.cxx symbol.cxx include.cxx types.cxx parms.cxx emit.cxx \
437 ! newdoc.cxx ascii.cxx html.cxx latex.cxx cplus.cxx lang.cxx hash.cxx \
438 sstring.cxx wrapfunc.cxx getopt.cxx comment.cxx typemap.cxx naming.cxx
439
440 LIBHEADERS = internal.h ../Include/swig.h latex.h ascii.h html.h nodoc.h
441 LIBNAME = ..\libswig.lib
442 INCLUDE = -I../Include -I$(STD_INC)
443 ! CFLAGS = -Zi -nologo -DSWIG_LIB="\"$(SWIG_LIB)\"" -DSWIG_CC="\"$(CC)\"" -DMSDOS -DSTDC_HEADERS=1 -DHAVE_LIBDL=1 $(SWIG_OPTS)
444 LD_FLAGS = -VERBOSE
445
446
447 #
448 --- 33,50 ----
449 # Normally, you shouldn't have to change anything below this point #
450 ########################################################################
451
452 LIBOBJS = main.obj scanner.obj symbol.obj include.obj types.obj parms.obj emit.obj newdoc.obj ascii.obj \
453 ! html.obj latex.obj cplus.obj lang.obj hash.obj vector.obj sstring.obj wrapfunc.obj getopt.obj comment.obj typemap.obj naming.obj
454
455 LIBSRCS = main.cxx scanner.cxx symbol.cxx include.cxx types.cxx parms.cxx emit.cxx \
456 ! newdoc.cxx ascii.cxx html.cxx latex.cxx cplus.cxx lang.cxx hash.cxx vector.cxx \
457 sstring.cxx wrapfunc.cxx getopt.cxx comment.cxx typemap.cxx naming.cxx
458
459 LIBHEADERS = internal.h ../Include/swig.h latex.h ascii.h html.h nodoc.h
460 LIBNAME = ..\libswig.lib
461 INCLUDE = -I../Include -I$(STD_INC)
462 ! CFLAGS = -Zi -nologo -DSWIG_LIB="\"$(SWIG_LIB)\"" -DSWIG_CC="\"$(CC)\"" -DMSDOS -DSTDC_HEADERS=1 -DHAVE_LIBDL=1 $(SWIG_OPTS) $(OTHERFLAGS)
463 LD_FLAGS = -VERBOSE
464
465
466 #
467 *** makefile.bc.old Sun Jan 04 13:49:24 1998
468 --- makefile.bc Fri Aug 28 15:42:58 1998
469 ***************
470 *** 34,47 ****
471 ########################################################################
472
473 LIBOBJS = main.obj scanner.obj symbol.obj include.obj types.obj parms.obj \
474 emit.obj newdoc.obj ascii.obj \
475 ! html.obj latex.obj cplus.obj lang.obj hash.obj sstring.obj \
476 wrapfunc.obj getopt.obj comment.obj typemap.obj naming.obj
477
478 LIBSRCS = main.cxx scanner.cxx symbol.cxx include.cxx types.cxx parms.cxx \
479 emit.cxx newdoc.cxx ascii.cxx html.cxx latex.cxx cplus.cxx lang.cxx hash.cxx \
480 ! sstring.cxx wrapfunc.cxx getopt.cxx comment.cxx typemap.cxx naming.cxx
481
482 LIBHEADERS = internal.h ../Include/swig.h latex.h ascii.h html.h nodoc.h
483 LIBNAME = ..\libswig.lib
484 INCLUDE = -I../Include -I$(STD_INC)
485 --- 34,47 ----
486 ########################################################################
487
488 LIBOBJS = main.obj scanner.obj symbol.obj include.obj types.obj parms.obj \
489 emit.obj newdoc.obj ascii.obj \
490 ! html.obj latex.obj cplus.obj lang.obj hash.obj vector.obj sstring.obj \
491 wrapfunc.obj getopt.obj comment.obj typemap.obj naming.obj
492
493 LIBSRCS = main.cxx scanner.cxx symbol.cxx include.cxx types.cxx parms.cxx \
494 emit.cxx newdoc.cxx ascii.cxx html.cxx latex.cxx cplus.cxx lang.cxx hash.cxx \
495 ! vector.cxx sstring.cxx wrapfunc.cxx getopt.cxx comment.cxx typemap.cxx naming.cxx
496
497 LIBHEADERS = internal.h ../Include/swig.h latex.h ascii.h html.h nodoc.h
498 LIBNAME = ..\libswig.lib
499 INCLUDE = -I../Include -I$(STD_INC)
500 *** Makefile.in.old Wed May 28 23:56:56 1997
501 --- Makefile.in Fri Aug 28 15:43:36 1998
502 ***************
503 *** 51,63 ****
504 # Normally, you shouldn't have to change anything below this point #
505 ########################################################################
506
507 LIBOBJS = main.o scanner.o symbol.o include.o types.o parms.o emit.o newdoc.o ascii.o \
508 ! html.o latex.o cplus.o lang.o hash.o sstring.o wrapfunc.o getopt.o comment.o \
509 typemap.o naming.o
510
511 LIBSRCS = main.cxx scanner.cxx symbol.cxx include.cxx types.cxx parms.cxx emit.cxx \
512 ! newdoc.cxx ascii.cxx html.cxx latex.cxx cplus.cxx lang.cxx hash.cxx \
513 sstring.cxx wrapfunc.cxx getopt.cxx comment.cxx typemap.cxx naming.cxx
514
515 LIBHEADERS = internal.h ../Include/swig.h latex.h ascii.h html.h nodoc.h
516 LIB = ../libswig.a
517 --- 51,63 ----
518 # Normally, you shouldn't have to change anything below this point #
519 ########################################################################
520
521 LIBOBJS = main.o scanner.o symbol.o include.o types.o parms.o emit.o newdoc.o ascii.o \
522 ! html.o latex.o cplus.o lang.o hash.o vector.o sstring.o wrapfunc.o getopt.o comment.o \
523 typemap.o naming.o
524
525 LIBSRCS = main.cxx scanner.cxx symbol.cxx include.cxx types.cxx parms.cxx emit.cxx \
526 ! newdoc.cxx ascii.cxx html.cxx latex.cxx cplus.cxx lang.cxx hash.cxx vector.cxx \
527 sstring.cxx wrapfunc.cxx getopt.cxx comment.cxx typemap.cxx naming.cxx
528
529 LIBHEADERS = internal.h ../Include/swig.h latex.h ascii.h html.h nodoc.h
530 LIB = ../libswig.a