X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1de47c7cb466d25dcb2135f5315d9c06927e0f2f..74b8433210c15d1dabeb5cc90e076b64867b9b42:/wxPython/src/libpy.c diff --git a/wxPython/src/libpy.c b/wxPython/src/libpy.c index 3005cae5ba..131b635d0d 100644 --- a/wxPython/src/libpy.c +++ b/wxPython/src/libpy.c @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.20 + * Version 1.3.22 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -203,12 +203,49 @@ SWIG_TypeName(const swig_type_info *ty) { return ty->name; } +/* + Compare two type names skipping the space characters, therefore + "char*" == "char *" and "Class" == "Class", etc. + + Return 0 when the two name types are equivalent, as in + strncmp, but skipping ' '. +*/ +static int +SWIG_TypeNameComp(const char *f1, const char *l1, + const char *f2, const char *l2) { + for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { + while ((*f1 == ' ') && (f1 != l1)) ++f1; + while ((*f2 == ' ') && (f2 != l2)) ++f2; + if (*f1 != *f2) return *f1 - *f2; + } + return (l1 - f1) - (l2 - f2); +} + +/* + Check type equivalence in a name list like ||... +*/ +static int +SWIG_TypeEquiv(const char *nb, const char *tb) { + int equiv = 0; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (!equiv && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = SWIG_TypeNameComp(nb, ne, tb, te) == 0; + if (*ne) ++ne; + } + return equiv; +} + + /* Search for a swig_type_info structure */ SWIGRUNTIME(swig_type_info *) SWIG_TypeQuery(const char *name) { swig_type_info *ty = swig_type_list; while (ty) { - if (ty->str && (strcmp(name,ty->str) == 0)) return ty; + if (ty->str && (SWIG_TypeEquiv(ty->str,name))) return ty; if (ty->name && (strcmp(name,ty->name) == 0)) return ty; ty = ty->prev; } @@ -326,7 +363,7 @@ typedef struct swig_const_info { SWIG_Python_NewPointerObj(p, type, flags) #define SWIG_MustGetPtr(p, type, argnum, flags) \ SWIG_Python_MustGetPtr(p, type, argnum, flags) - + /* Python-specific SWIG API */ #define SWIG_newvarlink() \ SWIG_Python_newvarlink() @@ -339,6 +376,8 @@ typedef struct swig_const_info { #define SWIG_InstallConstants(d, constants) \ SWIG_Python_InstallConstants(d, constants) +typedef double (*py_objasdbl_conv)(PyObject *obj); + #ifdef SWIG_NOINCLUDE SWIGIMPORT(int) SWIG_Python_ConvertPtr(PyObject *, void **, swig_type_info *, int); @@ -350,8 +389,10 @@ SWIGIMPORT(int) SWIG_Python_ConvertPacked(PyObject *, void *, int SWIGIMPORT(PyObject *) SWIG_Python_NewPackedObj(void *, int sz, swig_type_info *); SWIGIMPORT(void) SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]); + #else + /* ----------------------------------------------------------------------------- * global variable support code. * ----------------------------------------------------------------------------- */ @@ -415,19 +456,51 @@ swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) { statichere PyTypeObject varlinktype = { PyObject_HEAD_INIT(0) - 0, - (char *)"swigvarlink", /* Type name */ - sizeof(swig_varlinkobject), /* Basic size */ - 0, /* Itemsize */ - 0, /* Deallocator */ - (printfunc) swig_varlink_print, /* Print */ - (getattrfunc) swig_varlink_getattr, /* get attr */ - (setattrfunc) swig_varlink_setattr, /* Set attr */ - 0, /* tp_compare */ - (reprfunc) swig_varlink_repr, /* tp_repr */ + 0, /* Number of items in variable part (ob_size) */ + (char *)"swigvarlink", /* Type name (tp_name) */ + sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ + 0, /* Itemsize (tp_itemsize) */ + 0, /* Deallocator (tp_dealloc) */ + (printfunc) swig_varlink_print, /* Print (tp_print) */ + (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ + (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */ + 0, /* tp_compare */ + (reprfunc) swig_varlink_repr, /* tp_repr */ 0, /* tp_as_number */ - 0, /* tp_as_mapping*/ - 0, /* tp_hash */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + 0, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ }; /* Create a variable linking object for use later */ @@ -538,10 +611,10 @@ cobject: type_error: if (flags & SWIG_POINTER_EXCEPTION) { if (ty && c) { - char *temp = (char *) malloc(64+strlen(ty->name)+strlen(c)); - sprintf(temp,"Type error. Got %s, expected %s", c, ty->name); - PyErr_SetString(PyExc_TypeError, temp); - free((char *) temp); + PyObject *err = + PyString_FromFormat("Type error. Got %s, expected %s",c,ty->name); + PyErr_SetObject(PyExc_TypeError, err); + Py_DECREF(err); } else { PyErr_SetString(PyExc_TypeError,"Expected a pointer"); } @@ -579,10 +652,10 @@ type_error: if (flags) { if (ty && c) { - char *temp = (char *) malloc(64+strlen(ty->name)+strlen(c)); - sprintf(temp,"Type error. Got %s, expected %s", c, ty->name); - PyErr_SetString(PyExc_TypeError, temp); - free((char *) temp); + PyObject *err = + PyString_FromFormat("Type error. Got %s, expected %s",c,ty->name); + PyErr_SetObject(PyExc_TypeError, err); + Py_DECREF(err); } else { PyErr_SetString(PyExc_TypeError,"Expected a pointer"); } @@ -654,7 +727,12 @@ SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { obj = PyFloat_FromDouble(constants[i].dvalue); break; case SWIG_PY_STRING: - obj = PyString_FromString((char *) constants[i].pvalue); + if (constants[i].pvalue) { + obj = PyString_FromString((char *) constants[i].pvalue); + } else { + Py_INCREF(Py_None); + obj = Py_None; + } break; case SWIG_PY_POINTER: obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); @@ -686,7 +764,8 @@ SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { /* -------- TYPES TABLE (BEGIN) -------- */ -static swig_type_info *swig_types[1]; +#define SWIGTYPE_p_char swig_types[0] +static swig_type_info *swig_types[2]; /* -------- TYPES TABLE (END) -------- */ @@ -697,6 +776,49 @@ static swig_type_info *swig_types[1]; #define SWIG_init init_swigrun #define SWIG_name "_swigrun" + +/* Auxiliar swig macros */ + +#ifdef __cplusplus +#define SWIGSTATICINLINE(a) static inline a +#define SWIGSTATIC(a) static a +#define swig_new_array(type, size) (new type[(size)]) +#define swig_delete_array(cptr) delete[] cptr +#define swig_const_cast(type,a) const_cast(a) +#define swig_static_cast(type,a) static_cast(a) +#define swig_reinterpret_cast(type,a) reinterpret_cast(a) + +#ifdef HAVE_NUMERIC_CAST +#define swig_numeric_cast(type,a) numeric_cast(a) +#else +#define swig_numeric_cast(type,a) static_cast(a) +#endif + +#else /* C case */ + +#define SWIGSTATICINLINE(a) static a +#define SWIGSTATIC(a) static a +#define swig_new_array(type, size) ((type*) malloc((size)*sizeof(type))) +#define swig_delete_array(cptr) free((char*)cptr) +#define swig_const_cast(type,a) (type)(a) +#define swig_static_cast(type,a) (type)(a) +#define swig_reinterpret_cast(type,a) (type)(a) +#define swig_numeric_cast(type,a) (type)(a) + +#endif /* __cplusplus */ + + +#define SWIG_FromSignedChar PyInt_FromLong +#define SWIG_FromUnsignedChar PyInt_FromLong +#define SWIG_FromShort PyInt_FromLong +#define SWIG_FromUnsignedShort PyInt_FromLong +#define SWIG_FromInt PyInt_FromLong +#define SWIG_FromLong PyInt_FromLong +#define SWIG_FromFloat PyFloat_FromDouble +#define SWIG_FromDouble PyFloat_FromDouble +#define SWIG_FromFloat PyFloat_FromDouble +#define SWIG_FromDouble PyFloat_FromDouble + #ifdef __cplusplus extern "C" { #endif @@ -707,8 +829,10 @@ static PyMethodDef SwigMethods[] = { /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ +static swig_type_info _swigt__p_char[] = {{"_p_char", 0, "char *", 0, 0, 0, 0},{"_p_char", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info *swig_types_initial[] = { +_swigt__p_char, 0 };