1 *** python.cxx.old Fri Jan 02 23:17:40 1998
2 --- python.cxx Fri Aug 28 15:49:18 1998
6 fprintf(stderr,"%s : Line %d. Unable to locate file %s\n", input_file, line_number, value);
10 + } else if (strcmp(cmd, "addtomethod") == 0) {
11 + // parse value, expected to be in the form "methodName:line"
12 + char* txtptr = strchr(value, ':');
14 + // add name and line to a list in current_class
17 + AddPragmaData* apData = new AddPragmaData(value, txtptr);
18 + current_class->addPragmas.append(apData);
21 + fprintf(stderr,"%s : Line %d. Malformed addtomethod pragma. Should be \"methodName:text\"\n",
22 + input_file, line_number);
24 + } else if (strcmp(cmd, "addtoclass") == 0) {
25 + AddPragmaData* apData = new AddPragmaData("__class__", value);
26 + current_class->addPragmas.append(apData);
28 fprintf(stderr,"%s : Line %d. Unrecognized pragma.\n", input_file, line_number);
31 *** python.h.old Thu Jul 24 23:18:50 1997
32 --- python.h Fri Aug 28 15:46:08 1998
36 void cpp_declare_const(char *name, char *iname, DataType *type, char *value);
37 void cpp_class_decl(char *, char *,char *);
38 void pragma(char *, char *, char *);
39 void add_typedef(DataType *t, char *name);
41 + void emitAddPragmas(String& output, char* name, char* spacing);
44 #define PYSHADOW_MEMBER 0x2
46 + struct AddPragmaData {
50 + AddPragmaData(char* method, char* text)
56 *** pycpp.cxx.old Fri Jan 02 21:23:22 1998
57 --- pycpp.cxx Tue Jul 20 14:34:36 1999
64 // if ((t->type != T_VOID) || (t->is_pointer))
65 + emitAddPragmas(*pyclass, realname, tab8);
66 *pyclass << tab8 << "return val\n";
68 // Change the usage string to reflect our shadow class
76 *construct << tab8 << "self.thisown = 1\n";
77 + emitAddPragmas(*construct, "__init__", tab8);
81 // Hmmm. We seem to be creating a different constructor. We're just going to create a
84 if (class_renamed) realname = class_name;
88 ! *pyclass << tab4 << "def __del__(self):\n"
89 << tab8 << "if self.thisown == 1 :\n"
90 << tab8 << tab4 << module << "." << name_destroy(realname) << "(self.this)\n";
95 doc_entry->usage = "";
96 doc_entry->usage << "del this";
99 if (class_renamed) realname = class_name;
100 else realname = name;
103 ! *pyclass << tab4 << "def __del__(self, " << module << "=" << module << "):\n"
104 << tab8 << "if self.thisown == 1 :\n"
105 << tab8 << tab4 << module << "." << name_destroy(realname) << "(self.this)\n";
106 ! emitAddPragmas(*pyclass, "__del__", tab8);
109 doc_entry->usage = "";
110 doc_entry->usage << "del this";
115 repr << tab4 << "def __repr__(self):\n"
116 << tab8 << "return \"<C " << class_name <<" instance>\"\n";
119 + emitAddPragmas(classes, "__class__", tab4);
123 // Now build the real class with a normal constructor
128 hash.add(name,copy_string((char *) hash.lookup(t->name)));
132 + // --------------------------------------------------------------------------------
133 + // PYTHON::emitAddPragmas(String& output, char* name, char* spacing);
135 + // Search the current_class->addPragmas vector for any text belonging to name.
136 + // Append the text properly spcaed to the output string.
138 + // --------------------------------------------------------------------------------
140 + void PYTHON::emitAddPragmas(String& output, char* name, char* spacing)
142 + AddPragmaData* apData;
146 + count = current_class->addPragmas.count();
147 + for (i=0; i<count; i++) {
148 + apData = (AddPragmaData*)current_class->addPragmas[i];
149 + if (strcmp(apData->m_method, name) == 0) {
150 + output << spacing << apData->m_text << "\n";
155 /*********************************************************************************
158 * Revision 1.2 1999/07/31 07:54:05 RD
161 * Added the missing wxWindow.GetUpdateRegion() method.
163 * Made a new change in SWIG (update your patches everybody) that
164 * provides a fix for global shadow objects that get an exception in
165 * their __del__ when their extension module has already been deleted.
166 * It was only a 1 line change in .../SWIG/Modules/pycpp.cxx at about
167 * line 496 if you want to do it by hand.
169 * It is now possible to run through MainLoop more than once in any one
170 * process. The cleanup that used to happen as MainLoop completed (and
171 * prevented it from running again) has been delayed until the wxc module
172 * is being unloaded by Python.
174 * wxWindow.PopupMenu() now takes a wxPoint instead of x,y. Added
175 * wxWindow.PopupMenuXY to be consistent with some other methods.
177 * Added wxGrid.SetEditInPlace and wxGrid.GetEditInPlace.
179 * You can now provide your own app.MainLoop method. See
180 * wxPython/demo/demoMainLoop.py for an example and some explaination.
182 * Got the in-place-edit for the wxTreeCtrl fixed and added some demo
183 * code to show how to use it.
185 * Put the wxIcon constructor back in for GTK as it now has one that
188 * Added wxGrid.GetCells
190 * Added wxSystemSettings static methods as functions with names like
191 * wxSystemSettings_GetSystemColour.
193 * Removed wxPyMenu since using menu callbacks have been depreciated in
194 * wxWindows. Use wxMenu and events instead.
196 * Added alternate wxBitmap constructor (for MSW only) as
197 * wxBitmapFromData(data, type, width, height, depth = 1)
199 * Added a helper function named wxPyTypeCast that can convert shadow
200 * objects of one type into shadow objects of another type. (Like doing
201 * a down-cast.) See the implementation in wx.py for some docs.