X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/794c5cb151d633aa13a4f74292713544c6ccf381..e234d4c9b72709629e655b2935a3bf1262eebcb1:/wxPython/src/msw/utils.cpp diff --git a/wxPython/src/msw/utils.cpp b/wxPython/src/msw/utils.cpp index 3919ada737..00560f27c9 100644 --- a/wxPython/src/msw/utils.cpp +++ b/wxPython/src/msw/utils.cpp @@ -19,6 +19,8 @@ /* Implementation : PYTHON */ #define SWIGPYTHON +#include "Python.h" + #include #include /* Definitions for Windows/Unix exporting */ @@ -36,12 +38,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 *); @@ -55,30 +54,16 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "utilsc" -#include "export.h" +#include "helpers.h" #include #include #include -static PyObject* l_output_helper(PyObject* target, PyObject* o) { - PyObject* o2; - if (!target) { - target = o; - } else if (target == Py_None) { - Py_DECREF(Py_None); - target = o; - } else { - if (!PyList_Check(target)) { - o2 = target; - target = PyList_New(0); - PyList_Append(target, o2); - Py_XDECREF(o2); - } - PyList_Append(target,o); - Py_XDECREF(o); - } - return target; -} + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING2(DateFormatStr, wxT("%c")); + static const wxString wxPyEmptyString(wxT("")); + + static PyObject* t_output_helper(PyObject* target, PyObject* o) { PyObject* o2; @@ -106,19 +91,15 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { return target; } -#if PYTHON_API_VERSION >= 1009 - static char* wxStringErrorMsg = "String or Unicode type required"; -#else - static char* wxStringErrorMsg = "string type is required for parameter"; -#endif - - static wxString wxPyEmptyStr(""); - static PyObject* __EnumerationHelper(bool flag, wxString& str, long index) { PyObject* ret = PyTuple_New(3); if (ret) { PyTuple_SET_ITEM(ret, 0, PyInt_FromLong(flag)); - PyTuple_SET_ITEM(ret, 1, PyString_FromString(str)); +#if wxUSE_UNICODE + PyTuple_SET_ITEM(ret, 1, PyUnicode_FromWideChar(str.c_str(), str.Len())); +#else + PyTuple_SET_ITEM(ret, 1, PyString_FromStringAndSize(str.c_str(), str.Len())); +#endif PyTuple_SET_ITEM(ret, 2, PyInt_FromLong(index)); } return ret; @@ -137,10 +118,11 @@ static PyObject *_wrap_wxGetLocalTime(PyObject *self, PyObject *args, PyObject * if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxGetLocalTime",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (long )wxGetLocalTime(); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (long )wxGetLocalTime(); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("l",_result); return _resultobj; } @@ -154,10 +136,11 @@ static PyObject *_wrap_wxGetUTCTime(PyObject *self, PyObject *args, PyObject *kw if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxGetUTCTime",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (long )wxGetUTCTime(); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (long )wxGetUTCTime(); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("l",_result); return _resultobj; } @@ -171,10 +154,11 @@ static PyObject *_wrap_wxGetCurrentTime(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxGetCurrentTime",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (long )wxGetCurrentTime(); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (long )wxGetCurrentTime(); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("l",_result); return _resultobj; } @@ -188,10 +172,11 @@ static PyObject *_wrap_wxGetLocalTimeMillis(PyObject *self, PyObject *args, PyOb if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxGetLocalTimeMillis",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxLongLong (wxGetLocalTimeMillis()); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxLongLong (wxGetLocalTimeMillis()); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; }{ PyObject *hi, *lo, *shifter, *shifted; hi = PyLong_FromLong(_result->GetHi()); @@ -225,10 +210,11 @@ static PyObject *_wrap_delete_wxConfigBase(PyObject *self, PyObject *args, PyObj } } { - wxPy_BEGIN_ALLOW_THREADS; - delete_wxConfigBase(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + delete_wxConfigBase(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; return _resultobj; @@ -253,10 +239,11 @@ static PyObject *_wrap_wxConfigBase_Set(PyObject *self, PyObject *args, PyObject } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxConfigBase *)wxConfigBase::Set(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxConfigBase *)wxConfigBase::Set(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxConfigBase_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -280,10 +267,11 @@ static PyObject *_wrap_wxConfigBase_Get(PyObject *self, PyObject *args, PyObject return NULL; _arg0 = (bool ) tempbool0; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxConfigBase *)wxConfigBase::Get(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxConfigBase *)wxConfigBase::Get(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxConfigBase_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -304,10 +292,11 @@ static PyObject *_wrap_wxConfigBase_Create(PyObject *self, PyObject *args, PyObj if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxConfigBase_Create",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxConfigBase *)wxConfigBase::Create(); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxConfigBase *)wxConfigBase::Create(); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxConfigBase_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -326,10 +315,11 @@ static PyObject *_wrap_wxConfigBase_DontCreateOnDemand(PyObject *self, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxConfigBase_DontCreateOnDemand",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - wxConfigBase::DontCreateOnDemand(); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxConfigBase::DontCreateOnDemand(); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; return _resultobj; @@ -354,10 +344,11 @@ static PyObject *_wrap_wxConfigBase_DeleteAll(PyObject *self, PyObject *args, Py } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxConfigBase_DeleteAll(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxConfigBase_DeleteAll(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -385,29 +376,17 @@ static PyObject *_wrap_wxConfigBase_DeleteEntry(PyObject *self, PyObject *args, } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } _arg2 = (bool ) tempbool2; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxConfigBase_DeleteEntry(_arg0,*_arg1,_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxConfigBase_DeleteEntry(_arg0,*_arg1,_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); { if (_obj1) @@ -437,28 +416,16 @@ static PyObject *_wrap_wxConfigBase_DeleteGroup(PyObject *self, PyObject *args, } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxConfigBase_DeleteGroup(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxConfigBase_DeleteGroup(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); { if (_obj1) @@ -488,28 +455,16 @@ static PyObject *_wrap_wxConfigBase_Exists(PyObject *self, PyObject *args, PyObj } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxConfigBase_Exists(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxConfigBase_Exists(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); { if (_obj1) @@ -540,10 +495,11 @@ static PyObject *_wrap_wxConfigBase_Flush(PyObject *self, PyObject *args, PyObje } _arg1 = (bool ) tempbool1; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxConfigBase_Flush(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxConfigBase_Flush(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -567,12 +523,17 @@ static PyObject *_wrap_wxConfigBase_GetAppName(PyObject *self, PyObject *args, P } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxString (wxConfigBase_GetAppName(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxConfigBase_GetAppName(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; }{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); +#else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif } { delete _result; @@ -606,10 +567,11 @@ static PyObject *_wrap_wxConfigBase_GetFirstGroup(PyObject *self, PyObject *args } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (PyObject *)wxConfigBase_GetFirstGroup(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (PyObject *)wxConfigBase_GetFirstGroup(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; }{ _resultobj = _result; } @@ -642,10 +604,11 @@ static PyObject *_wrap_wxConfigBase_GetFirstEntry(PyObject *self, PyObject *args } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (PyObject *)wxConfigBase_GetFirstEntry(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (PyObject *)wxConfigBase_GetFirstEntry(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; }{ _resultobj = _result; } @@ -678,10 +641,11 @@ static PyObject *_wrap_wxConfigBase_GetNextGroup(PyObject *self, PyObject *args, } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (PyObject *)wxConfigBase_GetNextGroup(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (PyObject *)wxConfigBase_GetNextGroup(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; }{ _resultobj = _result; } @@ -714,10 +678,11 @@ static PyObject *_wrap_wxConfigBase_GetNextEntry(PyObject *self, PyObject *args, } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (PyObject *)wxConfigBase_GetNextEntry(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (PyObject *)wxConfigBase_GetNextEntry(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; }{ _resultobj = _result; } @@ -746,10 +711,11 @@ static PyObject *_wrap_wxConfigBase_GetNumberOfEntries(PyObject *self, PyObject } _arg1 = (bool ) tempbool1; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxConfigBase_GetNumberOfEntries(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxConfigBase_GetNumberOfEntries(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -776,10 +742,11 @@ static PyObject *_wrap_wxConfigBase_GetNumberOfGroups(PyObject *self, PyObject * } _arg1 = (bool ) tempbool1; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxConfigBase_GetNumberOfGroups(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxConfigBase_GetNumberOfGroups(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -803,12 +770,17 @@ static PyObject *_wrap_wxConfigBase_GetPath(PyObject *self, PyObject *args, PyOb } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxString (wxConfigBase_GetPath(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxConfigBase_GetPath(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; }{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); +#else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif } { delete _result; @@ -835,12 +807,17 @@ static PyObject *_wrap_wxConfigBase_GetVendorName(PyObject *self, PyObject *args } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxString (wxConfigBase_GetVendorName(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxConfigBase_GetVendorName(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; }{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); +#else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif } { delete _result; @@ -869,28 +846,16 @@ static PyObject *_wrap_wxConfigBase_HasEntry(PyObject *self, PyObject *args, PyO } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxConfigBase_HasEntry(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxConfigBase_HasEntry(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); { if (_obj1) @@ -920,28 +885,16 @@ static PyObject *_wrap_wxConfigBase_HasGroup(PyObject *self, PyObject *args, PyO } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxConfigBase_HasGroup(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxConfigBase_HasGroup(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); { if (_obj1) @@ -969,10 +922,11 @@ static PyObject *_wrap_wxConfigBase_IsExpandingEnvVars(PyObject *self, PyObject } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxConfigBase_IsExpandingEnvVars(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxConfigBase_IsExpandingEnvVars(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -996,10 +950,11 @@ static PyObject *_wrap_wxConfigBase_IsRecordingDefaults(PyObject *self, PyObject } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxConfigBase_IsRecordingDefaults(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxConfigBase_IsRecordingDefaults(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -1010,7 +965,7 @@ static PyObject *_wrap_wxConfigBase_Read(PyObject *self, PyObject *args, PyObjec wxString * _result; wxConfigBase * _arg0; wxString * _arg1; - wxString * _arg2 = (wxString *) &wxPyEmptyStr; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _obj1 = 0; PyObject * _obj2 = 0; @@ -1027,49 +982,28 @@ static PyObject *_wrap_wxConfigBase_Read(PyObject *self, PyObject *args, PyObjec } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } if (_obj2) { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg2 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) return NULL; - } - _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); -#endif } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxString (wxConfigBase_Read(_arg0,*_arg1,*_arg2)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxConfigBase_Read(_arg0,*_arg1,*_arg2)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; }{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); +#else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif } { if (_obj1) @@ -1085,7 +1019,11 @@ static PyObject *_wrap_wxConfigBase_Read(PyObject *self, PyObject *args, PyObjec return _resultobj; } -#define wxConfigBase_ReadInt(_swigobj,_swigarg0,_swigarg1) (_swigobj->Read(_swigarg0,_swigarg1)) +static long wxConfigBase_ReadInt(wxConfigBase *self,const wxString & key,long defaultVal) { + long rv; + self->Read(key, &rv, defaultVal); + return rv; + } static PyObject *_wrap_wxConfigBase_ReadInt(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; long _result; @@ -1107,28 +1045,16 @@ static PyObject *_wrap_wxConfigBase_ReadInt(PyObject *self, PyObject *args, PyOb } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (long )wxConfigBase_ReadInt(_arg0,*_arg1,_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (long )wxConfigBase_ReadInt(_arg0,*_arg1,_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("l",_result); { if (_obj1) @@ -1137,7 +1063,11 @@ static PyObject *_wrap_wxConfigBase_ReadInt(PyObject *self, PyObject *args, PyOb return _resultobj; } -#define wxConfigBase_ReadFloat(_swigobj,_swigarg0,_swigarg1) (_swigobj->Read(_swigarg0,_swigarg1)) +static double wxConfigBase_ReadFloat(wxConfigBase *self,const wxString & key,double defaultVal) { + double rv; + self->Read(key, &rv, defaultVal); + return rv; + } static PyObject *_wrap_wxConfigBase_ReadFloat(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; double _result; @@ -1159,29 +1089,63 @@ static PyObject *_wrap_wxConfigBase_ReadFloat(PyObject *self, PyObject *args, Py } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (double )wxConfigBase_ReadFloat(_arg0,*_arg1,_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("d",_result); +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +static bool wxConfigBase_ReadBool(wxConfigBase *self,const wxString & key,bool defaultVal) { + bool rv; + self->Read(key, &rv, defaultVal); + return rv; + } +static PyObject *_wrap_wxConfigBase_ReadBool(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxConfigBase * _arg0; + wxString * _arg1; + bool _arg2 = (bool ) FALSE; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + int tempbool2 = (int) FALSE; + char *_kwnames[] = { "self","key","defaultVal", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxConfigBase_ReadBool",_kwnames,&_argo0,&_obj1,&tempbool2)) return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxConfigBase_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxConfigBase_ReadBool. Expected _wxConfigBase_p."); return NULL; + } } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; } + _arg2 = (bool ) tempbool2; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (double )wxConfigBase_ReadFloat(_arg0,*_arg1,_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxConfigBase_ReadBool(_arg0,*_arg1,_arg2); - wxPy_END_ALLOW_THREADS; -} _resultobj = Py_BuildValue("d",_result); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); { if (_obj1) delete _arg1; @@ -1210,10 +1174,11 @@ static PyObject *_wrap_wxConfigBase_SetExpandEnvVars(PyObject *self, PyObject *a } _arg1 = (bool ) tempbool1; { - wxPy_BEGIN_ALLOW_THREADS; - wxConfigBase_SetExpandEnvVars(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxConfigBase_SetExpandEnvVars(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; return _resultobj; @@ -1239,28 +1204,16 @@ static PyObject *_wrap_wxConfigBase_SetPath(PyObject *self, PyObject *args, PyOb } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { - wxPy_BEGIN_ALLOW_THREADS; - wxConfigBase_SetPath(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxConfigBase_SetPath(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; { @@ -1291,10 +1244,11 @@ static PyObject *_wrap_wxConfigBase_SetRecordDefaults(PyObject *self, PyObject * } _arg1 = (bool ) tempbool1; { - wxPy_BEGIN_ALLOW_THREADS; - wxConfigBase_SetRecordDefaults(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxConfigBase_SetRecordDefaults(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; return _resultobj; @@ -1320,28 +1274,16 @@ static PyObject *_wrap_wxConfigBase_SetAppName(PyObject *self, PyObject *args, P } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { - wxPy_BEGIN_ALLOW_THREADS; - wxConfigBase_SetAppName(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxConfigBase_SetAppName(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; { @@ -1371,28 +1313,16 @@ static PyObject *_wrap_wxConfigBase_SetVendorName(PyObject *self, PyObject *args } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { - wxPy_BEGIN_ALLOW_THREADS; - wxConfigBase_SetVendorName(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxConfigBase_SetVendorName(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; { @@ -1421,10 +1351,11 @@ static PyObject *_wrap_wxConfigBase_SetStyle(PyObject *self, PyObject *args, PyO } } { - wxPy_BEGIN_ALLOW_THREADS; - wxConfigBase_SetStyle(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxConfigBase_SetStyle(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; return _resultobj; @@ -1449,10 +1380,11 @@ static PyObject *_wrap_wxConfigBase_GetStyle(PyObject *self, PyObject *args, PyO } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (long )wxConfigBase_GetStyle(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (long )wxConfigBase_GetStyle(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("l",_result); return _resultobj; } @@ -1480,46 +1412,21 @@ static PyObject *_wrap_wxConfigBase_Write(PyObject *self, PyObject *args, PyObje } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) return NULL; - _arg2 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); -#endif } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxConfigBase_Write(_arg0,*_arg1,*_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxConfigBase_Write(_arg0,*_arg1,*_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); { if (_obj1) @@ -1554,28 +1461,16 @@ static PyObject *_wrap_wxConfigBase_WriteInt(PyObject *self, PyObject *args, PyO } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxConfigBase_WriteInt(_arg0,*_arg1,_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxConfigBase_WriteInt(_arg0,*_arg1,_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); { if (_obj1) @@ -1606,28 +1501,58 @@ static PyObject *_wrap_wxConfigBase_WriteFloat(PyObject *self, PyObject *args, P } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxConfigBase_WriteFloat(_arg0,*_arg1,_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxConfigBase_WriteBool(_swigobj,_swigarg0,_swigarg1) (_swigobj->Write(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxConfigBase_WriteBool(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxConfigBase * _arg0; + wxString * _arg1; + bool _arg2; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + int tempbool2; + char *_kwnames[] = { "self","key","value", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi:wxConfigBase_WriteBool",_kwnames,&_argo0,&_obj1,&tempbool2)) return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxConfigBase_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxConfigBase_WriteBool. Expected _wxConfigBase_p."); return NULL; + } } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; } + _arg2 = (bool ) tempbool2; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxConfigBase_WriteFloat(_arg0,*_arg1,_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxConfigBase_WriteBool(_arg0,*_arg1,_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); { if (_obj1) @@ -1657,28 +1582,16 @@ static PyObject *_wrap_wxConfigBase_GetEntryType(PyObject *self, PyObject *args, } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxConfigBase::EntryType )wxConfigBase_GetEntryType(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxConfigBase::EntryType )wxConfigBase_GetEntryType(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); { if (_obj1) @@ -1710,46 +1623,21 @@ static PyObject *_wrap_wxConfigBase_RenameEntry(PyObject *self, PyObject *args, } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg2 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) return NULL; - } - _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); -#endif } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxConfigBase_RenameEntry(_arg0,*_arg1,*_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxConfigBase_RenameEntry(_arg0,*_arg1,*_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); { if (_obj1) @@ -1785,46 +1673,21 @@ static PyObject *_wrap_wxConfigBase_RenameGroup(PyObject *self, PyObject *args, } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) return NULL; - } - if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg2 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); -#endif } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxConfigBase_RenameGroup(_arg0,*_arg1,*_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxConfigBase_RenameGroup(_arg0,*_arg1,*_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); { if (_obj1) @@ -1858,30 +1721,22 @@ static PyObject *_wrap_wxConfigBase_ExpandEnvVars(PyObject *self, PyObject *args } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxString (wxConfigBase_ExpandEnvVars(_arg0,*_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxConfigBase_ExpandEnvVars(_arg0,*_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; }{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); +#else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif } { if (_obj1) @@ -1905,10 +1760,10 @@ static void *SwigwxConfigTowxConfigBase(void *ptr) { static PyObject *_wrap_new_wxConfig(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxConfig * _result; - wxString * _arg0 = (wxString *) &wxPyEmptyStr; - wxString * _arg1 = (wxString *) &wxPyEmptyStr; - wxString * _arg2 = (wxString *) &wxPyEmptyStr; - wxString * _arg3 = (wxString *) &wxPyEmptyStr; + wxString * _arg0 = (wxString *) &wxPyEmptyString; + wxString * _arg1 = (wxString *) &wxPyEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; + wxString * _arg3 = (wxString *) &wxPyEmptyString; long _arg4 = (long ) 0; PyObject * _obj0 = 0; PyObject * _obj1 = 0; @@ -1922,85 +1777,34 @@ static PyObject *_wrap_new_wxConfig(PyObject *self, PyObject *args, PyObject *kw return NULL; if (_obj0) { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) return NULL; - _arg0 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj0)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); -#endif } if (_obj1) { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } if (_obj2) { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) return NULL; - _arg2 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); -#endif } if (_obj3) { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) return NULL; - } - if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg3 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj3)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); -#endif } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxConfig *)new_wxConfig(*_arg0,*_arg1,*_arg2,*_arg3,_arg4); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxConfig *)new_wxConfig(*_arg0,*_arg1,*_arg2,*_arg3,_arg4); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxConfig_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -2045,10 +1849,11 @@ static PyObject *_wrap_delete_wxConfig(PyObject *self, PyObject *args, PyObject } } { - wxPy_BEGIN_ALLOW_THREADS; - delete_wxConfig(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + delete_wxConfig(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; return _resultobj; @@ -2066,10 +1871,10 @@ static void *SwigwxFileConfigTowxConfigBase(void *ptr) { static PyObject *_wrap_new_wxFileConfig(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxFileConfig * _result; - wxString * _arg0 = (wxString *) &wxPyEmptyStr; - wxString * _arg1 = (wxString *) &wxPyEmptyStr; - wxString * _arg2 = (wxString *) &wxPyEmptyStr; - wxString * _arg3 = (wxString *) &wxPyEmptyStr; + wxString * _arg0 = (wxString *) &wxPyEmptyString; + wxString * _arg1 = (wxString *) &wxPyEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; + wxString * _arg3 = (wxString *) &wxPyEmptyString; long _arg4 = (long ) 0; PyObject * _obj0 = 0; PyObject * _obj1 = 0; @@ -2083,85 +1888,34 @@ static PyObject *_wrap_new_wxFileConfig(PyObject *self, PyObject *args, PyObject return NULL; if (_obj0) { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) return NULL; - _arg0 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj0)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); -#endif } if (_obj1) { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } if (_obj2) { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) return NULL; - _arg2 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); -#endif } if (_obj3) { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) return NULL; - } - if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg3 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj3)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); -#endif } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxFileConfig *)new_wxFileConfig(*_arg0,*_arg1,*_arg2,*_arg3,_arg4); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxFileConfig *)new_wxFileConfig(*_arg0,*_arg1,*_arg2,*_arg3,_arg4); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxFileConfig_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -2206,10 +1960,11 @@ static PyObject *_wrap_delete_wxFileConfig(PyObject *self, PyObject *args, PyObj } } { - wxPy_BEGIN_ALLOW_THREADS; - delete_wxFileConfig(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + delete_wxFileConfig(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; return _resultobj; @@ -2224,10 +1979,11 @@ static PyObject *_wrap_wxDateTime_SetCountry(PyObject *self, PyObject *args, PyO if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i:wxDateTime_SetCountry",_kwnames,&_arg0)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime::SetCountry(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime::SetCountry(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; return _resultobj; @@ -2242,10 +1998,11 @@ static PyObject *_wrap_wxDateTime_GetCountry(PyObject *self, PyObject *args, PyO if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxDateTime_GetCountry",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDateTime::Country )wxDateTime::GetCountry(); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDateTime::Country )wxDateTime::GetCountry(); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -2260,10 +2017,11 @@ static PyObject *_wrap_wxDateTime_IsWestEuropeanCountry(PyObject *self, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|i:wxDateTime_IsWestEuropeanCountry",_kwnames,&_arg0)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxDateTime::IsWestEuropeanCountry(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxDateTime::IsWestEuropeanCountry(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -2278,10 +2036,11 @@ static PyObject *_wrap_wxDateTime_GetCurrentYear(PyObject *self, PyObject *args, if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|i:wxDateTime_GetCurrentYear",_kwnames,&_arg0)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxDateTime::GetCurrentYear(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxDateTime::GetCurrentYear(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -2296,10 +2055,11 @@ static PyObject *_wrap_wxDateTime_ConvertYearToBC(PyObject *self, PyObject *args if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i:wxDateTime_ConvertYearToBC",_kwnames,&_arg0)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxDateTime::ConvertYearToBC(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxDateTime::ConvertYearToBC(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -2314,10 +2074,11 @@ static PyObject *_wrap_wxDateTime_GetCurrentMonth(PyObject *self, PyObject *args if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|i:wxDateTime_GetCurrentMonth",_kwnames,&_arg0)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDateTime::Month )wxDateTime::GetCurrentMonth(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDateTime::Month )wxDateTime::GetCurrentMonth(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -2333,10 +2094,11 @@ static PyObject *_wrap_wxDateTime_IsLeapYear(PyObject *self, PyObject *args, PyO if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|ii:wxDateTime_IsLeapYear",_kwnames,&_arg0,&_arg1)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxDateTime::IsLeapYear(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxDateTime::IsLeapYear(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -2351,10 +2113,11 @@ static PyObject *_wrap_wxDateTime_GetCentury(PyObject *self, PyObject *args, PyO if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|i:wxDateTime_GetCentury",_kwnames,&_arg0)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxDateTime::GetCentury(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxDateTime::GetCentury(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -2370,10 +2133,11 @@ static PyObject *_wrap_wxDateTime_GetNumberOfDaysinYear(PyObject *self, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i|i:wxDateTime_GetNumberOfDaysinYear",_kwnames,&_arg0,&_arg1)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDateTime::wxDateTime_t )wxDateTime::GetNumberOfDays(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDateTime::wxDateTime_t )wxDateTime::GetNumberOfDays(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("h",_result); return _resultobj; } @@ -2390,10 +2154,11 @@ static PyObject *_wrap_wxDateTime_GetNumberOfDaysInMonth(PyObject *self, PyObjec if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i|ii:wxDateTime_GetNumberOfDaysInMonth",_kwnames,&_arg0,&_arg1,&_arg2)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDateTime::wxDateTime_t )wxDateTime::GetNumberOfDays(_arg0,_arg1,_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDateTime::wxDateTime_t )wxDateTime::GetNumberOfDays(_arg0,_arg1,_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("h",_result); return _resultobj; } @@ -2409,12 +2174,17 @@ static PyObject *_wrap_wxDateTime_GetMonthName(PyObject *self, PyObject *args, P if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i|i:wxDateTime_GetMonthName",_kwnames,&_arg0,&_arg1)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxString (wxDateTime::GetMonthName(_arg0,_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxDateTime::GetMonthName(_arg0,_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; }{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); +#else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif } { delete _result; @@ -2433,12 +2203,17 @@ static PyObject *_wrap_wxDateTime_GetWeekDayName(PyObject *self, PyObject *args, if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i|i:wxDateTime_GetWeekDayName",_kwnames,&_arg0,&_arg1)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxString (wxDateTime::GetWeekDayName(_arg0,_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxDateTime::GetWeekDayName(_arg0,_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; }{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); +#else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif } { delete _result; @@ -2458,46 +2233,21 @@ static PyObject *_wrap_wxDateTime_GetAmPmStrings(PyObject *self, PyObject *args, if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDateTime_GetAmPmStrings",_kwnames,&_obj0,&_obj1)) return NULL; { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) return NULL; - _arg0 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj0)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); -#endif } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime::GetAmPmStrings(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime::GetAmPmStrings(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; { @@ -2522,10 +2272,11 @@ static PyObject *_wrap_wxDateTime_IsDSTApplicable(PyObject *self, PyObject *args if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|ii:wxDateTime_IsDSTApplicable",_kwnames,&_arg0,&_arg1)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxDateTime::IsDSTApplicable(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxDateTime::IsDSTApplicable(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -2542,10 +2293,11 @@ static PyObject *_wrap_wxDateTime_GetBeginDST(PyObject *self, PyObject *args, Py if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|ii:wxDateTime_GetBeginDST",_kwnames,&_arg0,&_arg1)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateTime (wxDateTime::GetBeginDST(_arg0,_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateTime (wxDateTime::GetBeginDST(_arg0,_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -2563,10 +2315,11 @@ static PyObject *_wrap_wxDateTime_GetEndDST(PyObject *self, PyObject *args, PyOb if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|ii:wxDateTime_GetEndDST",_kwnames,&_arg0,&_arg1)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateTime (wxDateTime::GetEndDST(_arg0,_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateTime (wxDateTime::GetEndDST(_arg0,_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -2582,10 +2335,31 @@ static PyObject *_wrap_wxDateTime_Now(PyObject *self, PyObject *args, PyObject * if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxDateTime_Now",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateTime (wxDateTime::Now()); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateTime (wxDateTime::Now()); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateTime_p"); + _resultobj = Py_BuildValue("s",_ptemp); + return _resultobj; +} + +static PyObject *_wrap_wxDateTime_UNow(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxDateTime * _result; + char *_kwnames[] = { NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxDateTime_UNow",_kwnames)) + return NULL; +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateTime (wxDateTime::UNow()); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -2601,10 +2375,11 @@ static PyObject *_wrap_wxDateTime_Today(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxDateTime_Today",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateTime (wxDateTime::Today()); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateTime (wxDateTime::Today()); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -2621,10 +2396,11 @@ static PyObject *_wrap_new_wxDateTime(PyObject *self, PyObject *args, PyObject * if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxDateTime",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDateTime *)new_wxDateTime(); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDateTime *)new_wxDateTime(); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -2647,10 +2423,11 @@ static PyObject *_wrap_new_wxDateTimeFromTimeT(PyObject *self, PyObject *args, P if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i:new_wxDateTimeFromTimeT",_kwnames,&_arg0)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDateTime *)new_wxDateTimeFromTimeT(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDateTime *)new_wxDateTimeFromTimeT(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -2673,10 +2450,11 @@ static PyObject *_wrap_new_wxDateTimeFromJDN(PyObject *self, PyObject *args, PyO if(!PyArg_ParseTupleAndKeywords(args,kwargs,"d:new_wxDateTimeFromJDN",_kwnames,&_arg0)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDateTime *)new_wxDateTimeFromJDN(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDateTime *)new_wxDateTimeFromJDN(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -2702,10 +2480,11 @@ static PyObject *_wrap_new_wxDateTimeFromHMS(PyObject *self, PyObject *args, PyO if(!PyArg_ParseTupleAndKeywords(args,kwargs,"h|hhh:new_wxDateTimeFromHMS",_kwnames,&_arg0,&_arg1,&_arg2,&_arg3)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDateTime *)new_wxDateTimeFromHMS(_arg0,_arg1,_arg2,_arg3); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDateTime *)new_wxDateTimeFromHMS(_arg0,_arg1,_arg2,_arg3); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -2734,10 +2513,11 @@ static PyObject *_wrap_new_wxDateTimeFromDMY(PyObject *self, PyObject *args, PyO if(!PyArg_ParseTupleAndKeywords(args,kwargs,"h|iihhhh:new_wxDateTimeFromDMY",_kwnames,&_arg0,&_arg1,&_arg2,&_arg3,&_arg4,&_arg5,&_arg6)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDateTime *)new_wxDateTimeFromDMY(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDateTime *)new_wxDateTimeFromDMY(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -2766,10 +2546,11 @@ static PyObject *_wrap_delete_wxDateTime(PyObject *self, PyObject *args, PyObjec } } { - wxPy_BEGIN_ALLOW_THREADS; - delete_wxDateTime(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + delete_wxDateTime(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; return _resultobj; @@ -2795,11 +2576,12 @@ static PyObject *_wrap_wxDateTime_SetToCurrent(PyObject *self, PyObject *args, P } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_SetToCurrent(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_SetToCurrent(_arg0); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -2831,11 +2613,12 @@ static PyObject *_wrap_wxDateTime_SetTimeT(PyObject *self, PyObject *args, PyObj } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_SetTimeT(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_SetTimeT(_arg0,_arg1); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -2867,11 +2650,12 @@ static PyObject *_wrap_wxDateTime_SetJDN(PyObject *self, PyObject *args, PyObjec } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_SetJDN(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_SetJDN(_arg0,_arg1); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -2906,11 +2690,12 @@ static PyObject *_wrap_wxDateTime_SetHMS(PyObject *self, PyObject *args, PyObjec } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_SetHMS(_arg0,_arg1,_arg2,_arg3,_arg4); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_SetHMS(_arg0,_arg1,_arg2,_arg3,_arg4); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -2948,11 +2733,12 @@ static PyObject *_wrap_wxDateTime_Set(PyObject *self, PyObject *args, PyObject * } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_Set(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6,_arg7); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_Set(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6,_arg7); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -2983,11 +2769,12 @@ static PyObject *_wrap_wxDateTime_ResetTime(PyObject *self, PyObject *args, PyOb } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_ResetTime(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_ResetTime(_arg0); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -3019,11 +2806,12 @@ static PyObject *_wrap_wxDateTime_SetYear(PyObject *self, PyObject *args, PyObje } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_SetYear(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_SetYear(_arg0,_arg1); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -3055,11 +2843,12 @@ static PyObject *_wrap_wxDateTime_SetMonth(PyObject *self, PyObject *args, PyObj } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_SetMonth(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_SetMonth(_arg0,_arg1); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -3091,11 +2880,12 @@ static PyObject *_wrap_wxDateTime_SetDay(PyObject *self, PyObject *args, PyObjec } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_SetDay(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_SetDay(_arg0,_arg1); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -3127,11 +2917,12 @@ static PyObject *_wrap_wxDateTime_SetHour(PyObject *self, PyObject *args, PyObje } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_SetHour(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_SetHour(_arg0,_arg1); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -3163,11 +2954,12 @@ static PyObject *_wrap_wxDateTime_SetMinute(PyObject *self, PyObject *args, PyOb } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_SetMinute(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_SetMinute(_arg0,_arg1); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -3199,11 +2991,12 @@ static PyObject *_wrap_wxDateTime_SetSecond(PyObject *self, PyObject *args, PyOb } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_SetSecond(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_SetSecond(_arg0,_arg1); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -3235,11 +3028,12 @@ static PyObject *_wrap_wxDateTime_SetMillisecond(PyObject *self, PyObject *args, } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_SetMillisecond(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_SetMillisecond(_arg0,_arg1); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -3250,18 +3044,19 @@ static PyObject *_wrap_wxDateTime_SetMillisecond(PyObject *self, PyObject *args, return _resultobj; } -#define wxDateTime_SetToWeekDayInSameWeek(_swigobj,_swigarg0) (_swigobj->SetToWeekDayInSameWeek(_swigarg0)) +#define wxDateTime_SetToWeekDayInSameWeek(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetToWeekDayInSameWeek(_swigarg0,_swigarg1)) static PyObject *_wrap_wxDateTime_SetToWeekDayInSameWeek(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxDateTime * _result; wxDateTime * _arg0; wxDateTime::WeekDay _arg1; + wxDateTime::WeekFlags _arg2 = (wxDateTime::WeekFlags ) wxDateTime::Monday_First; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","weekday", NULL }; + char *_kwnames[] = { "self","weekday","flags", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxDateTime_SetToWeekDayInSameWeek",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|i:wxDateTime_SetToWeekDayInSameWeek",_kwnames,&_argo0,&_arg1,&_arg2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3271,11 +3066,12 @@ static PyObject *_wrap_wxDateTime_SetToWeekDayInSameWeek(PyObject *self, PyObjec } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_SetToWeekDayInSameWeek(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_SetToWeekDayInSameWeek(_arg0,_arg1,_arg2); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -3286,18 +3082,19 @@ static PyObject *_wrap_wxDateTime_SetToWeekDayInSameWeek(PyObject *self, PyObjec return _resultobj; } -#define wxDateTime_GetWeekDayInSameWeek(_swigobj,_swigarg0) (_swigobj->GetWeekDayInSameWeek(_swigarg0)) +#define wxDateTime_GetWeekDayInSameWeek(_swigobj,_swigarg0,_swigarg1) (_swigobj->GetWeekDayInSameWeek(_swigarg0,_swigarg1)) static PyObject *_wrap_wxDateTime_GetWeekDayInSameWeek(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxDateTime * _result; wxDateTime * _arg0; wxDateTime::WeekDay _arg1; + wxDateTime::WeekFlags _arg2 = (wxDateTime::WeekFlags ) wxDateTime::Monday_First; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","weekday", NULL }; + char *_kwnames[] = { "self","weekday","flags", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxDateTime_GetWeekDayInSameWeek",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|i:wxDateTime_GetWeekDayInSameWeek",_kwnames,&_argo0,&_arg1,&_arg2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3307,10 +3104,11 @@ static PyObject *_wrap_wxDateTime_GetWeekDayInSameWeek(PyObject *self, PyObject } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateTime (wxDateTime_GetWeekDayInSameWeek(_arg0,_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateTime (wxDateTime_GetWeekDayInSameWeek(_arg0,_arg1,_arg2)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -3337,11 +3135,12 @@ static PyObject *_wrap_wxDateTime_SetToNextWeekDay(PyObject *self, PyObject *arg } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_SetToNextWeekDay(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_SetToNextWeekDay(_arg0,_arg1); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -3373,10 +3172,11 @@ static PyObject *_wrap_wxDateTime_GetNextWeekDay(PyObject *self, PyObject *args, } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateTime (wxDateTime_GetNextWeekDay(_arg0,_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateTime (wxDateTime_GetNextWeekDay(_arg0,_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -3403,11 +3203,12 @@ static PyObject *_wrap_wxDateTime_SetToPrevWeekDay(PyObject *self, PyObject *arg } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_SetToPrevWeekDay(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_SetToPrevWeekDay(_arg0,_arg1); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -3439,10 +3240,11 @@ static PyObject *_wrap_wxDateTime_GetPrevWeekDay(PyObject *self, PyObject *args, } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateTime (wxDateTime_GetPrevWeekDay(_arg0,_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateTime (wxDateTime_GetPrevWeekDay(_arg0,_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -3471,47 +3273,15 @@ static PyObject *_wrap_wxDateTime_SetToWeekDay(PyObject *self, PyObject *args, P } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxDateTime_SetToWeekDay(_arg0,_arg1,_arg2,_arg3,_arg4); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxDateTime_SetToWeekDay(_arg0,_arg1,_arg2,_arg3,_arg4); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } -#define wxDateTime_GetWeekDay(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->GetWeekDay(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) -static PyObject *_wrap_wxDateTime_GetWeekDay(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxDateTime * _result; - wxDateTime * _arg0; - wxDateTime::WeekDay _arg1; - int _arg2 = (int ) 1; - wxDateTime::Month _arg3 = (wxDateTime::Month ) wxDateTime::Inv_Month; - int _arg4 = (int ) wxDateTime::Inv_Year; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self","weekday","n","month","year", NULL }; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|iii:wxDateTime_GetWeekDay",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3,&_arg4)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDateTime_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDateTime_GetWeekDay. Expected _wxDateTime_p."); - return NULL; - } - } -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateTime (wxDateTime_GetWeekDay(_arg0,_arg1,_arg2,_arg3,_arg4)); - - wxPy_END_ALLOW_THREADS; -} SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateTime_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - #define wxDateTime_SetToLastWeekDay(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->SetToLastWeekDay(_swigarg0,_swigarg1,_swigarg2)) static PyObject *_wrap_wxDateTime_SetToLastWeekDay(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -3534,10 +3304,11 @@ static PyObject *_wrap_wxDateTime_SetToLastWeekDay(PyObject *self, PyObject *arg } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxDateTime_SetToLastWeekDay(_arg0,_arg1,_arg2,_arg3); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxDateTime_SetToLastWeekDay(_arg0,_arg1,_arg2,_arg3); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -3565,27 +3336,29 @@ static PyObject *_wrap_wxDateTime_GetLastWeekDay(PyObject *self, PyObject *args, } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateTime (wxDateTime_GetLastWeekDay(_arg0,_arg1,_arg2,_arg3)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateTime (wxDateTime_GetLastWeekDay(_arg0,_arg1,_arg2,_arg3)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; } -#define wxDateTime_SetToTheWeek(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetToTheWeek(_swigarg0,_swigarg1)) +#define wxDateTime_SetToTheWeek(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->SetToTheWeek(_swigarg0,_swigarg1,_swigarg2)) static PyObject *_wrap_wxDateTime_SetToTheWeek(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; bool _result; wxDateTime * _arg0; wxDateTime::wxDateTime_t _arg1; wxDateTime::WeekDay _arg2 = (wxDateTime::WeekDay ) wxDateTime::Mon; + wxDateTime::WeekFlags _arg3 = (wxDateTime::WeekFlags ) wxDateTime::Monday_First; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","numWeek","weekday", NULL }; + char *_kwnames[] = { "self","numWeek","weekday","flags", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oh|i:wxDateTime_SetToTheWeek",_kwnames,&_argo0,&_arg1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oh|ii:wxDateTime_SetToTheWeek",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3595,27 +3368,29 @@ static PyObject *_wrap_wxDateTime_SetToTheWeek(PyObject *self, PyObject *args, P } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxDateTime_SetToTheWeek(_arg0,_arg1,_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxDateTime_SetToTheWeek(_arg0,_arg1,_arg2,_arg3); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } -#define wxDateTime_GetWeek(_swigobj,_swigarg0,_swigarg1) (_swigobj->GetWeek(_swigarg0,_swigarg1)) +#define wxDateTime_GetWeek(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->GetWeek(_swigarg0,_swigarg1,_swigarg2)) static PyObject *_wrap_wxDateTime_GetWeek(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxDateTime * _result; wxDateTime * _arg0; wxDateTime::wxDateTime_t _arg1; wxDateTime::WeekDay _arg2 = (wxDateTime::WeekDay ) wxDateTime::Mon; + wxDateTime::WeekFlags _arg3 = (wxDateTime::WeekFlags ) wxDateTime::Monday_First; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","numWeek","weekday", NULL }; + char *_kwnames[] = { "self","numWeek","weekday","flags", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oh|i:wxDateTime_GetWeek",_kwnames,&_argo0,&_arg1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oh|ii:wxDateTime_GetWeek",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3625,10 +3400,11 @@ static PyObject *_wrap_wxDateTime_GetWeek(PyObject *self, PyObject *args, PyObje } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateTime (wxDateTime_GetWeek(_arg0,_arg1,_arg2)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateTime (wxDateTime_GetWeek(_arg0,_arg1,_arg2,_arg3)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -3656,11 +3432,12 @@ static PyObject *_wrap_wxDateTime_SetToLastMonthDay(PyObject *self, PyObject *ar } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_SetToLastMonthDay(_arg0,_arg1,_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_SetToLastMonthDay(_arg0,_arg1,_arg2); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -3693,10 +3470,11 @@ static PyObject *_wrap_wxDateTime_GetLastMonthDay(PyObject *self, PyObject *args } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateTime (wxDateTime_GetLastMonthDay(_arg0,_arg1,_arg2)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateTime (wxDateTime_GetLastMonthDay(_arg0,_arg1,_arg2)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -3723,11 +3501,12 @@ static PyObject *_wrap_wxDateTime_SetToYearDay(PyObject *self, PyObject *args, P } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_SetToYearDay(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_SetToYearDay(_arg0,_arg1); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -3759,10 +3538,11 @@ static PyObject *_wrap_wxDateTime_GetYearDay(PyObject *self, PyObject *args, PyO } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateTime (wxDateTime_GetYearDay(_arg0,_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateTime (wxDateTime_GetYearDay(_arg0,_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -3787,10 +3567,11 @@ static PyObject *_wrap_wxDateTime_GetJulianDayNumber(PyObject *self, PyObject *a } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (double )wxDateTime_GetJulianDayNumber(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (double )wxDateTime_GetJulianDayNumber(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("d",_result); return _resultobj; } @@ -3814,10 +3595,11 @@ static PyObject *_wrap_wxDateTime_GetJDN(PyObject *self, PyObject *args, PyObjec } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (double )wxDateTime_GetJDN(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (double )wxDateTime_GetJDN(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("d",_result); return _resultobj; } @@ -3841,10 +3623,11 @@ static PyObject *_wrap_wxDateTime_GetModifiedJulianDayNumber(PyObject *self, PyO } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (double )wxDateTime_GetModifiedJulianDayNumber(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (double )wxDateTime_GetModifiedJulianDayNumber(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("d",_result); return _resultobj; } @@ -3868,10 +3651,11 @@ static PyObject *_wrap_wxDateTime_GetMJD(PyObject *self, PyObject *args, PyObjec } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (double )wxDateTime_GetMJD(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (double )wxDateTime_GetMJD(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("d",_result); return _resultobj; } @@ -3895,10 +3679,11 @@ static PyObject *_wrap_wxDateTime_GetRataDie(PyObject *self, PyObject *args, PyO } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (double )wxDateTime_GetRataDie(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (double )wxDateTime_GetRataDie(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("d",_result); return _resultobj; } @@ -3931,10 +3716,11 @@ static PyObject *_wrap_wxDateTime_ToTimezone(PyObject *self, PyObject *args, PyO } _arg2 = (bool ) tempbool2; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateTime (wxDateTime_ToTimezone(_arg0,*_arg1,_arg2)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateTime (wxDateTime_ToTimezone(_arg0,*_arg1,_arg2)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); { @@ -3971,11 +3757,12 @@ static PyObject *_wrap_wxDateTime_MakeTimezone(PyObject *self, PyObject *args, P } _arg2 = (bool ) tempbool2; { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_MakeTimezone(_arg0,*_arg1,_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_MakeTimezone(_arg0,*_arg1,_arg2); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -4012,10 +3799,11 @@ static PyObject *_wrap_wxDateTime_ToGMT(PyObject *self, PyObject *args, PyObject } _arg1 = (bool ) tempbool1; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateTime (wxDateTime_ToGMT(_arg0,_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateTime (wxDateTime_ToGMT(_arg0,_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -4044,11 +3832,12 @@ static PyObject *_wrap_wxDateTime_MakeGMT(PyObject *self, PyObject *args, PyObje } _arg1 = (bool ) tempbool1; { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_MakeGMT(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_MakeGMT(_arg0,_arg1); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -4079,10 +3868,11 @@ static PyObject *_wrap_wxDateTime_IsDST(PyObject *self, PyObject *args, PyObject } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxDateTime_IsDST(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxDateTime_IsDST(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -4106,10 +3896,11 @@ static PyObject *_wrap_wxDateTime_IsValid(PyObject *self, PyObject *args, PyObje } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxDateTime_IsValid(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxDateTime_IsValid(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -4133,10 +3924,11 @@ static PyObject *_wrap_wxDateTime_GetTicks(PyObject *self, PyObject *args, PyObj } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (time_t )wxDateTime_GetTicks(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (time_t )wxDateTime_GetTicks(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -4166,10 +3958,11 @@ static PyObject *_wrap_wxDateTime_GetYear(PyObject *self, PyObject *args, PyObje _arg1 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(_obj1)); } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxDateTime_GetYear(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxDateTime_GetYear(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); { if (_arg1) delete _arg1; @@ -4202,10 +3995,11 @@ static PyObject *_wrap_wxDateTime_GetMonth(PyObject *self, PyObject *args, PyObj _arg1 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(_obj1)); } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDateTime::Month )wxDateTime_GetMonth(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDateTime::Month )wxDateTime_GetMonth(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); { if (_arg1) delete _arg1; @@ -4238,10 +4032,11 @@ static PyObject *_wrap_wxDateTime_GetDay(PyObject *self, PyObject *args, PyObjec _arg1 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(_obj1)); } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDateTime::wxDateTime_t )wxDateTime_GetDay(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDateTime::wxDateTime_t )wxDateTime_GetDay(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("h",_result); { if (_arg1) delete _arg1; @@ -4249,6 +4044,43 @@ static PyObject *_wrap_wxDateTime_GetDay(PyObject *self, PyObject *args, PyObjec return _resultobj; } +#define wxDateTime_GetWeekDay(_swigobj,_swigarg0) (_swigobj->GetWeekDay(_swigarg0)) +static PyObject *_wrap_wxDateTime_GetWeekDay(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxDateTime::WeekDay _result; + wxDateTime * _arg0; + wxDateTime::TimeZone * _arg1 = (wxDateTime::TimeZone *) &LOCAL; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","tz", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:wxDateTime_GetWeekDay",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDateTime_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDateTime_GetWeekDay. Expected _wxDateTime_p."); + return NULL; + } + } + if (_obj1) +{ + _arg1 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(_obj1)); +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDateTime::WeekDay )wxDateTime_GetWeekDay(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_arg1) delete _arg1; +} + return _resultobj; +} + #define wxDateTime_GetHour(_swigobj,_swigarg0) (_swigobj->GetHour(_swigarg0)) static PyObject *_wrap_wxDateTime_GetHour(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -4274,10 +4106,11 @@ static PyObject *_wrap_wxDateTime_GetHour(PyObject *self, PyObject *args, PyObje _arg1 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(_obj1)); } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDateTime::wxDateTime_t )wxDateTime_GetHour(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDateTime::wxDateTime_t )wxDateTime_GetHour(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("h",_result); { if (_arg1) delete _arg1; @@ -4310,10 +4143,11 @@ static PyObject *_wrap_wxDateTime_GetMinute(PyObject *self, PyObject *args, PyOb _arg1 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(_obj1)); } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDateTime::wxDateTime_t )wxDateTime_GetMinute(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDateTime::wxDateTime_t )wxDateTime_GetMinute(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("h",_result); { if (_arg1) delete _arg1; @@ -4346,10 +4180,11 @@ static PyObject *_wrap_wxDateTime_GetSecond(PyObject *self, PyObject *args, PyOb _arg1 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(_obj1)); } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDateTime::wxDateTime_t )wxDateTime_GetSecond(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDateTime::wxDateTime_t )wxDateTime_GetSecond(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("h",_result); { if (_arg1) delete _arg1; @@ -4382,10 +4217,11 @@ static PyObject *_wrap_wxDateTime_GetMillisecond(PyObject *self, PyObject *args, _arg1 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(_obj1)); } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDateTime::wxDateTime_t )wxDateTime_GetMillisecond(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDateTime::wxDateTime_t )wxDateTime_GetMillisecond(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("h",_result); { if (_arg1) delete _arg1; @@ -4418,10 +4254,11 @@ static PyObject *_wrap_wxDateTime_GetDayOfYear(PyObject *self, PyObject *args, P _arg1 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(_obj1)); } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDateTime::wxDateTime_t )wxDateTime_GetDayOfYear(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDateTime::wxDateTime_t )wxDateTime_GetDayOfYear(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("h",_result); { if (_arg1) delete _arg1; @@ -4455,10 +4292,11 @@ static PyObject *_wrap_wxDateTime_GetWeekOfYear(PyObject *self, PyObject *args, _arg2 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(_obj2)); } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDateTime::wxDateTime_t )wxDateTime_GetWeekOfYear(_arg0,_arg1,*_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDateTime::wxDateTime_t )wxDateTime_GetWeekOfYear(_arg0,_arg1,*_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("h",_result); { if (_arg2) delete _arg2; @@ -4492,10 +4330,11 @@ static PyObject *_wrap_wxDateTime_GetWeekOfMonth(PyObject *self, PyObject *args, _arg2 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(_obj2)); } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDateTime::wxDateTime_t )wxDateTime_GetWeekOfMonth(_arg0,_arg1,*_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDateTime::wxDateTime_t )wxDateTime_GetWeekOfMonth(_arg0,_arg1,*_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("h",_result); { if (_arg2) delete _arg2; @@ -4523,10 +4362,11 @@ static PyObject *_wrap_wxDateTime_IsWorkDay(PyObject *self, PyObject *args, PyOb } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxDateTime_IsWorkDay(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxDateTime_IsWorkDay(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -4552,17 +4392,17 @@ static PyObject *_wrap_wxDateTime_IsEqualTo(PyObject *self, PyObject *args, PyOb } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateTime_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateTime_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateTime_IsEqualTo. Expected _wxDateTime_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxDateTime_IsEqualTo(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxDateTime_IsEqualTo(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -4588,17 +4428,17 @@ static PyObject *_wrap_wxDateTime_IsEarlierThan(PyObject *self, PyObject *args, } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateTime_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateTime_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateTime_IsEarlierThan. Expected _wxDateTime_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxDateTime_IsEarlierThan(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxDateTime_IsEarlierThan(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -4624,17 +4464,17 @@ static PyObject *_wrap_wxDateTime_IsLaterThan(PyObject *self, PyObject *args, Py } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateTime_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateTime_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateTime_IsLaterThan. Expected _wxDateTime_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxDateTime_IsLaterThan(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxDateTime_IsLaterThan(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -4662,24 +4502,23 @@ static PyObject *_wrap_wxDateTime_IsStrictlyBetween(PyObject *self, PyObject *ar } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateTime_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateTime_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateTime_IsStrictlyBetween. Expected _wxDateTime_p."); return NULL; } } if (_argo2) { - if (_argo2 == Py_None) { _arg2 = NULL; } - else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxDateTime_p")) { + if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxDateTime_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxDateTime_IsStrictlyBetween. Expected _wxDateTime_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxDateTime_IsStrictlyBetween(_arg0,*_arg1,*_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxDateTime_IsStrictlyBetween(_arg0,*_arg1,*_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -4707,24 +4546,23 @@ static PyObject *_wrap_wxDateTime_IsBetween(PyObject *self, PyObject *args, PyOb } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateTime_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateTime_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateTime_IsBetween. Expected _wxDateTime_p."); return NULL; } } if (_argo2) { - if (_argo2 == Py_None) { _arg2 = NULL; } - else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxDateTime_p")) { + if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxDateTime_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxDateTime_IsBetween. Expected _wxDateTime_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxDateTime_IsBetween(_arg0,*_arg1,*_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxDateTime_IsBetween(_arg0,*_arg1,*_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -4750,17 +4588,17 @@ static PyObject *_wrap_wxDateTime_IsSameDate(PyObject *self, PyObject *args, PyO } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateTime_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateTime_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateTime_IsSameDate. Expected _wxDateTime_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxDateTime_IsSameDate(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxDateTime_IsSameDate(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -4786,17 +4624,17 @@ static PyObject *_wrap_wxDateTime_IsSameTime(PyObject *self, PyObject *args, PyO } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateTime_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateTime_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateTime_IsSameTime. Expected _wxDateTime_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxDateTime_IsSameTime(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxDateTime_IsSameTime(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -4824,24 +4662,23 @@ static PyObject *_wrap_wxDateTime_IsEqualUpTo(PyObject *self, PyObject *args, Py } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateTime_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateTime_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateTime_IsEqualUpTo. Expected _wxDateTime_p."); return NULL; } } if (_argo2) { - if (_argo2 == Py_None) { _arg2 = NULL; } - else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxTimeSpan_p")) { + if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxTimeSpan_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxDateTime_IsEqualUpTo. Expected _wxTimeSpan_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxDateTime_IsEqualUpTo(_arg0,*_arg1,*_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxDateTime_IsEqualUpTo(_arg0,*_arg1,*_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -4868,18 +4705,18 @@ static PyObject *_wrap_wxDateTime_AddTS(PyObject *self, PyObject *args, PyObject } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTimeSpan_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTimeSpan_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateTime_AddTS. Expected _wxTimeSpan_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_AddTS(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_AddTS(_arg0,*_arg1); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -4912,18 +4749,18 @@ static PyObject *_wrap_wxDateTime_AddDS(PyObject *self, PyObject *args, PyObject } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateSpan_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateSpan_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateTime_AddDS. Expected _wxDateSpan_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_AddDS(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_AddDS(_arg0,*_arg1); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -4956,18 +4793,18 @@ static PyObject *_wrap_wxDateTime_SubtractTS(PyObject *self, PyObject *args, PyO } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTimeSpan_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTimeSpan_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateTime_SubtractTS. Expected _wxTimeSpan_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_SubtractTS(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_SubtractTS(_arg0,*_arg1); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -5000,18 +4837,18 @@ static PyObject *_wrap_wxDateTime_SubtractDS(PyObject *self, PyObject *args, PyO } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateSpan_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateSpan_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateTime_SubtractDS. Expected _wxDateSpan_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateTime & _result_ref = wxDateTime_SubtractDS(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateTime & _result_ref = wxDateTime_SubtractDS(_arg0,*_arg1); _result = (wxDateTime *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -5044,17 +4881,17 @@ static PyObject *_wrap_wxDateTime_Subtract(PyObject *self, PyObject *args, PyObj } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateTime_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateTime_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateTime_Subtract. Expected _wxDateTime_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxTimeSpan (wxDateTime_Subtract(_arg0,*_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxTimeSpan (wxDateTime_Subtract(_arg0,*_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -5082,17 +4919,17 @@ static PyObject *_wrap_wxDateTime___add__TS(PyObject *self, PyObject *args, PyOb } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTimeSpan_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTimeSpan_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateTime___add__TS. Expected _wxTimeSpan_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateTime (wxDateTime___add__TS(_arg0,*_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateTime (wxDateTime___add__TS(_arg0,*_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -5120,17 +4957,17 @@ static PyObject *_wrap_wxDateTime___add__DS(PyObject *self, PyObject *args, PyOb } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateSpan_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateSpan_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateTime___add__DS. Expected _wxDateSpan_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateTime (wxDateTime___add__DS(_arg0,*_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateTime (wxDateTime___add__DS(_arg0,*_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -5158,17 +4995,17 @@ static PyObject *_wrap_wxDateTime___sub__DT(PyObject *self, PyObject *args, PyOb } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateTime_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateTime_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateTime___sub__DT. Expected _wxDateTime_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxTimeSpan (wxDateTime___sub__DT(_arg0,*_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxTimeSpan (wxDateTime___sub__DT(_arg0,*_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -5196,17 +5033,17 @@ static PyObject *_wrap_wxDateTime___sub__TS(PyObject *self, PyObject *args, PyOb } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTimeSpan_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTimeSpan_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateTime___sub__TS. Expected _wxTimeSpan_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateTime (wxDateTime___sub__TS(_arg0,*_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateTime (wxDateTime___sub__TS(_arg0,*_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -5234,25 +5071,26 @@ static PyObject *_wrap_wxDateTime___sub__DS(PyObject *self, PyObject *args, PyOb } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateSpan_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateSpan_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateTime___sub__DS. Expected _wxDateSpan_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateTime (wxDateTime___sub__DS(_arg0,*_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateTime (wxDateTime___sub__DS(_arg0,*_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateTime_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; } -static int wxDateTime___cmp__(wxDateTime *self,const wxDateTime & other) { - if (*self < other) return -1; - if (*self == other) return 0; +static int wxDateTime___cmp__(wxDateTime *self,const wxDateTime * other) { + if (! other) return -1; + if (*self < *other) return -1; + if (*self == *other) return 0; return 1; } static PyObject *_wrap_wxDateTime___cmp__(PyObject *self, PyObject *args, PyObject *kwargs) { @@ -5282,25 +5120,33 @@ static PyObject *_wrap_wxDateTime___cmp__(PyObject *self, PyObject *args, PyObje } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxDateTime___cmp__(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxDateTime___cmp__(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } -#define wxDateTime_ParseRfc822Date(_swigobj,_swigarg0) (_swigobj->ParseRfc822Date(_swigarg0)) +static int wxDateTime_ParseRfc822Date(wxDateTime *self,const wxString & date) { + const wxChar* rv; + const wxChar* _date = date; + rv = self->ParseRfc822Date(_date); + if (rv == NULL) return -1; + return rv - _date; + } static PyObject *_wrap_wxDateTime_ParseRfc822Date(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - char * _result; + int _result; wxDateTime * _arg0; - char * _arg1; + wxString * _arg1; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","date", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxDateTime_ParseRfc822Date",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDateTime_ParseRfc822Date",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -5310,28 +5156,46 @@ static PyObject *_wrap_wxDateTime_ParseRfc822Date(PyObject *self, PyObject *args } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (char *)wxDateTime_ParseRfc822Date(_arg0,_arg1); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxDateTime_ParseRfc822Date(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; -} _resultobj = Py_BuildValue("s", _result); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} return _resultobj; } -#define wxDateTime_ParseFormat(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->ParseFormat(_swigarg0,_swigarg1,_swigarg2)) +static int wxDateTime_ParseFormat(wxDateTime *self,const wxString & date,const wxString & format,const wxDateTime & dateDef) { + const wxChar* rv; + const wxChar* _date = date; + rv = self->ParseFormat(_date, format, dateDef); + if (rv == NULL) return -1; + return rv - _date; + } static PyObject *_wrap_wxDateTime_ParseFormat(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - char * _result; + int _result; wxDateTime * _arg0; - char * _arg1; - char * _arg2 = (char *) "%c"; + wxString * _arg1; + wxString * _arg2 = (wxString *) &wxPyDateFormatStr; wxDateTime * _arg3 = (wxDateTime *) &wxDefaultDateTime; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + PyObject * _obj2 = 0; PyObject * _argo3 = 0; char *_kwnames[] = { "self","date","format","dateDef", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os|sO:wxDateTime_ParseFormat",_kwnames,&_argo0,&_arg1,&_arg2,&_argo3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|OO:wxDateTime_ParseFormat",_kwnames,&_argo0,&_obj1,&_obj2,&_argo3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -5340,33 +5204,59 @@ static PyObject *_wrap_wxDateTime_ParseFormat(PyObject *self, PyObject *args, Py return NULL; } } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} + if (_obj2) +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} if (_argo3) { - if (_argo3 == Py_None) { _arg3 = NULL; } - else if (SWIG_GetPtrObj(_argo3,(void **) &_arg3,"_wxDateTime_p")) { + if (SWIG_GetPtrObj(_argo3,(void **) &_arg3,"_wxDateTime_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 4 of wxDateTime_ParseFormat. Expected _wxDateTime_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (char *)wxDateTime_ParseFormat(_arg0,_arg1,_arg2,*_arg3); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxDateTime_ParseFormat(_arg0,*_arg1,*_arg2,*_arg3); - wxPy_END_ALLOW_THREADS; -} _resultobj = Py_BuildValue("s", _result); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} +{ + if (_obj2) + delete _arg2; +} return _resultobj; } -#define wxDateTime_ParseDateTime(_swigobj,_swigarg0) (_swigobj->ParseDateTime(_swigarg0)) +static int wxDateTime_ParseDateTime(wxDateTime *self,const wxString & datetime) { + const wxChar* rv; + const wxChar* _datetime = datetime; + rv = self->ParseDateTime(_datetime); + if (rv == NULL) return -1; + return rv - _datetime; + } static PyObject *_wrap_wxDateTime_ParseDateTime(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - char * _result; + int _result; wxDateTime * _arg0; - char * _arg1; + wxString * _arg1; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","datetime", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxDateTime_ParseDateTime",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDateTime_ParseDateTime",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -5376,25 +5266,42 @@ static PyObject *_wrap_wxDateTime_ParseDateTime(PyObject *self, PyObject *args, } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (char *)wxDateTime_ParseDateTime(_arg0,_arg1); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxDateTime_ParseDateTime(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; -} _resultobj = Py_BuildValue("s", _result); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} return _resultobj; } -#define wxDateTime_ParseDate(_swigobj,_swigarg0) (_swigobj->ParseDate(_swigarg0)) +static int wxDateTime_ParseDate(wxDateTime *self,const wxString & date) { + const wxChar* rv; + const wxChar* _date = date; + rv = self->ParseDate(_date); + if (rv == NULL) return -1; + return rv - _date; + } static PyObject *_wrap_wxDateTime_ParseDate(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - char * _result; + int _result; wxDateTime * _arg0; - char * _arg1; + wxString * _arg1; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","date", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxDateTime_ParseDate",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDateTime_ParseDate",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -5404,25 +5311,42 @@ static PyObject *_wrap_wxDateTime_ParseDate(PyObject *self, PyObject *args, PyOb } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (char *)wxDateTime_ParseDate(_arg0,_arg1); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxDateTime_ParseDate(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; -} _resultobj = Py_BuildValue("s", _result); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} return _resultobj; } -#define wxDateTime_ParseTime(_swigobj,_swigarg0) (_swigobj->ParseTime(_swigarg0)) +static int wxDateTime_ParseTime(wxDateTime *self,const wxString & time) { + const wxChar* rv; + const wxChar* _time = time; + rv = self->ParseTime(_time); + if (rv == NULL) return -1; + return rv - _time; + } static PyObject *_wrap_wxDateTime_ParseTime(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - char * _result; + int _result; wxDateTime * _arg0; - char * _arg1; + wxString * _arg1; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","time", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxDateTime_ParseTime",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDateTime_ParseTime",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -5432,11 +5356,21 @@ static PyObject *_wrap_wxDateTime_ParseTime(PyObject *self, PyObject *args, PyOb } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (char *)wxDateTime_ParseTime(_arg0,_arg1); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxDateTime_ParseTime(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; -} _resultobj = Py_BuildValue("s", _result); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} return _resultobj; } @@ -5445,14 +5379,15 @@ static PyObject *_wrap_wxDateTime_Format(PyObject *self, PyObject *args, PyObjec PyObject * _resultobj; wxString * _result; wxDateTime * _arg0; - char * _arg1 = (char *) "%c"; + wxString * _arg1 = (wxString *) &wxPyDateFormatStr; wxDateTime::TimeZone * _arg2 = (wxDateTime::TimeZone *) &LOCAL; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; PyObject * _obj2 = 0; char *_kwnames[] = { "self","format","tz", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|sO:wxDateTime_Format",_kwnames,&_argo0,&_arg1,&_obj2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OO:wxDateTime_Format",_kwnames,&_argo0,&_obj1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -5461,17 +5396,32 @@ static PyObject *_wrap_wxDateTime_Format(PyObject *self, PyObject *args, PyObjec return NULL; } } + if (_obj1) +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} if (_obj2) { _arg2 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(_obj2)); } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxString (wxDateTime_Format(_arg0,_arg1,*_arg2)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxDateTime_Format(_arg0,*_arg1,*_arg2)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; }{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); +#else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + if (_obj1) + delete _arg1; } { if (_arg2) delete _arg2; @@ -5501,12 +5451,17 @@ static PyObject *_wrap_wxDateTime_FormatDate(PyObject *self, PyObject *args, PyO } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxString (wxDateTime_FormatDate(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxDateTime_FormatDate(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; }{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); +#else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif } { delete _result; @@ -5533,12 +5488,17 @@ static PyObject *_wrap_wxDateTime_FormatTime(PyObject *self, PyObject *args, PyO } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxString (wxDateTime_FormatTime(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxDateTime_FormatTime(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; }{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); +#else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif } { delete _result; @@ -5565,12 +5525,17 @@ static PyObject *_wrap_wxDateTime_FormatISODate(PyObject *self, PyObject *args, } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxString (wxDateTime_FormatISODate(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxDateTime_FormatISODate(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; }{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); +#else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif } { delete _result; @@ -5597,12 +5562,17 @@ static PyObject *_wrap_wxDateTime_FormatISOTime(PyObject *self, PyObject *args, } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxString (wxDateTime_FormatISOTime(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxDateTime_FormatISOTime(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; }{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); +#else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif } { delete _result; @@ -5621,10 +5591,11 @@ static PyObject *_wrap_wxTimeSpan_Seconds(PyObject *self, PyObject *args, PyObje if(!PyArg_ParseTupleAndKeywords(args,kwargs,"l:wxTimeSpan_Seconds",_kwnames,&_arg0)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxTimeSpan (wxTimeSpan::Seconds(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxTimeSpan (wxTimeSpan::Seconds(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -5640,10 +5611,11 @@ static PyObject *_wrap_wxTimeSpan_Second(PyObject *self, PyObject *args, PyObjec if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxTimeSpan_Second",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxTimeSpan (wxTimeSpan::Second()); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxTimeSpan (wxTimeSpan::Second()); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -5660,10 +5632,11 @@ static PyObject *_wrap_wxTimeSpan_Minutes(PyObject *self, PyObject *args, PyObje if(!PyArg_ParseTupleAndKeywords(args,kwargs,"l:wxTimeSpan_Minutes",_kwnames,&_arg0)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxTimeSpan (wxTimeSpan::Minutes(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxTimeSpan (wxTimeSpan::Minutes(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -5679,10 +5652,11 @@ static PyObject *_wrap_wxTimeSpan_Minute(PyObject *self, PyObject *args, PyObjec if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxTimeSpan_Minute",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxTimeSpan (wxTimeSpan::Minute()); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxTimeSpan (wxTimeSpan::Minute()); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -5699,10 +5673,11 @@ static PyObject *_wrap_wxTimeSpan_Hours(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,"l:wxTimeSpan_Hours",_kwnames,&_arg0)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxTimeSpan (wxTimeSpan::Hours(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxTimeSpan (wxTimeSpan::Hours(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -5718,10 +5693,11 @@ static PyObject *_wrap_wxTimeSpan_Hour(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxTimeSpan_Hour",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxTimeSpan (wxTimeSpan::Hour()); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxTimeSpan (wxTimeSpan::Hour()); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -5738,10 +5714,11 @@ static PyObject *_wrap_wxTimeSpan_Days(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,"l:wxTimeSpan_Days",_kwnames,&_arg0)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxTimeSpan (wxTimeSpan::Days(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxTimeSpan (wxTimeSpan::Days(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -5757,10 +5734,11 @@ static PyObject *_wrap_wxTimeSpan_Day(PyObject *self, PyObject *args, PyObject * if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxTimeSpan_Day",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxTimeSpan (wxTimeSpan::Day()); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxTimeSpan (wxTimeSpan::Day()); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -5777,10 +5755,11 @@ static PyObject *_wrap_wxTimeSpan_Weeks(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,"l:wxTimeSpan_Weeks",_kwnames,&_arg0)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxTimeSpan (wxTimeSpan::Weeks(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxTimeSpan (wxTimeSpan::Weeks(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -5796,10 +5775,11 @@ static PyObject *_wrap_wxTimeSpan_Week(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxTimeSpan_Week",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxTimeSpan (wxTimeSpan::Week()); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxTimeSpan (wxTimeSpan::Week()); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -5820,10 +5800,11 @@ static PyObject *_wrap_new_wxTimeSpan(PyObject *self, PyObject *args, PyObject * if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|llll:new_wxTimeSpan",_kwnames,&_arg0,&_arg1,&_arg2,&_arg3)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxTimeSpan *)new_wxTimeSpan(_arg0,_arg1,_arg2,_arg3); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxTimeSpan *)new_wxTimeSpan(_arg0,_arg1,_arg2,_arg3); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -5852,10 +5833,11 @@ static PyObject *_wrap_delete_wxTimeSpan(PyObject *self, PyObject *args, PyObjec } } { - wxPy_BEGIN_ALLOW_THREADS; - delete_wxTimeSpan(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + delete_wxTimeSpan(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; return _resultobj; @@ -5883,18 +5865,18 @@ static PyObject *_wrap_wxTimeSpan_Add(PyObject *self, PyObject *args, PyObject * } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTimeSpan_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTimeSpan_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxTimeSpan_Add. Expected _wxTimeSpan_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - wxTimeSpan & _result_ref = wxTimeSpan_Add(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxTimeSpan & _result_ref = wxTimeSpan_Add(_arg0,*_arg1); _result = (wxTimeSpan *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -5927,18 +5909,18 @@ static PyObject *_wrap_wxTimeSpan_Subtract(PyObject *self, PyObject *args, PyObj } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTimeSpan_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTimeSpan_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxTimeSpan_Subtract. Expected _wxTimeSpan_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - wxTimeSpan & _result_ref = wxTimeSpan_Subtract(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxTimeSpan & _result_ref = wxTimeSpan_Subtract(_arg0,*_arg1); _result = (wxTimeSpan *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -5970,11 +5952,12 @@ static PyObject *_wrap_wxTimeSpan_Multiply(PyObject *self, PyObject *args, PyObj } } { - wxPy_BEGIN_ALLOW_THREADS; - wxTimeSpan & _result_ref = wxTimeSpan_Multiply(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxTimeSpan & _result_ref = wxTimeSpan_Multiply(_arg0,_arg1); _result = (wxTimeSpan *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -6005,11 +5988,12 @@ static PyObject *_wrap_wxTimeSpan_Neg(PyObject *self, PyObject *args, PyObject * } } { - wxPy_BEGIN_ALLOW_THREADS; - wxTimeSpan & _result_ref = wxTimeSpan_Neg(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxTimeSpan & _result_ref = wxTimeSpan_Neg(_arg0); _result = (wxTimeSpan *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -6040,10 +6024,11 @@ static PyObject *_wrap_wxTimeSpan_Abs(PyObject *self, PyObject *args, PyObject * } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxTimeSpan (wxTimeSpan_Abs(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxTimeSpan (wxTimeSpan_Abs(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -6071,17 +6056,17 @@ static PyObject *_wrap_wxTimeSpan___add__(PyObject *self, PyObject *args, PyObje } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTimeSpan_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTimeSpan_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxTimeSpan___add__. Expected _wxTimeSpan_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxTimeSpan (wxTimeSpan___add__(_arg0,*_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxTimeSpan (wxTimeSpan___add__(_arg0,*_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -6109,17 +6094,17 @@ static PyObject *_wrap_wxTimeSpan___sub__(PyObject *self, PyObject *args, PyObje } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTimeSpan_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTimeSpan_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxTimeSpan___sub__. Expected _wxTimeSpan_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxTimeSpan (wxTimeSpan___sub__(_arg0,*_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxTimeSpan (wxTimeSpan___sub__(_arg0,*_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -6146,10 +6131,11 @@ static PyObject *_wrap_wxTimeSpan___mul__(PyObject *self, PyObject *args, PyObje } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxTimeSpan (wxTimeSpan___mul__(_arg0,_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxTimeSpan (wxTimeSpan___mul__(_arg0,_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -6176,10 +6162,11 @@ static PyObject *_wrap_wxTimeSpan___rmul__(PyObject *self, PyObject *args, PyObj } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxTimeSpan (wxTimeSpan___rmul__(_arg0,_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxTimeSpan (wxTimeSpan___rmul__(_arg0,_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -6205,18 +6192,20 @@ static PyObject *_wrap_wxTimeSpan___neg__(PyObject *self, PyObject *args, PyObje } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxTimeSpan (wxTimeSpan___neg__(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxTimeSpan (wxTimeSpan___neg__(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxTimeSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; } -static int wxTimeSpan___cmp__(wxTimeSpan *self,const wxTimeSpan & other) { - if (*self < other) return -1; - if (*self == other) return 0; +static int wxTimeSpan___cmp__(wxTimeSpan *self,const wxTimeSpan * other) { + if (! other) return -1; + if (*self < *other) return -1; + if (*self == *other) return 0; return 1; } static PyObject *_wrap_wxTimeSpan___cmp__(PyObject *self, PyObject *args, PyObject *kwargs) { @@ -6246,10 +6235,11 @@ static PyObject *_wrap_wxTimeSpan___cmp__(PyObject *self, PyObject *args, PyObje } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxTimeSpan___cmp__(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxTimeSpan___cmp__(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -6273,10 +6263,11 @@ static PyObject *_wrap_wxTimeSpan_IsNull(PyObject *self, PyObject *args, PyObjec } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxTimeSpan_IsNull(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxTimeSpan_IsNull(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -6300,10 +6291,11 @@ static PyObject *_wrap_wxTimeSpan_IsPositive(PyObject *self, PyObject *args, PyO } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxTimeSpan_IsPositive(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxTimeSpan_IsPositive(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -6327,10 +6319,11 @@ static PyObject *_wrap_wxTimeSpan_IsNegative(PyObject *self, PyObject *args, PyO } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxTimeSpan_IsNegative(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxTimeSpan_IsNegative(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -6356,17 +6349,17 @@ static PyObject *_wrap_wxTimeSpan_IsEqualTo(PyObject *self, PyObject *args, PyOb } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTimeSpan_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTimeSpan_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxTimeSpan_IsEqualTo. Expected _wxTimeSpan_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxTimeSpan_IsEqualTo(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxTimeSpan_IsEqualTo(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -6392,17 +6385,17 @@ static PyObject *_wrap_wxTimeSpan_IsLongerThan(PyObject *self, PyObject *args, P } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTimeSpan_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTimeSpan_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxTimeSpan_IsLongerThan. Expected _wxTimeSpan_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxTimeSpan_IsLongerThan(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxTimeSpan_IsLongerThan(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -6428,17 +6421,17 @@ static PyObject *_wrap_wxTimeSpan_IsShorterThan(PyObject *self, PyObject *args, } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTimeSpan_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTimeSpan_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxTimeSpan_IsShorterThan. Expected _wxTimeSpan_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxTimeSpan_IsShorterThan(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxTimeSpan_IsShorterThan(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -6462,10 +6455,11 @@ static PyObject *_wrap_wxTimeSpan_GetWeeks(PyObject *self, PyObject *args, PyObj } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxTimeSpan_GetWeeks(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxTimeSpan_GetWeeks(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -6489,10 +6483,11 @@ static PyObject *_wrap_wxTimeSpan_GetDays(PyObject *self, PyObject *args, PyObje } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxTimeSpan_GetDays(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxTimeSpan_GetDays(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -6516,10 +6511,11 @@ static PyObject *_wrap_wxTimeSpan_GetHours(PyObject *self, PyObject *args, PyObj } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxTimeSpan_GetHours(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxTimeSpan_GetHours(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -6543,10 +6539,11 @@ static PyObject *_wrap_wxTimeSpan_GetMinutes(PyObject *self, PyObject *args, PyO } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxTimeSpan_GetMinutes(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxTimeSpan_GetMinutes(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -6570,10 +6567,11 @@ static PyObject *_wrap_wxTimeSpan_GetSeconds(PyObject *self, PyObject *args, PyO } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxLongLong (wxTimeSpan_GetSeconds(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxLongLong (wxTimeSpan_GetSeconds(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; }{ PyObject *hi, *lo, *shifter, *shifted; hi = PyLong_FromLong(_result->GetHi()); @@ -6608,10 +6606,11 @@ static PyObject *_wrap_wxTimeSpan_GetMilliseconds(PyObject *self, PyObject *args } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxLongLong (wxTimeSpan_GetMilliseconds(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxLongLong (wxTimeSpan_GetMilliseconds(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; }{ PyObject *hi, *lo, *shifter, *shifted; hi = PyLong_FromLong(_result->GetHi()); @@ -6632,12 +6631,13 @@ static PyObject *_wrap_wxTimeSpan_Format(PyObject *self, PyObject *args, PyObjec PyObject * _resultobj; wxString * _result; wxTimeSpan * _arg0; - char * _arg1 = (char *) "%c"; + wxString * _arg1 = (wxString *) &wxPyDateFormatStr; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","format", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|s:wxTimeSpan_Format",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:wxTimeSpan_Format",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -6646,13 +6646,28 @@ static PyObject *_wrap_wxTimeSpan_Format(PyObject *self, PyObject *args, PyObjec return NULL; } } + if (_obj1) { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxString (wxTimeSpan_Format(_arg0,_arg1)); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxTimeSpan_Format(_arg0,*_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; }{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); +#else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + if (_obj1) + delete _arg1; } { delete _result; @@ -6675,10 +6690,11 @@ static PyObject *_wrap_new_wxDateSpan(PyObject *self, PyObject *args, PyObject * if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|iiii:new_wxDateSpan",_kwnames,&_arg0,&_arg1,&_arg2,&_arg3)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDateSpan *)new_wxDateSpan(_arg0,_arg1,_arg2,_arg3); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDateSpan *)new_wxDateSpan(_arg0,_arg1,_arg2,_arg3); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -6707,10 +6723,11 @@ static PyObject *_wrap_delete_wxDateSpan(PyObject *self, PyObject *args, PyObjec } } { - wxPy_BEGIN_ALLOW_THREADS; - delete_wxDateSpan(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + delete_wxDateSpan(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; return _resultobj; @@ -6727,10 +6744,11 @@ static PyObject *_wrap_wxDateSpan_Days(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i:wxDateSpan_Days",_kwnames,&_arg0)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateSpan (wxDateSpan::Days(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateSpan (wxDateSpan::Days(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -6746,10 +6764,11 @@ static PyObject *_wrap_wxDateSpan_Day(PyObject *self, PyObject *args, PyObject * if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxDateSpan_Day",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateSpan (wxDateSpan::Day()); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateSpan (wxDateSpan::Day()); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -6766,10 +6785,11 @@ static PyObject *_wrap_wxDateSpan_Weeks(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i:wxDateSpan_Weeks",_kwnames,&_arg0)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateSpan (wxDateSpan::Weeks(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateSpan (wxDateSpan::Weeks(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -6785,10 +6805,11 @@ static PyObject *_wrap_wxDateSpan_Week(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxDateSpan_Week",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateSpan (wxDateSpan::Week()); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateSpan (wxDateSpan::Week()); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -6805,10 +6826,11 @@ static PyObject *_wrap_wxDateSpan_Months(PyObject *self, PyObject *args, PyObjec if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i:wxDateSpan_Months",_kwnames,&_arg0)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateSpan (wxDateSpan::Months(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateSpan (wxDateSpan::Months(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -6824,10 +6846,11 @@ static PyObject *_wrap_wxDateSpan_Month(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxDateSpan_Month",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateSpan (wxDateSpan::Month()); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateSpan (wxDateSpan::Month()); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -6844,10 +6867,11 @@ static PyObject *_wrap_wxDateSpan_Years(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i:wxDateSpan_Years",_kwnames,&_arg0)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateSpan (wxDateSpan::Years(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateSpan (wxDateSpan::Years(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -6863,10 +6887,11 @@ static PyObject *_wrap_wxDateSpan_Year(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxDateSpan_Year",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateSpan (wxDateSpan::Year()); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateSpan (wxDateSpan::Year()); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -6893,11 +6918,12 @@ static PyObject *_wrap_wxDateSpan_SetYears(PyObject *self, PyObject *args, PyObj } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateSpan & _result_ref = wxDateSpan_SetYears(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateSpan & _result_ref = wxDateSpan_SetYears(_arg0,_arg1); _result = (wxDateSpan *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -6929,11 +6955,12 @@ static PyObject *_wrap_wxDateSpan_SetMonths(PyObject *self, PyObject *args, PyOb } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateSpan & _result_ref = wxDateSpan_SetMonths(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateSpan & _result_ref = wxDateSpan_SetMonths(_arg0,_arg1); _result = (wxDateSpan *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -6965,11 +6992,12 @@ static PyObject *_wrap_wxDateSpan_SetWeeks(PyObject *self, PyObject *args, PyObj } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateSpan & _result_ref = wxDateSpan_SetWeeks(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateSpan & _result_ref = wxDateSpan_SetWeeks(_arg0,_arg1); _result = (wxDateSpan *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -7001,11 +7029,12 @@ static PyObject *_wrap_wxDateSpan_SetDays(PyObject *self, PyObject *args, PyObje } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateSpan & _result_ref = wxDateSpan_SetDays(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateSpan & _result_ref = wxDateSpan_SetDays(_arg0,_arg1); _result = (wxDateSpan *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -7035,10 +7064,11 @@ static PyObject *_wrap_wxDateSpan_GetYears(PyObject *self, PyObject *args, PyObj } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxDateSpan_GetYears(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxDateSpan_GetYears(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -7062,10 +7092,11 @@ static PyObject *_wrap_wxDateSpan_GetMonths(PyObject *self, PyObject *args, PyOb } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxDateSpan_GetMonths(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxDateSpan_GetMonths(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -7089,10 +7120,11 @@ static PyObject *_wrap_wxDateSpan_GetWeeks(PyObject *self, PyObject *args, PyObj } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxDateSpan_GetWeeks(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxDateSpan_GetWeeks(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -7116,10 +7148,11 @@ static PyObject *_wrap_wxDateSpan_GetDays(PyObject *self, PyObject *args, PyObje } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxDateSpan_GetDays(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxDateSpan_GetDays(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -7143,10 +7176,11 @@ static PyObject *_wrap_wxDateSpan_GetTotalDays(PyObject *self, PyObject *args, P } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxDateSpan_GetTotalDays(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxDateSpan_GetTotalDays(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } @@ -7173,18 +7207,18 @@ static PyObject *_wrap_wxDateSpan_Add(PyObject *self, PyObject *args, PyObject * } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateSpan_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateSpan_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateSpan_Add. Expected _wxDateSpan_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateSpan & _result_ref = wxDateSpan_Add(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateSpan & _result_ref = wxDateSpan_Add(_arg0,*_arg1); _result = (wxDateSpan *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -7217,18 +7251,18 @@ static PyObject *_wrap_wxDateSpan_Subtract(PyObject *self, PyObject *args, PyObj } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateSpan_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateSpan_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateSpan_Subtract. Expected _wxDateSpan_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateSpan & _result_ref = wxDateSpan_Subtract(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateSpan & _result_ref = wxDateSpan_Subtract(_arg0,*_arg1); _result = (wxDateSpan *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -7259,11 +7293,12 @@ static PyObject *_wrap_wxDateSpan_Neg(PyObject *self, PyObject *args, PyObject * } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateSpan & _result_ref = wxDateSpan_Neg(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateSpan & _result_ref = wxDateSpan_Neg(_arg0); _result = (wxDateSpan *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -7295,11 +7330,12 @@ static PyObject *_wrap_wxDateSpan_Multiply(PyObject *self, PyObject *args, PyObj } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDateSpan & _result_ref = wxDateSpan_Multiply(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDateSpan & _result_ref = wxDateSpan_Multiply(_arg0,_arg1); _result = (wxDateSpan *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -7332,17 +7368,17 @@ static PyObject *_wrap_wxDateSpan___add__(PyObject *self, PyObject *args, PyObje } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateSpan_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateSpan_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateSpan___add__. Expected _wxDateSpan_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateSpan (wxDateSpan___add__(_arg0,*_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateSpan (wxDateSpan___add__(_arg0,*_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -7370,17 +7406,17 @@ static PyObject *_wrap_wxDateSpan___sub__(PyObject *self, PyObject *args, PyObje } } if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateSpan_p")) { + if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateSpan_p")) { PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateSpan___sub__. Expected _wxDateSpan_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateSpan (wxDateSpan___sub__(_arg0,*_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateSpan (wxDateSpan___sub__(_arg0,*_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -7407,10 +7443,11 @@ static PyObject *_wrap_wxDateSpan___mul__(PyObject *self, PyObject *args, PyObje } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateSpan (wxDateSpan___mul__(_arg0,_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateSpan (wxDateSpan___mul__(_arg0,_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -7437,10 +7474,11 @@ static PyObject *_wrap_wxDateSpan___rmul__(PyObject *self, PyObject *args, PyObj } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateSpan (wxDateSpan___rmul__(_arg0,_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateSpan (wxDateSpan___rmul__(_arg0,_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -7466,10 +7504,11 @@ static PyObject *_wrap_wxDateSpan___neg__(PyObject *self, PyObject *args, PyObje } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDateSpan (wxDateSpan___neg__(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDateSpan (wxDateSpan___neg__(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDateSpan_p"); _resultobj = Py_BuildValue("s",_ptemp); return _resultobj; @@ -7577,6 +7616,7 @@ static PyMethodDef utilscMethods[] = { { "wxDateTime_GetSecond", (PyCFunction) _wrap_wxDateTime_GetSecond, METH_VARARGS | METH_KEYWORDS }, { "wxDateTime_GetMinute", (PyCFunction) _wrap_wxDateTime_GetMinute, METH_VARARGS | METH_KEYWORDS }, { "wxDateTime_GetHour", (PyCFunction) _wrap_wxDateTime_GetHour, METH_VARARGS | METH_KEYWORDS }, + { "wxDateTime_GetWeekDay", (PyCFunction) _wrap_wxDateTime_GetWeekDay, METH_VARARGS | METH_KEYWORDS }, { "wxDateTime_GetDay", (PyCFunction) _wrap_wxDateTime_GetDay, METH_VARARGS | METH_KEYWORDS }, { "wxDateTime_GetMonth", (PyCFunction) _wrap_wxDateTime_GetMonth, METH_VARARGS | METH_KEYWORDS }, { "wxDateTime_GetYear", (PyCFunction) _wrap_wxDateTime_GetYear, METH_VARARGS | METH_KEYWORDS }, @@ -7600,7 +7640,6 @@ static PyMethodDef utilscMethods[] = { { "wxDateTime_SetToTheWeek", (PyCFunction) _wrap_wxDateTime_SetToTheWeek, METH_VARARGS | METH_KEYWORDS }, { "wxDateTime_GetLastWeekDay", (PyCFunction) _wrap_wxDateTime_GetLastWeekDay, METH_VARARGS | METH_KEYWORDS }, { "wxDateTime_SetToLastWeekDay", (PyCFunction) _wrap_wxDateTime_SetToLastWeekDay, METH_VARARGS | METH_KEYWORDS }, - { "wxDateTime_GetWeekDay", (PyCFunction) _wrap_wxDateTime_GetWeekDay, METH_VARARGS | METH_KEYWORDS }, { "wxDateTime_SetToWeekDay", (PyCFunction) _wrap_wxDateTime_SetToWeekDay, METH_VARARGS | METH_KEYWORDS }, { "wxDateTime_GetPrevWeekDay", (PyCFunction) _wrap_wxDateTime_GetPrevWeekDay, METH_VARARGS | METH_KEYWORDS }, { "wxDateTime_SetToPrevWeekDay", (PyCFunction) _wrap_wxDateTime_SetToPrevWeekDay, METH_VARARGS | METH_KEYWORDS }, @@ -7628,6 +7667,7 @@ static PyMethodDef utilscMethods[] = { { "new_wxDateTimeFromTimeT", (PyCFunction) _wrap_new_wxDateTimeFromTimeT, METH_VARARGS | METH_KEYWORDS }, { "new_wxDateTime", (PyCFunction) _wrap_new_wxDateTime, METH_VARARGS | METH_KEYWORDS }, { "wxDateTime_Today", (PyCFunction) _wrap_wxDateTime_Today, METH_VARARGS | METH_KEYWORDS }, + { "wxDateTime_UNow", (PyCFunction) _wrap_wxDateTime_UNow, METH_VARARGS | METH_KEYWORDS }, { "wxDateTime_Now", (PyCFunction) _wrap_wxDateTime_Now, METH_VARARGS | METH_KEYWORDS }, { "wxDateTime_GetEndDST", (PyCFunction) _wrap_wxDateTime_GetEndDST, METH_VARARGS | METH_KEYWORDS }, { "wxDateTime_GetBeginDST", (PyCFunction) _wrap_wxDateTime_GetBeginDST, METH_VARARGS | METH_KEYWORDS }, @@ -7653,6 +7693,7 @@ static PyMethodDef utilscMethods[] = { { "wxConfigBase_RenameGroup", (PyCFunction) _wrap_wxConfigBase_RenameGroup, METH_VARARGS | METH_KEYWORDS }, { "wxConfigBase_RenameEntry", (PyCFunction) _wrap_wxConfigBase_RenameEntry, METH_VARARGS | METH_KEYWORDS }, { "wxConfigBase_GetEntryType", (PyCFunction) _wrap_wxConfigBase_GetEntryType, METH_VARARGS | METH_KEYWORDS }, + { "wxConfigBase_WriteBool", (PyCFunction) _wrap_wxConfigBase_WriteBool, METH_VARARGS | METH_KEYWORDS }, { "wxConfigBase_WriteFloat", (PyCFunction) _wrap_wxConfigBase_WriteFloat, METH_VARARGS | METH_KEYWORDS }, { "wxConfigBase_WriteInt", (PyCFunction) _wrap_wxConfigBase_WriteInt, METH_VARARGS | METH_KEYWORDS }, { "wxConfigBase_Write", (PyCFunction) _wrap_wxConfigBase_Write, METH_VARARGS | METH_KEYWORDS }, @@ -7663,6 +7704,7 @@ static PyMethodDef utilscMethods[] = { { "wxConfigBase_SetRecordDefaults", (PyCFunction) _wrap_wxConfigBase_SetRecordDefaults, METH_VARARGS | METH_KEYWORDS }, { "wxConfigBase_SetPath", (PyCFunction) _wrap_wxConfigBase_SetPath, METH_VARARGS | METH_KEYWORDS }, { "wxConfigBase_SetExpandEnvVars", (PyCFunction) _wrap_wxConfigBase_SetExpandEnvVars, METH_VARARGS | METH_KEYWORDS }, + { "wxConfigBase_ReadBool", (PyCFunction) _wrap_wxConfigBase_ReadBool, METH_VARARGS | METH_KEYWORDS }, { "wxConfigBase_ReadFloat", (PyCFunction) _wrap_wxConfigBase_ReadFloat, METH_VARARGS | METH_KEYWORDS }, { "wxConfigBase_ReadInt", (PyCFunction) _wrap_wxConfigBase_ReadInt, METH_VARARGS | METH_KEYWORDS }, { "wxConfigBase_Read", (PyCFunction) _wrap_wxConfigBase_Read, METH_VARARGS | METH_KEYWORDS }, @@ -7703,7 +7745,6 @@ static PyMethodDef utilscMethods[] = { */ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_signed_long","_long",0}, - { "_class_wxDateTime","_wxDateTime",0}, { "_wxPrintQuality","_wxCoord",0}, { "_wxPrintQuality","_int",0}, { "_wxPrintQuality","_signed_int",0}, @@ -7723,7 +7764,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_size_t","_int",0}, { "_size_t","_wxWindowID",0}, { "_size_t","_uint",0}, - { "_wxFileConfig","_class_wxFileConfig",0}, { "_uint","_wxCoord",0}, { "_uint","_wxPrintQuality",0}, { "_uint","_time_t",0}, @@ -7733,15 +7773,12 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_uint","_wxWindowID",0}, { "_wxChar","_char",0}, { "_char","_wxChar",0}, - { "_wxConfig","_class_wxConfig",0}, - { "_class_wxFileConfig","_wxFileConfig",0}, { "_EBool","_wxCoord",0}, { "_EBool","_wxPrintQuality",0}, { "_EBool","_signed_int",0}, { "_EBool","_int",0}, { "_EBool","_wxWindowID",0}, { "_unsigned_long","_long",0}, - { "_wxTimeSpan","_class_wxTimeSpan",0}, { "_signed_int","_wxCoord",0}, { "_signed_int","_wxPrintQuality",0}, { "_signed_int","_EBool",0}, @@ -7754,7 +7791,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_unsigned_short","_wxDateTime_t",0}, { "_unsigned_short","_WXTYPE",0}, { "_unsigned_short","_short",0}, - { "_wxDateSpan","_class_wxDateSpan",0}, { "_signed_short","_WXTYPE",0}, { "_signed_short","_short",0}, { "_unsigned_char","_byte",0}, @@ -7765,11 +7801,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_unsigned_int","_uint",0}, { "_unsigned_int","_wxWindowID",0}, { "_unsigned_int","_int",0}, - { "_wxConfigBase","_class_wxFileConfig",SwigwxFileConfigTowxConfigBase}, { "_wxConfigBase","_wxFileConfig",SwigwxFileConfigTowxConfigBase}, - { "_wxConfigBase","_class_wxConfig",SwigwxConfigTowxConfigBase}, { "_wxConfigBase","_wxConfig",SwigwxConfigTowxConfigBase}, - { "_wxConfigBase","_class_wxConfigBase",0}, { "_short","_wxDateTime_t",0}, { "_short","_WXTYPE",0}, { "_short","_unsigned_short",0}, @@ -7795,7 +7828,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxDateTime_t","_unsigned_short",0}, { "_wxDateTime_t","_short",0}, { "_wxDateTime_t","_WXTYPE",0}, - { "_wxDateTime","_class_wxDateTime",0}, { "_time_t","_wxCoord",0}, { "_time_t","_wxPrintQuality",0}, { "_time_t","_unsigned_int",0}, @@ -7803,12 +7835,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_time_t","_wxWindowID",0}, { "_time_t","_uint",0}, { "_time_t","_size_t",0}, - { "_class_wxTimeSpan","_wxTimeSpan",0}, - { "_class_wxConfigBase","_class_wxFileConfig",SwigwxFileConfigTowxConfigBase}, - { "_class_wxConfigBase","_wxFileConfig",SwigwxFileConfigTowxConfigBase}, - { "_class_wxConfigBase","_class_wxConfig",SwigwxConfigTowxConfigBase}, - { "_class_wxConfigBase","_wxConfig",SwigwxConfigTowxConfigBase}, - { "_class_wxConfigBase","_wxConfigBase",0}, { "_wxCoord","_int",0}, { "_wxCoord","_signed_int",0}, { "_wxCoord","_unsigned_int",0}, @@ -7818,8 +7844,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxCoord","_size_t",0}, { "_wxCoord","_time_t",0}, { "_wxCoord","_wxPrintQuality",0}, - { "_class_wxDateSpan","_wxDateSpan",0}, - { "_class_wxConfig","_wxConfig",0}, {0,0,0}}; static PyObject *SWIG_globals; @@ -7834,9 +7858,11 @@ SWIGEXPORT(void) initutilsc() { PyDict_SetItemString(d,"wxCONFIG_USE_LOCAL_FILE", PyInt_FromLong((long) wxCONFIG_USE_LOCAL_FILE)); PyDict_SetItemString(d,"wxCONFIG_USE_GLOBAL_FILE", PyInt_FromLong((long) wxCONFIG_USE_GLOBAL_FILE)); PyDict_SetItemString(d,"wxCONFIG_USE_RELATIVE_PATH", PyInt_FromLong((long) wxCONFIG_USE_RELATIVE_PATH)); + PyDict_SetItemString(d,"wxCONFIG_USE_NO_ESCAPE_CHARACTERS", PyInt_FromLong((long) wxCONFIG_USE_NO_ESCAPE_CHARACTERS)); - wxClassInfo::CleanUpClasses(); - wxClassInfo::InitializeClasses(); + // These are no longer needed since utils is back in the core +// wxClassInfo::CleanUpClasses(); +// wxClassInfo::InitializeClasses(); PyDict_SetItemString(d,"wxConfigBase_Type_Unknown", PyInt_FromLong((long) wxConfigBase::Type_Unknown)); PyDict_SetItemString(d,"wxConfigBase_Type_String", PyInt_FromLong((long) wxConfigBase::Type_String)); PyDict_SetItemString(d,"wxConfigBase_Type_Boolean", PyInt_FromLong((long) wxConfigBase::Type_Boolean));