This commit was manufactured by cvs2svn to create tag

'DEBIAN_2_4_3_1_SARGE_v_2_4_2_4'.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/tags/DEBIAN_2_4_3_1_SARGE_v_2_4_2_4@34395 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Bryan Petty
2005-05-29 09:56:16 +00:00
parent 86118733af
commit cfd794784f
4010 changed files with 349688 additions and 169530 deletions

View File

@@ -146,7 +146,7 @@ void PYTHON::cpp_member_func(char *name, char *iname, DataType *t, ParmList *l)
if (docstring && doc_entry) {
*pyclass << tab8 << "\"\"\"" << add_docstring(doc_entry) << "\"\"\"\n";
}
*pyclass << tab8 << "val = apply(" << module << "." << name_member(realname,class_name) << ",(self,) + _args, _kwargs)\n";
*pyclass << tab8 << "val = " << module << "." << name_member(realname,class_name) << "(self, *_args, **_kwargs)\n";
// Check to see if the return type is an object
if ((hash.lookup(t->name)) && (t->is_pointer <= 1)) {
@@ -216,7 +216,7 @@ void PYTHON::cpp_constructor(char *name, char *iname, ParmList *l) {
if (docstring && doc_entry)
*construct << tab8 << "\"\"\"" << add_docstring(doc_entry) << "\"\"\"\n";
*construct << tab8 << "self.this = apply(" << module << "." << name_construct(realname) << ",_args,_kwargs)\n";
*construct << tab8 << "self.this = " << module << "." << name_construct(realname) << "(*_args,**_kwargs)\n";
*construct << tab8 << "self.thisown = 1\n";
emitAddPragmas(*construct,"__init__",tab8);
have_constructor = 1;
@@ -226,8 +226,8 @@ void PYTHON::cpp_constructor(char *name, char *iname, ParmList *l) {
// function for it.
*additional << "def " << realname << "(*_args,**_kwargs):\n";
*additional << tab4 << "val = " << class_name << "Ptr(apply("
<< module << "." << name_construct(realname) << ",_args,_kwargs))\n"
*additional << tab4 << "val = " << class_name << "Ptr("
<< module << "." << name_construct(realname) << "(*_args,**_kwargs))\n"
<< tab4 << "val.thisown = 1\n";
emitAddPragmas(*additional, realname, tab4);
*additional << tab4 << "return val\n\n";
@@ -260,10 +260,15 @@ void PYTHON::cpp_destructor(char *name, char *newname) {
else realname = name;
}
*pyclass << tab4 << "def __del__(self," << module << "=" << module << "):\n";
char* dfname = name_destroy(realname);
*pyclass << tab4 << "def __del__(self, " << "delfunc=" << module<< "." << dfname << "):\n";
emitAddPragmas(*pyclass,"__del__",tab8);
*pyclass << tab8 << "if self.thisown == 1 :\n"
<< tab8 << tab4 << module << "." << name_destroy(realname) << "(self)\n";
*pyclass << tab8 << "if self.thisown == 1:\n"
<< tab8 << tab4 << "try:\n"
<< tab8 << tab8 << "delfunc(self)\n"
<< tab8 << tab4 << "except:\n"
<< tab8 << tab8 << "pass\n";
have_destructor = 1;
if (doc_entry) {
@@ -317,7 +322,7 @@ void PYTHON::cpp_close_class() {
if (!have_repr) {
// Supply a repr method for this class
repr << tab4 << "def __repr__(self):\n"
<< tab8 << "return \"<C " << class_name <<" instance at %s>\" % (self.this,)\n";
<< tab8 << "return \"<%s.%s instance; proxy of C++ " << class_name <<" instance at %s>\" % (self.__class__.__module__, self.__class__.__name__, self.this)\n";
classes << repr;
emitAddPragmas(classes,"__class__",tab4);

View File

@@ -484,9 +484,13 @@ PYTHON::get_pointer(char *iname, char *srcname, char *src, char *dest,
// Now get the pointer value from the string and save in dest
f << tab4 << "if (" << src << ") {\n"
<< tab8 << "if (" << src << " == Py_None) { " << dest << " = NULL; }\n"
<< tab8 << "else if (SWIG_GetPtrObj(" << src << ",(void **) &" << dest << ",";
if (t->is_reference)
f << tab4 << "if (" << src << ") {\n"
<< tab8 << "if (SWIG_GetPtrObj(" << src << ",(void **) &" << dest << ",";
else
f << tab4 << "if (" << src << ") {\n"
<< tab8 << "if (" << src << " == Py_None) { " << dest << " = NULL; }\n"
<< tab8 << "else if (SWIG_GetPtrObj(" << src << ",(void **) &" << dest << ",";
// If we're passing a void pointer, we give the pointer conversion a NULL
// pointer, otherwise pass in the expected type.
@@ -1067,7 +1071,7 @@ void PYTHON::create_function(char *name, char *iname, DataType *d, ParmList *l)
func << tab4 << "\"\"\"" << add_docstring(doc_entry) << "\"\"\"\n";
}
func << tab4 << "val = apply(" << module << "." << iname << ",_args,_kwargs)\n";
func << tab4 << "val = " << module << "." << iname << "(*_args,**_kwargs)\n";
if (munge_return) {
// If the output of this object has been remapped in any way, we're

View File

@@ -0,0 +1 @@
Makefile

View File

@@ -0,0 +1 @@
Makefile

View File

@@ -1,3 +1,5 @@
#include "Python.h"
#include <string.h>
#include <stdlib.h>
/* Definitions for Windows/Unix exporting */
@@ -15,12 +17,9 @@
# define SWIGEXPORT(a) a
#endif
#include "Python.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void SWIG_MakePtr(char *, void *, char *);
extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
extern char *SWIG_GetPtr(char *, void **, char *);

View File

@@ -5,11 +5,11 @@
* Contains variable linking and pointer type-checking code.
************************************************************************/
#include "Python.h"
#include <string.h>
#include <stdlib.h>
#include "Python.h"
#ifdef __cplusplus
extern "C" {
#endif

View File

@@ -0,0 +1 @@
Makefile