X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1de47c7cb466d25dcb2135f5315d9c06927e0f2f..6bda7508c6e41365b69fdf690b3070991098a7af:/wxPython/src/libpy.c diff --git a/wxPython/src/libpy.c b/wxPython/src/libpy.c index 3005cae5ba..48680c914d 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 @@ -28,6 +28,7 @@ #define SWIG_TypeCast SWIG_Python_TypeCast #define SWIG_TypeDynamicCast SWIG_Python_TypeDynamicCast #define SWIG_TypeName SWIG_Python_TypeName +#define SWIG_TypePrettyName SWIG_Python_TypePrettyName #define SWIG_TypeQuery SWIG_Python_TypeQuery #define SWIG_TypeClientData SWIG_Python_TypeClientData #define SWIG_PackData SWIG_Python_PackData @@ -104,6 +105,7 @@ SWIGIMPORT(swig_type_info *) SWIG_TypeCheck(char *c, swig_type_info *); SWIGIMPORT(void *) SWIG_TypeCast(swig_type_info *, void *); SWIGIMPORT(swig_type_info *) SWIG_TypeDynamicCast(swig_type_info *, void **); SWIGIMPORT(const char *) SWIG_TypeName(const swig_type_info *); +SWIGIMPORT(const char *) SWIG_TypePrettyName(const swig_type_info *); SWIGIMPORT(swig_type_info *) SWIG_TypeQuery(const char *); SWIGIMPORT(void) SWIG_TypeClientData(swig_type_info *, void *); SWIGIMPORT(char *) SWIG_PackData(char *, void *, int); @@ -112,13 +114,14 @@ SWIGIMPORT(char *) SWIG_UnpackData(char *, void *, int); #else static swig_type_info *swig_type_list = 0; +static swig_type_info **swig_type_list_handle = &swig_type_list; /* Register a type mapping with the type-checking */ SWIGRUNTIME(swig_type_info *) SWIG_TypeRegister(swig_type_info *ti) { swig_type_info *tc, *head, *ret, *next; /* Check to see if this type has already been registered */ - tc = swig_type_list; + tc = *swig_type_list_handle; while (tc) { if (strcmp(tc->name, ti->name) == 0) { /* Already exists in the table. Just add additional types to the list */ @@ -133,8 +136,8 @@ SWIG_TypeRegister(swig_type_info *ti) { next = 0; /* Place in list */ - ti->prev = swig_type_list; - swig_type_list = ti; + ti->prev = *swig_type_list_handle; + *swig_type_list_handle = ti; /* Build linked lists */ l1: @@ -203,12 +206,69 @@ SWIG_TypeName(const swig_type_info *ty) { return ty->name; } +/* Return the pretty name associated with this type, + that is an unmangled type name in a form presentable to the user. +*/ +SWIGRUNTIME(const char *) +SWIG_TypePrettyName(const swig_type_info *type) { + /* The "str" field contains the equivalent pretty names of the + type, separated by vertical-bar characters. We choose + to print the last name, as it is often (?) the most + specific. */ + if (type->str != NULL) { + const char *last_name = type->str; + const char *s; + for (s = type->str; *s; s++) + if (*s == '|') last_name = s+1; + return last_name; + } + else + return type->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; + swig_type_info *ty = *swig_type_list_handle; 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; } @@ -224,7 +284,7 @@ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { equiv = ti->next; while (equiv) { if (!equiv->converter) { - tc = swig_type_list; + tc = *swig_type_list_handle; while (tc) { if ((strcmp(tc->name, equiv->name) == 0)) SWIG_TypeClientData(tc,clientdata); @@ -239,10 +299,10 @@ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { SWIGRUNTIME(char *) SWIG_PackData(char *c, void *ptr, int sz) { static char hex[17] = "0123456789abcdef"; - int i; unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; register unsigned char uu; - for (i = 0; i < sz; i++,u++) { + for (; u != eu; ++u) { uu = *u; *(c++) = hex[(uu & 0xf0) >> 4]; *(c++) = hex[uu & 0xf]; @@ -256,8 +316,8 @@ SWIG_UnpackData(char *c, void *ptr, int sz) { register unsigned char uu = 0; register int d; unsigned char *u = (unsigned char *) ptr; - int i; - for (i = 0; i < sz; i++, u++) { + const unsigned char *eu = u + sz; + for (; u != eu; ++u) { d = *(c++); if ((d >= '0') && (d <= '9')) uu = ((d - '0') << 4); @@ -280,7 +340,7 @@ SWIG_UnpackData(char *c, void *ptr, int sz) { #endif /*********************************************************************** - * python.swg + * pyrun.swg * * This file contains the runtime support for Python modules * and includes code for managing global variables and pointer @@ -289,8 +349,6 @@ SWIG_UnpackData(char *c, void *ptr, int sz) { * Author : David Beazley (beazley@cs.uchicago.edu) ************************************************************************/ -#include "Python.h" - #ifdef __cplusplus extern "C" { #endif @@ -326,7 +384,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 +397,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 +410,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 +477,63 @@ 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 */ +#if PY_VERSION_HEX >= 0x02020000 + 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 */ +#endif +#if PY_VERSION_HEX >= 0x02030200 + 0, /* tp_del */ +#endif +#ifdef COUNT_ALLOCS + /* these must be last */ + 0, /* tp_alloc */ + 0, /* tp_free */ + 0, /* tp_maxalloc */ + 0, /* tp_next */ +#endif }; /* Create a variable linking object for use later */ @@ -501,7 +607,7 @@ SWIG_Python_ConvertPtr(PyObject *obj, void **ptr, swig_type_info *ty, int flags) goto type_error; } } - c = PyString_AsString(obj); + c = PyString_AS_STRING(obj); /* Pointer values must start with leading underscore */ if (*c != '_') { *ptr = (void *) 0; @@ -529,19 +635,17 @@ cobject: } if ((pyobj) && (flags & SWIG_POINTER_DISOWN)) { - PyObject *zero = PyInt_FromLong(0); - PyObject_SetAttrString(pyobj,(char*)"thisown",zero); - Py_DECREF(zero); + PyObject_SetAttrString(pyobj,(char*)"thisown",Py_False); } return 0; type_error: + PyErr_Clear(); 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); + PyErr_Format(PyExc_TypeError, + "Type error. Got %s, expected %s", + c, ty->name); } else { PyErr_SetString(PyExc_TypeError,"Expected a pointer"); } @@ -564,7 +668,7 @@ SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, int sz, swig_type_info *ty, char *c = 0; if ((!obj) || (!PyString_Check(obj))) goto type_error; - c = PyString_AsString(obj); + c = PyString_AS_STRING(obj); /* Pointer values must start with leading underscore */ if (*c != '_') goto type_error; c++; @@ -579,10 +683,9 @@ 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); + PyErr_Format(PyExc_TypeError, + "Type error. Got %s, expected %s", + c, ty->name); } else { PyErr_SetString(PyExc_TypeError,"Expected a pointer"); } @@ -619,9 +722,7 @@ SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int own) { Py_DECREF(args); if (inst) { if (own) { - PyObject *n = PyInt_FromLong(1); - PyObject_SetAttrString(inst,(char*)"thisown",n); - Py_DECREF(n); + PyObject_SetAttrString(inst,(char*)"thisown",Py_True); } robj = inst; } @@ -654,7 +755,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,29 +792,88 @@ 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) -------- */ +#define SWIG_init initswigrun + +#define SWIG_name "swigrun" -/*----------------------------------------------- - @(target):= _swigrun.so - ------------------------------------------------*/ -#define SWIG_init init_swigrun +/* Auxiliar swig macros that appear in the header */ + +#define SWIG_OLDOBJ 1 +#define SWIG_NEWOBJ SWIG_OLDOBJ + 1 +#define SWIG_PYSTR SWIG_NEWOBJ + 1 + +#ifdef __cplusplus +#define SWIGSTATICINLINE(a) static inline a +#define SWIGSTATIC(a) static a +#define swig_new_array(size,Type) (new Type[(size)]) +#define swig_delete(cptr) delete cptr +#define swig_delete_array(cptr) delete[] cptr +#define swig_const_cast(a,Type) const_cast(a) +#define swig_static_cast(a,Type) static_cast(a) +#define swig_reinterpret_cast(a,Type) reinterpret_cast(a) +#define swig_new_copy(ptr,Type) (new Type(*ptr)) +#define swig_numeric_cast(a,Type) static_cast(a) + +#else /* C case */ + +#define SWIGSTATICINLINE(a) static a +#define SWIGSTATIC(a) static a +#define swig_new_array(size,Type) ((Type*) malloc((size)*sizeof(Type))) +#define swig_delete(cptr) free((char*)cptr) +#define swig_delete_array(cptr) free((char*)cptr) +#define swig_const_cast(a,Type) (Type)(a) +#define swig_static_cast(a,Type) (Type)(a) +#define swig_reinterpret_cast(a,Type) (Type)(a) +#define swig_numeric_cast(a,Type) (Type)(a) +#define swig_new_copy(ptr,Type) ((Type*)memcpy(malloc(sizeof(Type)),ptr,sizeof(Type))) + +#endif /* __cplusplus */ + + +/*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ +#define SWIG_From_signed_SS_char PyInt_FromLong +/*@@*/ +/*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ +#define SWIG_From_unsigned_SS_char PyInt_FromLong +/*@@*/ +/*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ +#define SWIG_From_short PyInt_FromLong +/*@@*/ +/*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ +#define SWIG_From_unsigned_SS_short PyInt_FromLong +/*@@*/ +/*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ +#define SWIG_From_int PyInt_FromLong +/*@@*/ +/*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ +#define SWIG_From_long PyInt_FromLong +/*@@*/ +/*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ +#define SWIG_From_float PyFloat_FromDouble +/*@@*/ +/*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ +#define SWIG_From_double PyFloat_FromDouble +/*@@*/ -#define SWIG_name "_swigrun" #ifdef __cplusplus extern "C" { #endif static PyMethodDef SwigMethods[] = { - { NULL, NULL } + { NULL, NULL, 0, NULL } }; /* -------- 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 }; @@ -716,7 +881,7 @@ static swig_type_info *swig_types_initial[] = { /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ static swig_const_info swig_const_table[] = { -{0}}; +{0, 0, 0, 0.0, 0, 0}}; #ifdef __cplusplus }