X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d896a793a01cf7dc02ed04dcadb51591438eb32f..700c96d420c7413ff2220e16e848962bdd2e45eb:/wxPython/src/mac/misc_wrap.cpp diff --git a/wxPython/src/mac/misc_wrap.cpp b/wxPython/src/mac/misc_wrap.cpp index 0bdc839356..c49a479ee6 100644 --- a/wxPython/src/mac/misc_wrap.cpp +++ b/wxPython/src/mac/misc_wrap.cpp @@ -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 @@ -137,6 +137,178 @@ SWIGIMPORT(char *) SWIG_UnpackData(char *, void *, int); #include "Python.h" +#include +#include + +#ifdef __cplusplus +#define SWIG_STATIC_INLINE static inline +#else +#define SWIG_STATIC_INLINE static +#endif + +SWIG_STATIC_INLINE long +SPyObj_AsLong(PyObject * obj) +{ + return PyInt_Check(obj) ? PyInt_AsLong(obj) : PyLong_AsLong(obj); +} + +SWIG_STATIC_INLINE unsigned long +SPyObj_AsUnsignedLong(PyObject * obj) +{ + if (PyLong_Check(obj)) { + return PyLong_AsUnsignedLong(obj); + } else { + long i = PyInt_AsLong(obj); + if ( !PyErr_Occurred() && (i < 0)) { + PyErr_SetString(PyExc_TypeError, "negative value for unsigned type"); + } + return i; + } +} + +#if !defined(_MSC_VER) +SWIG_STATIC_INLINE PyObject* +SPyObj_FromLongLong(long long value) +{ + return (value > (long)(LONG_MAX)) ? + PyLong_FromLongLong(value) : PyInt_FromLong((long)value); +} +#endif + +SWIG_STATIC_INLINE PyObject* +SPyObj_FromUnsignedLong(unsigned long value) +{ + return (value > (unsigned long)(LONG_MAX)) ? + PyLong_FromUnsignedLong(value) : PyInt_FromLong((long)value); +} + +#if !defined(_MSC_VER) +SWIG_STATIC_INLINE PyObject* +SPyObj_FromUnsignedLongLong(unsigned long long value) +{ + return (value > (unsigned long long)(LONG_MAX)) ? + PyLong_FromUnsignedLongLong(value) : PyInt_FromLong((long)value); +} +#endif + +SWIG_STATIC_INLINE long +SPyObj_AsLongInRange(PyObject * obj, long min_value, long max_value) +{ + long value = SPyObj_AsLong(obj); + if (!PyErr_Occurred()) { + if (value < min_value) { + PyErr_SetString(PyExc_OverflowError,"value is smaller than type minimum"); + } else if (value > max_value) { + PyErr_SetString(PyExc_OverflowError,"value is greater than type maximum"); + } + } + return value; +} + +SWIG_STATIC_INLINE unsigned long +SPyObj_AsUnsignedLongInRange(PyObject *obj, unsigned long max_value) +{ + unsigned long value = SPyObj_AsUnsignedLong(obj); + if (!PyErr_Occurred()) { + if (value > max_value) { + PyErr_SetString(PyExc_OverflowError,"value is greater than type maximum"); + } + } + return value; +} + +SWIG_STATIC_INLINE signed char +SPyObj_AsSignedChar(PyObject *obj) { + return (signed char)SPyObj_AsLongInRange(obj, SCHAR_MIN, SCHAR_MAX); +} + +SWIG_STATIC_INLINE short +SPyObj_AsShort(PyObject *obj) { + return (short)SPyObj_AsLongInRange(obj, SHRT_MIN, SHRT_MAX); +} + +SWIG_STATIC_INLINE int +SPyObj_AsInt(PyObject *obj) { + return SPyObj_AsLongInRange(obj, INT_MIN, INT_MAX); +} + +SWIG_STATIC_INLINE unsigned char +SPyObj_AsUnsignedChar(PyObject *obj) { + return (unsigned char)SPyObj_AsUnsignedLongInRange(obj, UCHAR_MAX); +} + +SWIG_STATIC_INLINE unsigned short +SPyObj_AsUnsignedShort(PyObject *obj) { + return (unsigned short)SPyObj_AsUnsignedLongInRange(obj, USHRT_MAX); +} + +SWIG_STATIC_INLINE unsigned int +SPyObj_AsUnsignedInt(PyObject *obj) { + return SPyObj_AsUnsignedLongInRange(obj, UINT_MAX); +} + +#if !defined(_MSC_VER) +SWIG_STATIC_INLINE long long +SPyObj_AsLongLong(PyObject *obj) { + return PyInt_Check(obj) ? + PyInt_AsLong(obj) : PyLong_AsLongLong(obj); +} + +SWIG_STATIC_INLINE unsigned long long +SPyObj_AsUnsignedLongLong(PyObject *obj) { + return PyLong_Check(obj) ? + PyLong_AsUnsignedLongLong(obj) : SPyObj_AsUnsignedLong(obj); +} +#endif + +SWIG_STATIC_INLINE double +SPyObj_AsDouble(PyObject *obj) { + return (PyFloat_Check(obj)) ? PyFloat_AsDouble(obj) : + (double)((PyInt_Check(obj)) ? PyInt_AsLong(obj) : PyLong_AsLongLong(obj)); +} + +SWIG_STATIC_INLINE float +SPyObj_AsFloat(PyObject *obj) { + double value = SPyObj_AsDouble(obj); + if (!PyErr_Occurred()) { + if (value < FLT_MIN) { + PyErr_SetString(PyExc_OverflowError,"float is smaller than flt_min"); + } else if (value > FLT_MAX) { + PyErr_SetString(PyExc_OverflowError,"float is greater than flt_max"); + } + } + return (float) value; +} + +SWIG_STATIC_INLINE char +SPyObj_AsChar(PyObject *obj) { + char c = (PyString_Check(obj) && PyString_Size(obj) == 1) ? + PyString_AsString(obj)[0] + : (char) SPyObj_AsLongInRange(obj, CHAR_MIN, CHAR_MAX); + if (PyErr_Occurred()) { + PyErr_Clear(); + PyErr_SetString(PyExc_TypeError, "a char is required"); + } + return c; +} + +SWIG_STATIC_INLINE PyObject * +SPyObj_FromChar(char c) { + return PyString_FromStringAndSize(&c,1); +} + +SWIG_STATIC_INLINE PyObject * +SPyObj_FromCharPtr(const char* cptr) { + return cptr ? PyString_FromString(cptr) : Py_BuildValue((char*)""); +} + +SWIG_STATIC_INLINE int +SPyObj_AsBool(PyObject *obj) { + return SPyObj_AsLong/*Long*/(obj) ? 1 : 0; +} + + + #ifdef __cplusplus extern "C" { #endif @@ -172,7 +344,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() @@ -1689,8 +1861,10 @@ static PyObject *_wrap_GetElapsedTime(PyObject *self, PyObject *args, PyObject * if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"|O:GetElapsedTime",kwnames,&obj0)) goto fail; if (obj0) { - arg1 = PyInt_AsLong(obj0) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg1 = (bool) SPyObj_AsBool(obj0); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -1993,8 +2167,10 @@ static PyObject *_wrap_Usleep(PyObject *self, PyObject *args, PyObject *kwargs) }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Usleep",kwnames,&obj0)) goto fail; - arg1 = (unsigned long) PyInt_AsLong(obj0); - if (PyErr_Occurred()) SWIG_fail; + { + arg1 = (unsigned long) SPyObj_AsUnsignedLong(obj0); + if (PyErr_Occurred()) SWIG_fail; + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); wxUsleep(arg1); @@ -2018,8 +2194,10 @@ static PyObject *_wrap_EnableTopLevelWindows(PyObject *self, PyObject *args, PyO }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:EnableTopLevelWindows",kwnames,&obj0)) goto fail; - arg1 = PyInt_AsLong(obj0) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg1 = (bool) SPyObj_AsBool(obj0); + if (PyErr_Occurred()) SWIG_fail; + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); wxEnableTopLevelWindows(arg1); @@ -2308,7 +2486,7 @@ static PyObject *_wrap_GetProcessId(PyObject *self, PyObject *args, PyObject *kw wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = PyInt_FromLong((long)result); + resultobj = SPyObj_FromUnsignedLong((unsigned long)result); return resultobj; fail: return NULL; @@ -2765,8 +2943,10 @@ static PyObject *_wrap_GetTextFromUser(PyObject *self, PyObject *args, PyObject if ((SWIG_ConvertPtr(obj3,(void **) &arg4, SWIGTYPE_p_wxWindow,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; } if (obj6) { - arg7 = PyInt_AsLong(obj6) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg7 = (bool) SPyObj_AsBool(obj6); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -2943,8 +3123,10 @@ static PyObject *_wrap_GetSingleChoice(PyObject *self, PyObject *args, PyObject if ((SWIG_ConvertPtr(obj3,(void **) &arg5, SWIGTYPE_p_wxWindow,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; } if (obj6) { - arg8 = PyInt_AsLong(obj6) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg8 = (bool) SPyObj_AsBool(obj6); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -3032,8 +3214,10 @@ static PyObject *_wrap_GetSingleChoiceIndex(PyObject *self, PyObject *args, PyOb if ((SWIG_ConvertPtr(obj3,(void **) &arg5, SWIGTYPE_p_wxWindow,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; } if (obj6) { - arg8 = PyInt_AsLong(obj6) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg8 = (bool) SPyObj_AsBool(obj6); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -3961,8 +4145,10 @@ static PyObject *_wrap_ToolTip_Enable(PyObject *self, PyObject *args, PyObject * }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ToolTip_Enable",kwnames,&obj0)) goto fail; - arg1 = PyInt_AsLong(obj0) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg1 = (bool) SPyObj_AsBool(obj0); + if (PyErr_Occurred()) SWIG_fail; + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); wxToolTip::Enable(arg1); @@ -5464,7 +5650,7 @@ static PyObject *_wrap_TipProvider_GetCurrentTip(PyObject *self, PyObject *args, wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = PyInt_FromLong((long)result); + resultobj = SPyObj_FromUnsignedLong((unsigned long)result); return resultobj; fail: return NULL; @@ -5535,8 +5721,10 @@ static PyObject *_wrap_new_PyTipProvider(PyObject *self, PyObject *args, PyObjec }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:new_PyTipProvider",kwnames,&obj0)) goto fail; - arg1 = (size_t) PyInt_AsLong(obj0); - if (PyErr_Occurred()) SWIG_fail; + { + arg1 = (size_t) SPyObj_AsUnsignedLong(obj0); + if (PyErr_Occurred()) SWIG_fail; + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxPyTipProvider *)new wxPyTipProvider(arg1); @@ -5605,8 +5793,10 @@ static PyObject *_wrap_ShowTip(PyObject *self, PyObject *args, PyObject *kwargs) if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxWindow,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxTipProvider,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if (obj2) { - arg3 = PyInt_AsLong(obj2) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg3 = (bool) SPyObj_AsBool(obj2); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -5640,8 +5830,10 @@ static PyObject *_wrap_CreateFileTipProvider(PyObject *self, PyObject *args, PyO if (arg1 == NULL) SWIG_fail; temp1 = True; } - arg2 = (size_t) PyInt_AsLong(obj1); - if (PyErr_Occurred()) SWIG_fail; + { + arg2 = (size_t) SPyObj_AsUnsignedLong(obj1); + if (PyErr_Occurred()) SWIG_fail; + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxTipProvider *)wxCreateFileTipProvider((wxString const &)*arg1,arg2); @@ -5789,8 +5981,10 @@ static PyObject *_wrap_Timer_Start(PyObject *self, PyObject *args, PyObject *kwa if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|iO:Timer_Start",kwnames,&obj0,&arg2,&obj2)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxPyTimer,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if (obj2) { - arg3 = PyInt_AsLong(obj2) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg3 = (bool) SPyObj_AsBool(obj2); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -6033,8 +6227,10 @@ static PyObject *_wrap_new_TimerRunner__SWIG_1(PyObject *self, PyObject *args) { PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; } if (obj2) { - arg3 = PyInt_AsLong(obj2) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg3 = (bool) SPyObj_AsBool(obj2); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -6087,14 +6283,26 @@ static PyObject *_wrap_new_TimerRunner(PyObject *self, PyObject *args) { } if (_v) { { - _v = (PyInt_Check(argv[1]) || PyLong_Check(argv[1])) ? 1 : 0; + SPyObj_AsInt(argv[1]); + if (PyErr_Occurred()) { + _v = 0; + PyErr_Clear(); + } else { + _v = 1; + } } if (_v) { if (argc <= 2) { return _wrap_new_TimerRunner__SWIG_1(self,args); } { - _v = (PyInt_Check(argv[2]) || PyLong_Check(argv[2])) ? 1 : 0; + SPyObj_AsBool(argv[2]); + if (PyErr_Occurred()) { + _v = 0; + PyErr_Clear(); + } else { + _v = 1; + } } if (_v) { return _wrap_new_TimerRunner__SWIG_1(self,args); @@ -6146,8 +6354,10 @@ static PyObject *_wrap_TimerRunner_Start(PyObject *self, PyObject *args, PyObjec if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"Oi|O:TimerRunner_Start",kwnames,&obj0,&arg2,&obj2)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxTimerRunner,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if (obj2) { - arg3 = PyInt_AsLong(obj2) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg3 = (bool) SPyObj_AsBool(obj2); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -6225,8 +6435,10 @@ static PyObject *_wrap_Log_EnableLogging(PyObject *self, PyObject *args, PyObjec if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"|O:Log_EnableLogging",kwnames,&obj0)) goto fail; if (obj0) { - arg1 = PyInt_AsLong(obj0) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg1 = (bool) SPyObj_AsBool(obj0); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -6255,11 +6467,15 @@ static PyObject *_wrap_Log_OnLog(PyObject *self, PyObject *args, PyObject *kwarg }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Log_OnLog",kwnames,&obj0,&obj1,&obj2)) goto fail; - arg1 = (wxLogLevel) PyInt_AsLong(obj0); - if (PyErr_Occurred()) SWIG_fail; + { + arg1 = (wxLogLevel) SPyObj_AsUnsignedLong(obj0); + if (PyErr_Occurred()) SWIG_fail; + } if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxChar,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - arg3 = (time_t) PyInt_AsLong(obj2); - if (PyErr_Occurred()) SWIG_fail; + { + arg3 = (time_t) SPyObj_AsUnsignedInt(obj2); + if (PyErr_Occurred()) SWIG_fail; + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); wxLog::OnLog(arg1,(wxChar const *)arg2,arg3); @@ -6418,8 +6634,10 @@ static PyObject *_wrap_Log_SetVerbose(PyObject *self, PyObject *args, PyObject * if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"|O:Log_SetVerbose",kwnames,&obj0)) goto fail; if (obj0) { - arg1 = PyInt_AsLong(obj0) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg1 = (bool) SPyObj_AsBool(obj0); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -6444,8 +6662,10 @@ static PyObject *_wrap_Log_SetLogLevel(PyObject *self, PyObject *args, PyObject }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Log_SetLogLevel",kwnames,&obj0)) goto fail; - arg1 = (wxLogLevel) PyInt_AsLong(obj0); - if (PyErr_Occurred()) SWIG_fail; + { + arg1 = (wxLogLevel) SPyObj_AsUnsignedLong(obj0); + if (PyErr_Occurred()) SWIG_fail; + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); wxLog::SetLogLevel(arg1); @@ -6490,8 +6710,10 @@ static PyObject *_wrap_Log_SetTraceMask(PyObject *self, PyObject *args, PyObject }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Log_SetTraceMask",kwnames,&obj0)) goto fail; - arg1 = (wxTraceMask) PyInt_AsLong(obj0); - if (PyErr_Occurred()) SWIG_fail; + { + arg1 = (wxTraceMask) SPyObj_AsUnsignedLong(obj0); + if (PyErr_Occurred()) SWIG_fail; + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); wxLog::SetTraceMask(arg1); @@ -6689,7 +6911,7 @@ static PyObject *_wrap_Log_GetTraceMask(PyObject *self, PyObject *args, PyObject wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = PyInt_FromLong((long)result); + resultobj = SPyObj_FromUnsignedLong((unsigned long)result); return resultobj; fail: return NULL; @@ -6736,7 +6958,7 @@ static PyObject *_wrap_Log_GetLogLevel(PyObject *self, PyObject *args, PyObject wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = PyInt_FromLong((long)result); + resultobj = SPyObj_FromUnsignedLong((unsigned long)result); return resultobj; fail: return NULL; @@ -6938,12 +7160,16 @@ static PyObject *_wrap_new_LogWindow(PyObject *self, PyObject *args, PyObject *k temp2 = True; } if (obj2) { - arg3 = PyInt_AsLong(obj2) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg3 = (bool) SPyObj_AsBool(obj2); + if (PyErr_Occurred()) SWIG_fail; + } } if (obj3) { - arg4 = PyInt_AsLong(obj3) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg4 = (bool) SPyObj_AsBool(obj3); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -6980,8 +7206,10 @@ static PyObject *_wrap_LogWindow_Show(PyObject *self, PyObject *args, PyObject * if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:LogWindow_Show",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxLogWindow,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if (obj1) { - arg2 = PyInt_AsLong(obj1) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg2 = (bool) SPyObj_AsBool(obj1); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -7086,8 +7314,10 @@ static PyObject *_wrap_LogWindow_PassMessages(PyObject *self, PyObject *args, Py if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:LogWindow_PassMessages",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxLogWindow,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - arg2 = PyInt_AsLong(obj1) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg2 = (bool) SPyObj_AsBool(obj1); + if (PyErr_Occurred()) SWIG_fail; + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); (arg1)->PassMessages(arg2); @@ -7173,8 +7403,10 @@ static PyObject *_wrap_LogChain_PassMessages(PyObject *self, PyObject *args, PyO if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:LogChain_PassMessages",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxLogChain,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - arg2 = PyInt_AsLong(obj1) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg2 = (bool) SPyObj_AsBool(obj1); + if (PyErr_Occurred()) SWIG_fail; + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); (arg1)->PassMessages(arg2); @@ -7261,7 +7493,7 @@ static PyObject *_wrap_SysErrorCode(PyObject *self, PyObject *args, PyObject *kw wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = PyInt_FromLong((long)result); + resultobj = SPyObj_FromUnsignedLong((unsigned long)result); return resultobj; fail: return NULL; @@ -7279,8 +7511,10 @@ static PyObject *_wrap_SysErrorMsg(PyObject *self, PyObject *args, PyObject *kwa if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"|O:SysErrorMsg",kwnames,&obj0)) goto fail; if (obj0) { - arg1 = (unsigned long) PyInt_AsLong(obj0); - if (PyErr_Occurred()) SWIG_fail; + { + arg1 = (unsigned long) SPyObj_AsUnsignedLong(obj0); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -7684,8 +7918,10 @@ static PyObject *_wrap_LogTrace__SWIG_0(PyObject *self, PyObject *args) { PyObject * obj1 = 0 ; if(!PyArg_ParseTuple(args,(char *)"OO:LogTrace",&obj0,&obj1)) goto fail; - arg1 = (unsigned long) PyInt_AsLong(obj0); - if (PyErr_Occurred()) SWIG_fail; + { + arg1 = (unsigned long) SPyObj_AsUnsignedLong(obj0); + if (PyErr_Occurred()) SWIG_fail; + } { arg2 = wxString_in_helper(obj1); if (arg2 == NULL) SWIG_fail; @@ -7801,7 +8037,13 @@ static PyObject *_wrap_LogTrace(PyObject *self, PyObject *args) { if (argc == 2) { int _v; { - _v = (PyInt_Check(argv[0]) || PyLong_Check(argv[0])) ? 1 : 0; + SPyObj_AsUnsignedLong(argv[0]); + if (PyErr_Occurred()) { + _v = 0; + PyErr_Clear(); + } else { + _v = 1; + } } if (_v) { { @@ -7836,8 +8078,10 @@ static PyObject *_wrap_LogGeneric(PyObject *self, PyObject *args, PyObject *kwar }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:LogGeneric",kwnames,&obj0,&obj1)) goto fail; - arg1 = (unsigned long) PyInt_AsLong(obj0); - if (PyErr_Occurred()) SWIG_fail; + { + arg1 = (unsigned long) SPyObj_AsUnsignedLong(obj0); + if (PyErr_Occurred()) SWIG_fail; + } { arg2 = wxString_in_helper(obj1); if (arg2 == NULL) SWIG_fail; @@ -10459,8 +10703,10 @@ static PyObject *_wrap_new_Wave(PyObject *self, PyObject *args, PyObject *kwargs temp1 = True; } if (obj1) { - arg2 = PyInt_AsLong(obj1) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg2 = (bool) SPyObj_AsBool(obj1); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -10587,12 +10833,16 @@ static PyObject *_wrap_Wave_Play(PyObject *self, PyObject *args, PyObject *kwarg if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|OO:Wave_Play",kwnames,&obj0,&obj1,&obj2)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxWave,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if (obj1) { - arg2 = PyInt_AsLong(obj1) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg2 = (bool) SPyObj_AsBool(obj1); + if (PyErr_Occurred()) SWIG_fail; + } } if (obj2) { - arg3 = PyInt_AsLong(obj2) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg3 = (bool) SPyObj_AsBool(obj2); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -11581,8 +11831,10 @@ static PyObject *_wrap_FileType_SetCommand(PyObject *self, PyObject *args, PyObj temp3 = True; } if (obj3) { - arg4 = PyInt_AsLong(obj3) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg4 = (bool) SPyObj_AsBool(obj3); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -12032,8 +12284,10 @@ static PyObject *_wrap_MimeTypesManager_ReadMailcap(PyObject *self, PyObject *ar temp2 = True; } if (obj2) { - arg3 = PyInt_AsLong(obj2) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg3 = (bool) SPyObj_AsBool(obj2); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -13359,8 +13613,10 @@ static PyObject *_wrap_ConfigBase_Get(PyObject *self, PyObject *args, PyObject * if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"|O:ConfigBase_Get",kwnames,&obj0)) goto fail; if (obj0) { - arg1 = PyInt_AsLong(obj0) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg1 = (bool) SPyObj_AsBool(obj0); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -13609,8 +13865,10 @@ static PyObject *_wrap_ConfigBase_GetNumberOfEntries(PyObject *self, PyObject *a if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:ConfigBase_GetNumberOfEntries",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxConfigBase,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if (obj1) { - arg2 = PyInt_AsLong(obj1) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg2 = (bool) SPyObj_AsBool(obj1); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -13619,7 +13877,7 @@ static PyObject *_wrap_ConfigBase_GetNumberOfEntries(PyObject *self, PyObject *a wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = PyInt_FromLong((long)result); + resultobj = SPyObj_FromUnsignedLong((unsigned long)result); return resultobj; fail: return NULL; @@ -13640,8 +13898,10 @@ static PyObject *_wrap_ConfigBase_GetNumberOfGroups(PyObject *self, PyObject *ar if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:ConfigBase_GetNumberOfGroups",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxConfigBase,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if (obj1) { - arg2 = PyInt_AsLong(obj1) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg2 = (bool) SPyObj_AsBool(obj1); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -13650,7 +13910,7 @@ static PyObject *_wrap_ConfigBase_GetNumberOfGroups(PyObject *self, PyObject *ar wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = PyInt_FromLong((long)result); + resultobj = SPyObj_FromUnsignedLong((unsigned long)result); return resultobj; fail: return NULL; @@ -13993,8 +14253,10 @@ static PyObject *_wrap_ConfigBase_ReadBool(PyObject *self, PyObject *args, PyObj temp2 = True; } if (obj2) { - arg3 = PyInt_AsLong(obj2) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg3 = (bool) SPyObj_AsBool(obj2); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -14180,8 +14442,10 @@ static PyObject *_wrap_ConfigBase_WriteBool(PyObject *self, PyObject *args, PyOb if (arg2 == NULL) SWIG_fail; temp2 = True; } - arg3 = PyInt_AsLong(obj2) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg3 = (bool) SPyObj_AsBool(obj2); + if (PyErr_Occurred()) SWIG_fail; + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (bool)(arg1)->Write((wxString const &)*arg2,arg3); @@ -14218,8 +14482,10 @@ static PyObject *_wrap_ConfigBase_Flush(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:ConfigBase_Flush",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxConfigBase,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if (obj1) { - arg2 = PyInt_AsLong(obj1) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg2 = (bool) SPyObj_AsBool(obj1); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -14371,8 +14637,10 @@ static PyObject *_wrap_ConfigBase_DeleteEntry(PyObject *self, PyObject *args, Py temp2 = True; } if (obj2) { - arg3 = PyInt_AsLong(obj2) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg3 = (bool) SPyObj_AsBool(obj2); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -14500,8 +14768,10 @@ static PyObject *_wrap_ConfigBase_SetExpandEnvVars(PyObject *self, PyObject *arg if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:ConfigBase_SetExpandEnvVars",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxConfigBase,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if (obj1) { - arg2 = PyInt_AsLong(obj1) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg2 = (bool) SPyObj_AsBool(obj1); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -14530,8 +14800,10 @@ static PyObject *_wrap_ConfigBase_SetRecordDefaults(PyObject *self, PyObject *ar if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:ConfigBase_SetRecordDefaults",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxConfigBase,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if (obj1) { - arg2 = PyInt_AsLong(obj1) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg2 = (bool) SPyObj_AsBool(obj1); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -15803,8 +16075,10 @@ static PyObject *_wrap_new_DateTimeFromTimeT(PyObject *self, PyObject *args, PyO }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:new_DateTimeFromTimeT",kwnames,&obj0)) goto fail; - arg1 = (time_t) PyInt_AsLong(obj0); - if (PyErr_Occurred()) SWIG_fail; + { + arg1 = (time_t) SPyObj_AsUnsignedInt(obj0); + if (PyErr_Occurred()) SWIG_fail; + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxDateTime *)new wxDateTime(arg1); @@ -15962,8 +16236,10 @@ static PyObject *_wrap_DateTime_SetTimeT(PyObject *self, PyObject *args, PyObjec if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:DateTime_SetTimeT",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - arg2 = (time_t) PyInt_AsLong(obj1); - if (PyErr_Occurred()) SWIG_fail; + { + arg2 = (time_t) SPyObj_AsUnsignedInt(obj1); + if (PyErr_Occurred()) SWIG_fail; + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); { @@ -16902,8 +17178,10 @@ static PyObject *_wrap_DateTime_ToTimezone(PyObject *self, PyObject *args, PyObj temp2 = True; } if (obj2) { - arg3 = PyInt_AsLong(obj2) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg3 = (bool) SPyObj_AsBool(obj2); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -16950,8 +17228,10 @@ static PyObject *_wrap_DateTime_MakeTimezone(PyObject *self, PyObject *args, PyO temp2 = True; } if (obj2) { - arg3 = PyInt_AsLong(obj2) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg3 = (bool) SPyObj_AsBool(obj2); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -16990,8 +17270,10 @@ static PyObject *_wrap_DateTime_ToGMT(PyObject *self, PyObject *args, PyObject * if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:DateTime_ToGMT",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if (obj1) { - arg2 = PyInt_AsLong(obj1) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg2 = (bool) SPyObj_AsBool(obj1); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -17025,8 +17307,10 @@ static PyObject *_wrap_DateTime_MakeGMT(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:DateTime_MakeGMT",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if (obj1) { - arg2 = PyInt_AsLong(obj1) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg2 = (bool) SPyObj_AsBool(obj1); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -17114,7 +17398,7 @@ static PyObject *_wrap_DateTime_GetTicks(PyObject *self, PyObject *args, PyObjec wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = PyInt_FromLong((long)result); + resultobj = SPyObj_FromUnsignedLong((unsigned long)result); return resultobj; fail: return NULL; @@ -21667,7 +21951,7 @@ static PyObject *_wrap_DataFormat___eq____SWIG_0(PyObject *self, PyObject *args) if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxDataFormat,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)((wxDataFormat const *)arg1)->operator ==((wxDataFormatId )arg2); + result = (bool)((wxDataFormat const *)arg1)->operator ==(arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -21690,7 +21974,7 @@ static PyObject *_wrap_DataFormat___ne____SWIG_0(PyObject *self, PyObject *args) if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxDataFormat,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)((wxDataFormat const *)arg1)->operator !=((wxDataFormatId )arg2); + result = (bool)((wxDataFormat const *)arg1)->operator !=(arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -21778,7 +22062,13 @@ static PyObject *_wrap_DataFormat___eq__(PyObject *self, PyObject *args) { } if (_v) { { - _v = (PyInt_Check(argv[1]) || PyLong_Check(argv[1])) ? 1 : 0; + SPyObj_AsInt(argv[1]); + if (PyErr_Occurred()) { + _v = 0; + PyErr_Clear(); + } else { + _v = 1; + } } if (_v) { return _wrap_DataFormat___eq____SWIG_0(self,args); @@ -21867,7 +22157,13 @@ static PyObject *_wrap_DataFormat___ne__(PyObject *self, PyObject *args) { } if (_v) { { - _v = (PyInt_Check(argv[1]) || PyLong_Check(argv[1])) ? 1 : 0; + SPyObj_AsInt(argv[1]); + if (PyErr_Occurred()) { + _v = 0; + PyErr_Clear(); + } else { + _v = 1; + } } if (_v) { return _wrap_DataFormat___ne____SWIG_0(self,args); @@ -22095,7 +22391,7 @@ static PyObject *_wrap_DataObject_GetFormatCount(PyObject *self, PyObject *args, wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = PyInt_FromLong((long)result); + resultobj = SPyObj_FromUnsignedLong((unsigned long)result); return resultobj; fail: return NULL; @@ -22158,7 +22454,7 @@ static PyObject *_wrap_DataObject_GetDataSize(PyObject *self, PyObject *args, Py wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = PyInt_FromLong((long)result); + resultobj = SPyObj_FromUnsignedLong((unsigned long)result); return resultobj; fail: return NULL; @@ -22248,8 +22544,10 @@ static PyObject *_wrap_DataObject_SetData(PyObject *self, PyObject *args, PyObje if (arg2 == NULL) { PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; } - arg3 = (size_t) PyInt_AsLong(obj2); - if (PyErr_Occurred()) SWIG_fail; + { + arg3 = (size_t) SPyObj_AsUnsignedLong(obj2); + if (PyErr_Occurred()) SWIG_fail; + } if ((SWIG_ConvertPtr(obj3,(void **) &arg4, 0, SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -22552,7 +22850,7 @@ static PyObject *_wrap_TextDataObject_GetTextLength(PyObject *self, PyObject *ar wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = PyInt_FromLong((long)result); + resultobj = SPyObj_FromUnsignedLong((unsigned long)result); return resultobj; fail: return NULL; @@ -23043,7 +23341,7 @@ static PyObject *_wrap_CustomDataObject_GetSize(PyObject *self, PyObject *args, wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = PyInt_FromLong((long)result); + resultobj = SPyObj_FromUnsignedLong((unsigned long)result); return resultobj; fail: return NULL; @@ -24505,8 +24803,10 @@ static PyObject *_wrap_Clipboard_UsePrimarySelection(PyObject *self, PyObject *a if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:Clipboard_UsePrimarySelection",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxClipboard,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if (obj1) { - arg2 = PyInt_AsLong(obj1) ? true : false; - if (PyErr_Occurred()) SWIG_fail; + { + arg2 = (bool) SPyObj_AsBool(obj1); + if (PyErr_Occurred()) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads();