X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/17c0e08c61c69b77e58b3e9ffc78d58fcf105940..f63e3ebbe3272b9690aa2530e0c3048d3f37c7c7:/wxPython/src/gtk/clip_dnd.cpp diff --git a/wxPython/src/gtk/clip_dnd.cpp b/wxPython/src/gtk/clip_dnd.cpp index 7a7dad4435..91f1826fb4 100644 --- a/wxPython/src/gtk/clip_dnd.cpp +++ b/wxPython/src/gtk/clip_dnd.cpp @@ -87,11 +87,8 @@ 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 required"; -#endif + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyEmptyString(wxT("")); // An alternate constructor... wxDataFormat* wxCustomDataFormat(const wxString &id) { return new wxDataFormat(id); @@ -119,7 +116,7 @@ bool wxPyDataObjectSimple::GetDataHere(void *buf) { // C++ version. bool rval = FALSE; - wxPyTState* state = wxPyBeginBlockThreads(); + wxPyBeginBlockThreads(); if (m_myInst.findCallback("GetDataHere")) { PyObject* ro; ro = m_myInst.callCallbackObj(Py_BuildValue("()")); @@ -130,7 +127,7 @@ bool wxPyDataObjectSimple::GetDataHere(void *buf) { Py_DECREF(ro); } } - wxPyEndBlockThreads(state); + wxPyEndBlockThreads(); return rval; } @@ -138,19 +135,19 @@ bool wxPyDataObjectSimple::SetData(size_t len, const void *buf) { // For this one we simply need to make a string from buf and len // and send it to the Python method. bool rval = FALSE; - wxPyTState* state = wxPyBeginBlockThreads(); + wxPyBeginBlockThreads(); if (m_myInst.findCallback("SetData")) { PyObject* data = PyString_FromStringAndSize((char*)buf, len); rval = m_myInst.callCallback(Py_BuildValue("(O)", data)); Py_DECREF(data); } - wxPyEndBlockThreads(state); + wxPyEndBlockThreads(); return rval; } // Create a new class for wxPython to use class wxPyTextDataObject : public wxTextDataObject { public: - wxPyTextDataObject(const wxString& text = wxEmptyString) + wxPyTextDataObject(const wxString& text = wxPyEmptyString) : wxTextDataObject(text) {} DEC_PYCALLBACK_SIZET_(GetTextLength); @@ -176,7 +173,7 @@ public: wxBitmap wxPyBitmapDataObject::GetBitmap() { wxBitmap* rval = &wxNullBitmap; - wxPyTState* state = wxPyBeginBlockThreads(); + wxPyBeginBlockThreads(); if (m_myInst.findCallback("GetBitmap")) { PyObject* ro; wxBitmap* ptr; @@ -187,17 +184,17 @@ wxBitmap wxPyBitmapDataObject::GetBitmap() { Py_DECREF(ro); } } - wxPyEndBlockThreads(state); + wxPyEndBlockThreads(); return *rval; } void wxPyBitmapDataObject::SetBitmap(const wxBitmap& bitmap) { - wxPyTState* state = wxPyBeginBlockThreads(); + wxPyBeginBlockThreads(); if (m_myInst.findCallback("SetBitmap")) { m_myInst.callCallback(Py_BuildValue("(O)", wxPyConstructObject((void*)&bitmap, "wxBitmap"))); } - wxPyEndBlockThreads(state); + wxPyEndBlockThreads(); } // See below in the init function... @@ -293,16 +290,12 @@ public: bool wxPyFileDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames) { bool rval = FALSE; - wxPyTState* state = wxPyBeginBlockThreads(); - PyObject* list = PyList_New(0); - for (size_t i=0; i= 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) - return NULL; - _arg0 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj0)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) return NULL; - } - _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); -#endif } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDataFormat *)wxCustomDataFormat(*_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDataFormat *)wxCustomDataFormat(*_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDataFormat_p"); @@ -406,10 +386,10 @@ static PyObject *_wrap_wxIsDragResultOk(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i:wxIsDragResultOk",_kwnames,&_arg0)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxIsDragResultOk(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxIsDragResultOk(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -427,10 +407,10 @@ static PyObject *_wrap_new_wxDataFormat(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i:new_wxDataFormat",_kwnames,&_arg0)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDataFormat *)new_wxDataFormat(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDataFormat *)new_wxDataFormat(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDataFormat_p"); @@ -460,10 +440,10 @@ static PyObject *_wrap_delete_wxDataFormat(PyObject *self, PyObject *args, PyObj } } { - wxPy_BEGIN_ALLOW_THREADS; - delete_wxDataFormat(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + delete_wxDataFormat(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -489,10 +469,10 @@ static PyObject *_wrap_wxDataFormat_SetType(PyObject *self, PyObject *args, PyOb } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDataFormat_SetType(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDataFormat_SetType(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -518,10 +498,10 @@ static PyObject *_wrap_wxDataFormat_GetType(PyObject *self, PyObject *args, PyOb } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDataFormatId )wxDataFormat_GetType(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDataFormatId )wxDataFormat_GetType(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -546,13 +526,17 @@ static PyObject *_wrap_wxDataFormat_GetId(PyObject *self, PyObject *args, PyObje } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxString (wxDataFormat_GetId(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxDataFormat_GetId(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; }{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif } { delete _result; @@ -564,12 +548,13 @@ static PyObject *_wrap_wxDataFormat_GetId(PyObject *self, PyObject *args, PyObje static PyObject *_wrap_wxDataFormat_SetId(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxDataFormat * _arg0; - char * _arg1; + wxString * _arg1; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","format", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxDataFormat_SetId",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDataFormat_SetId",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -579,13 +564,22 @@ static PyObject *_wrap_wxDataFormat_SetId(PyObject *self, PyObject *args, PyObje } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDataFormat_SetId(_arg0,_arg1); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDataFormat_SetId(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} return _resultobj; } @@ -607,10 +601,10 @@ static PyObject *_wrap_delete_wxDataObject(PyObject *self, PyObject *args, PyObj } } { - wxPy_BEGIN_ALLOW_THREADS; - delete_wxDataObject(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + delete_wxDataObject(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -638,10 +632,10 @@ static PyObject *_wrap_wxDataObject_GetPreferredFormat(PyObject *self, PyObject } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxDataFormat (wxDataObject_GetPreferredFormat(_arg0,_arg1)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxDataFormat (wxDataObject_GetPreferredFormat(_arg0,_arg1)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxDataFormat_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -668,10 +662,10 @@ static PyObject *_wrap_wxDataObject_GetFormatCount(PyObject *self, PyObject *arg } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (size_t )wxDataObject_GetFormatCount(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (size_t )wxDataObject_GetFormatCount(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -705,10 +699,10 @@ static PyObject *_wrap_wxDataObject_GetAllFormats(PyObject *self, PyObject *args } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDataObject_GetAllFormats(_arg0,_arg1,_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDataObject_GetAllFormats(_arg0,_arg1,_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -743,10 +737,10 @@ static PyObject *_wrap_wxDataObject_GetDataSize(PyObject *self, PyObject *args, } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (size_t )wxDataObject_GetDataSize(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (size_t )wxDataObject_GetDataSize(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -789,10 +783,10 @@ static PyObject *_wrap_wxDataObject_GetDataHere(PyObject *self, PyObject *args, } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxDataObject_GetDataHere(_arg0,*_arg1,_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxDataObject_GetDataHere(_arg0,*_arg1,_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -836,10 +830,10 @@ static PyObject *_wrap_wxDataObject_SetData(PyObject *self, PyObject *args, PyOb } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxDataObject_SetData(_arg0,*_arg1,_arg2,_arg3); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxDataObject_SetData(_arg0,*_arg1,_arg2,_arg3); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -873,10 +867,10 @@ static PyObject *_wrap_wxDataObject_IsSupportedFormat(PyObject *self, PyObject * } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxDataObject_IsSupportedFormat(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxDataObject_IsSupportedFormat(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -910,10 +904,10 @@ static PyObject *_wrap_new_wxDataObjectSimple(PyObject *self, PyObject *args, Py } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDataObjectSimple *)new_wxDataObjectSimple(*_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDataObjectSimple *)new_wxDataObjectSimple(*_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDataObjectSimple_p"); @@ -945,11 +939,11 @@ static PyObject *_wrap_wxDataObjectSimple_GetFormat(PyObject *self, PyObject *ar } } { - wxPy_BEGIN_ALLOW_THREADS; - const wxDataFormat & _result_ref = wxDataObjectSimple_GetFormat(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + const wxDataFormat & _result_ref = wxDataObjectSimple_GetFormat(_arg0); _result = (wxDataFormat *) &_result_ref; - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDataFormat_p"); @@ -988,10 +982,10 @@ static PyObject *_wrap_wxDataObjectSimple_SetFormat(PyObject *self, PyObject *ar } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDataObjectSimple_SetFormat(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDataObjectSimple_SetFormat(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -1034,10 +1028,10 @@ static PyObject *_wrap_new_wxPyDataObjectSimple(PyObject *self, PyObject *args, } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxPyDataObjectSimple *)new_wxPyDataObjectSimple(*_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxPyDataObjectSimple *)new_wxPyDataObjectSimple(*_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxPyDataObjectSimple_p"); @@ -1077,10 +1071,10 @@ static PyObject *_wrap_wxPyDataObjectSimple__setCallbackInfo(PyObject *self, PyO _arg2 = _obj2; } { - wxPy_BEGIN_ALLOW_THREADS; - wxPyDataObjectSimple__setCallbackInfo(_arg0,_arg1,_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxPyDataObjectSimple__setCallbackInfo(_arg0,_arg1,_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -1106,10 +1100,10 @@ static PyObject *_wrap_new_wxDataObjectComposite(PyObject *self, PyObject *args, if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxDataObjectComposite",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDataObjectComposite *)new_wxDataObjectComposite(); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDataObjectComposite *)new_wxDataObjectComposite(); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDataObjectComposite_p"); @@ -1149,10 +1143,10 @@ static PyObject *_wrap_wxDataObjectComposite_Add(PyObject *self, PyObject *args, } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDataObjectComposite_Add(_arg0,_arg1,_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDataObjectComposite_Add(_arg0,_arg1,_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -1179,7 +1173,7 @@ static void *SwigwxTextDataObjectTowxDataObject(void *ptr) { static PyObject *_wrap_new_wxTextDataObject(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxTextDataObject * _result; - wxString * _arg0 = (wxString *) &wxEmptyString; + wxString * _arg0 = (wxString *) &wxPyEmptyString; PyObject * _obj0 = 0; char *_kwnames[] = { "text", NULL }; char _ptemp[128]; @@ -1189,28 +1183,15 @@ static PyObject *_wrap_new_wxTextDataObject(PyObject *self, PyObject *args, PyOb 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) - return NULL; - _arg0 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj0)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) return NULL; - } - _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); -#endif } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxTextDataObject *)new_wxTextDataObject(*_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxTextDataObject *)new_wxTextDataObject(*_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxTextDataObject_p"); @@ -1245,10 +1226,10 @@ static PyObject *_wrap_wxTextDataObject_GetTextLength(PyObject *self, PyObject * } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (size_t )wxTextDataObject_GetTextLength(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (size_t )wxTextDataObject_GetTextLength(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -1273,13 +1254,17 @@ static PyObject *_wrap_wxTextDataObject_GetText(PyObject *self, PyObject *args, } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxString (wxTextDataObject_GetText(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxTextDataObject_GetText(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; }{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif } { delete _result; @@ -1307,28 +1292,15 @@ static PyObject *_wrap_wxTextDataObject_SetText(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; - wxTextDataObject_SetText(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxTextDataObject_SetText(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -1367,7 +1339,7 @@ static void *SwigwxPyTextDataObjectTowxDataObject(void *ptr) { static PyObject *_wrap_new_wxPyTextDataObject(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxPyTextDataObject * _result; - wxString * _arg0 = (wxString *) &wxEmptyString; + wxString * _arg0 = (wxString *) &wxPyEmptyString; PyObject * _obj0 = 0; char *_kwnames[] = { "text", NULL }; char _ptemp[128]; @@ -1377,28 +1349,15 @@ static PyObject *_wrap_new_wxPyTextDataObject(PyObject *self, PyObject *args, Py 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 } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxPyTextDataObject *)new_wxPyTextDataObject(*_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxPyTextDataObject *)new_wxPyTextDataObject(*_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxPyTextDataObject_p"); @@ -1442,10 +1401,10 @@ static PyObject *_wrap_wxPyTextDataObject__setCallbackInfo(PyObject *self, PyObj _arg2 = _obj2; } { - wxPy_BEGIN_ALLOW_THREADS; - wxPyTextDataObject__setCallbackInfo(_arg0,_arg1,_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxPyTextDataObject__setCallbackInfo(_arg0,_arg1,_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -1488,10 +1447,10 @@ static PyObject *_wrap_new_wxBitmapDataObject(PyObject *self, PyObject *args, Py } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxBitmapDataObject *)new_wxBitmapDataObject(*_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxBitmapDataObject *)new_wxBitmapDataObject(*_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmapDataObject_p"); @@ -1523,10 +1482,10 @@ static PyObject *_wrap_wxBitmapDataObject_GetBitmap(PyObject *self, PyObject *ar } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxBitmap (wxBitmapDataObject_GetBitmap(_arg0)); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxBitmap (wxBitmapDataObject_GetBitmap(_arg0)); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } SWIG_MakePtr(_ptemp, (void *) _result,"_wxBitmap_p"); _resultobj = Py_BuildValue("s",_ptemp); @@ -1560,10 +1519,10 @@ static PyObject *_wrap_wxBitmapDataObject_SetBitmap(PyObject *self, PyObject *ar } } { - wxPy_BEGIN_ALLOW_THREADS; - wxBitmapDataObject_SetBitmap(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxBitmapDataObject_SetBitmap(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -1614,10 +1573,10 @@ static PyObject *_wrap_new_wxPyBitmapDataObject(PyObject *self, PyObject *args, } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxPyBitmapDataObject *)new_wxPyBitmapDataObject(*_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxPyBitmapDataObject *)new_wxPyBitmapDataObject(*_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxPyBitmapDataObject_p"); @@ -1657,10 +1616,10 @@ static PyObject *_wrap_wxPyBitmapDataObject__setCallbackInfo(PyObject *self, PyO _arg2 = _obj2; } { - wxPy_BEGIN_ALLOW_THREADS; - wxPyBitmapDataObject__setCallbackInfo(_arg0,_arg1,_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxPyBitmapDataObject__setCallbackInfo(_arg0,_arg1,_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -1694,10 +1653,10 @@ static PyObject *_wrap_new_wxFileDataObject(PyObject *self, PyObject *args, PyOb if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxFileDataObject",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxFileDataObject *)new_wxFileDataObject(); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxFileDataObject *)new_wxFileDataObject(); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxFileDataObject_p"); @@ -1711,10 +1670,7 @@ static PyObject *_wrap_new_wxFileDataObject(PyObject *self, PyObject *args, PyOb static PyObject * wxFileDataObject_GetFilenames(wxFileDataObject *self) { const wxArrayString& strings = self->GetFilenames(); - PyObject* list = PyList_New(0); - for (size_t x=0; xc_str(), _result->Len()); +#else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif } { delete _result; @@ -2026,28 +1986,15 @@ static PyObject *_wrap_wxURLDataObject_SetURL(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) - 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; - wxURLDataObject_SetURL(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxURLDataObject_SetURL(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -2077,10 +2024,10 @@ static PyObject *_wrap_new_wxClipboard(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxClipboard",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxClipboard *)new_wxClipboard(); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxClipboard *)new_wxClipboard(); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxClipboard_p"); @@ -2111,10 +2058,10 @@ static PyObject *_wrap_wxClipboard_Open(PyObject *self, PyObject *args, PyObject } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxClipboard_Open(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxClipboard_Open(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -2138,10 +2085,10 @@ static PyObject *_wrap_wxClipboard_Close(PyObject *self, PyObject *args, PyObjec } } { - wxPy_BEGIN_ALLOW_THREADS; - wxClipboard_Close(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxClipboard_Close(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -2167,10 +2114,10 @@ static PyObject *_wrap_wxClipboard_IsOpened(PyObject *self, PyObject *args, PyOb } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxClipboard_IsOpened(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxClipboard_IsOpened(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -2204,10 +2151,10 @@ static PyObject *_wrap_wxClipboard_AddData(PyObject *self, PyObject *args, PyObj } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxClipboard_AddData(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxClipboard_AddData(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -2241,10 +2188,10 @@ static PyObject *_wrap_wxClipboard_SetData(PyObject *self, PyObject *args, PyObj } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxClipboard_SetData(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxClipboard_SetData(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -2278,10 +2225,10 @@ static PyObject *_wrap_wxClipboard_IsSupported(PyObject *self, PyObject *args, P } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxClipboard_IsSupported(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxClipboard_IsSupported(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -2315,10 +2262,10 @@ static PyObject *_wrap_wxClipboard_GetData(PyObject *self, PyObject *args, PyObj } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxClipboard_GetData(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxClipboard_GetData(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -2342,10 +2289,10 @@ static PyObject *_wrap_wxClipboard_Clear(PyObject *self, PyObject *args, PyObjec } } { - wxPy_BEGIN_ALLOW_THREADS; - wxClipboard_Clear(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxClipboard_Clear(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -2371,10 +2318,10 @@ static PyObject *_wrap_wxClipboard_Flush(PyObject *self, PyObject *args, PyObjec } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxClipboard_Flush(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxClipboard_Flush(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -2399,10 +2346,10 @@ static PyObject *_wrap_wxClipboard_UsePrimarySelection(PyObject *self, PyObject } } { - wxPy_BEGIN_ALLOW_THREADS; - wxClipboard_UsePrimarySelection(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxClipboard_UsePrimarySelection(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -2438,10 +2385,10 @@ static PyObject *_wrap_new_wxDropSource(PyObject *self, PyObject *args, PyObject } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxPyDropSource *)new_wxDropSource(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxPyDropSource *)new_wxDropSource(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxPyDropSource_p"); @@ -2482,10 +2429,10 @@ static PyObject *_wrap_wxDropSource__setCallbackInfo(PyObject *self, PyObject *a _arg2 = _obj2; } { - wxPy_BEGIN_ALLOW_THREADS; - wxDropSource__setCallbackInfo(_arg0,_arg1,_arg2,_arg3); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDropSource__setCallbackInfo(_arg0,_arg1,_arg2,_arg3); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -2510,10 +2457,10 @@ static PyObject *_wrap_delete_wxDropSource(PyObject *self, PyObject *args, PyObj } } { - wxPy_BEGIN_ALLOW_THREADS; - delete_wxPyDropSource(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + delete_wxPyDropSource(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -2547,10 +2494,10 @@ static PyObject *_wrap_wxDropSource_SetData(PyObject *self, PyObject *args, PyOb } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDropSource_SetData(_arg0,*_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDropSource_SetData(_arg0,*_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -2577,10 +2524,10 @@ static PyObject *_wrap_wxDropSource_GetDataObject(PyObject *self, PyObject *args } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDataObject *)wxDropSource_GetDataObject(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDataObject *)wxDropSource_GetDataObject(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDataObject_p"); @@ -2620,10 +2567,10 @@ static PyObject *_wrap_wxDropSource_SetCursor(PyObject *self, PyObject *args, Py } } { - wxPy_BEGIN_ALLOW_THREADS; - wxDropSource_SetCursor(_arg0,_arg1,*_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxDropSource_SetCursor(_arg0,_arg1,*_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -2650,10 +2597,10 @@ static PyObject *_wrap_wxDropSource_DoDragDrop(PyObject *self, PyObject *args, P } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDragResult )wxDropSource_DoDragDrop(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDragResult )wxDropSource_DoDragDrop(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -2679,10 +2626,10 @@ static PyObject *_wrap_wxDropSource_base_GiveFeedback(PyObject *self, PyObject * } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxDropSource_base_GiveFeedback(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxDropSource_base_GiveFeedback(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -2716,10 +2663,10 @@ static PyObject *_wrap_new_wxPyDropTarget(PyObject *self, PyObject *args, PyObje } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxPyDropTarget *)new_wxPyDropTarget(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxPyDropTarget *)new_wxPyDropTarget(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxPyDropTarget_p"); @@ -2759,10 +2706,10 @@ static PyObject *_wrap_wxPyDropTarget__setCallbackInfo(PyObject *self, PyObject _arg2 = _obj2; } { - wxPy_BEGIN_ALLOW_THREADS; - wxPyDropTarget__setCallbackInfo(_arg0,_arg1,_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxPyDropTarget__setCallbackInfo(_arg0,_arg1,_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -2787,10 +2734,10 @@ static PyObject *_wrap_delete_wxPyDropTarget(PyObject *self, PyObject *args, PyO } } { - wxPy_BEGIN_ALLOW_THREADS; - delete_wxPyDropTarget(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + delete_wxPyDropTarget(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -2817,10 +2764,10 @@ static PyObject *_wrap_wxPyDropTarget_GetDataObject(PyObject *self, PyObject *ar } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDataObject *)wxPyDropTarget_GetDataObject(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDataObject *)wxPyDropTarget_GetDataObject(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxDataObject_p"); @@ -2859,10 +2806,10 @@ static PyObject *_wrap_wxPyDropTarget_SetDataObject(PyObject *self, PyObject *ar } } { - wxPy_BEGIN_ALLOW_THREADS; - wxPyDropTarget_SetDataObject(_arg0,_arg1); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxPyDropTarget_SetDataObject(_arg0,_arg1); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -2891,10 +2838,10 @@ static PyObject *_wrap_wxPyDropTarget_base_OnEnter(PyObject *self, PyObject *arg } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDragResult )wxPyDropTarget_base_OnEnter(_arg0,_arg1,_arg2,_arg3); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDragResult )wxPyDropTarget_base_OnEnter(_arg0,_arg1,_arg2,_arg3); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -2922,10 +2869,10 @@ static PyObject *_wrap_wxPyDropTarget_base_OnDragOver(PyObject *self, PyObject * } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDragResult )wxPyDropTarget_base_OnDragOver(_arg0,_arg1,_arg2,_arg3); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDragResult )wxPyDropTarget_base_OnDragOver(_arg0,_arg1,_arg2,_arg3); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -2949,10 +2896,10 @@ static PyObject *_wrap_wxPyDropTarget_base_OnLeave(PyObject *self, PyObject *arg } } { - wxPy_BEGIN_ALLOW_THREADS; - wxPyDropTarget_base_OnLeave(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxPyDropTarget_base_OnLeave(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -2980,10 +2927,10 @@ static PyObject *_wrap_wxPyDropTarget_base_OnDrop(PyObject *self, PyObject *args } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxPyDropTarget_base_OnDrop(_arg0,_arg1,_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxPyDropTarget_base_OnDrop(_arg0,_arg1,_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -3008,10 +2955,10 @@ static PyObject *_wrap_wxPyDropTarget_GetData(PyObject *self, PyObject *args, Py } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxPyDropTarget_GetData(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxPyDropTarget_GetData(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -3044,10 +2991,10 @@ static PyObject *_wrap_new_wxTextDropTarget(PyObject *self, PyObject *args, PyOb if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxTextDropTarget",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxPyTextDropTarget *)new_wxTextDropTarget(); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxPyTextDropTarget *)new_wxTextDropTarget(); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxPyTextDropTarget_p"); @@ -3087,10 +3034,10 @@ static PyObject *_wrap_wxTextDropTarget__setCallbackInfo(PyObject *self, PyObjec _arg2 = _obj2; } { - wxPy_BEGIN_ALLOW_THREADS; - wxTextDropTarget__setCallbackInfo(_arg0,_arg1,_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxTextDropTarget__setCallbackInfo(_arg0,_arg1,_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -3119,10 +3066,10 @@ static PyObject *_wrap_wxTextDropTarget_base_OnEnter(PyObject *self, PyObject *a } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDragResult )wxTextDropTarget_base_OnEnter(_arg0,_arg1,_arg2,_arg3); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDragResult )wxTextDropTarget_base_OnEnter(_arg0,_arg1,_arg2,_arg3); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -3150,10 +3097,10 @@ static PyObject *_wrap_wxTextDropTarget_base_OnDragOver(PyObject *self, PyObject } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDragResult )wxTextDropTarget_base_OnDragOver(_arg0,_arg1,_arg2,_arg3); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDragResult )wxTextDropTarget_base_OnDragOver(_arg0,_arg1,_arg2,_arg3); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -3177,10 +3124,10 @@ static PyObject *_wrap_wxTextDropTarget_base_OnLeave(PyObject *self, PyObject *a } } { - wxPy_BEGIN_ALLOW_THREADS; - wxTextDropTarget_base_OnLeave(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxTextDropTarget_base_OnLeave(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -3208,10 +3155,10 @@ static PyObject *_wrap_wxTextDropTarget_base_OnDrop(PyObject *self, PyObject *ar } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxTextDropTarget_base_OnDrop(_arg0,_arg1,_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxTextDropTarget_base_OnDrop(_arg0,_arg1,_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -3239,10 +3186,10 @@ static PyObject *_wrap_wxTextDropTarget_base_OnData(PyObject *self, PyObject *ar } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDragResult )wxTextDropTarget_base_OnData(_arg0,_arg1,_arg2,_arg3); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDragResult )wxTextDropTarget_base_OnData(_arg0,_arg1,_arg2,_arg3); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -3275,10 +3222,10 @@ static PyObject *_wrap_new_wxFileDropTarget(PyObject *self, PyObject *args, PyOb if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxFileDropTarget",_kwnames)) return NULL; { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxPyFileDropTarget *)new_wxFileDropTarget(); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxPyFileDropTarget *)new_wxFileDropTarget(); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } if (_result) { SWIG_MakePtr(_ptemp, (char *) _result,"_wxPyFileDropTarget_p"); @@ -3318,10 +3265,10 @@ static PyObject *_wrap_wxFileDropTarget__setCallbackInfo(PyObject *self, PyObjec _arg2 = _obj2; } { - wxPy_BEGIN_ALLOW_THREADS; - wxFileDropTarget__setCallbackInfo(_arg0,_arg1,_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxFileDropTarget__setCallbackInfo(_arg0,_arg1,_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -3350,10 +3297,10 @@ static PyObject *_wrap_wxFileDropTarget_base_OnEnter(PyObject *self, PyObject *a } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDragResult )wxFileDropTarget_base_OnEnter(_arg0,_arg1,_arg2,_arg3); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDragResult )wxFileDropTarget_base_OnEnter(_arg0,_arg1,_arg2,_arg3); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -3381,10 +3328,10 @@ static PyObject *_wrap_wxFileDropTarget_base_OnDragOver(PyObject *self, PyObject } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDragResult )wxFileDropTarget_base_OnDragOver(_arg0,_arg1,_arg2,_arg3); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDragResult )wxFileDropTarget_base_OnDragOver(_arg0,_arg1,_arg2,_arg3); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -3408,10 +3355,10 @@ static PyObject *_wrap_wxFileDropTarget_base_OnLeave(PyObject *self, PyObject *a } } { - wxPy_BEGIN_ALLOW_THREADS; - wxFileDropTarget_base_OnLeave(_arg0); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxFileDropTarget_base_OnLeave(_arg0); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; @@ -3439,10 +3386,10 @@ static PyObject *_wrap_wxFileDropTarget_base_OnDrop(PyObject *self, PyObject *ar } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxFileDropTarget_base_OnDrop(_arg0,_arg1,_arg2); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxFileDropTarget_base_OnDrop(_arg0,_arg1,_arg2); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -3470,10 +3417,10 @@ static PyObject *_wrap_wxFileDropTarget_base_OnData(PyObject *self, PyObject *ar } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxDragResult )wxFileDropTarget_base_OnData(_arg0,_arg1,_arg2,_arg3); + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxDragResult )wxFileDropTarget_base_OnData(_arg0,_arg1,_arg2,_arg3); - wxPy_END_ALLOW_THREADS; + wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; @@ -3725,6 +3672,7 @@ SWIGEXPORT(void) initclip_dndc() { PyDict_SetItemString(d,"wxDF_FILENAME", PyInt_FromLong((long) wxDF_FILENAME)); PyDict_SetItemString(d,"wxDF_LOCALE", PyInt_FromLong((long) wxDF_LOCALE)); PyDict_SetItemString(d,"wxDF_PRIVATE", PyInt_FromLong((long) wxDF_PRIVATE)); + PyDict_SetItemString(d,"wxDF_HTML", PyInt_FromLong((long) wxDF_HTML)); PyDict_SetItemString(d,"wxDF_MAX", PyInt_FromLong((long) wxDF_MAX)); PyDict_SetItemString(d,"cvar", SWIG_globals); SWIG_addvarlink(SWIG_globals,"wxFormatInvalid",_wrap_wxPyFormatInvalid_get, _wrap_wxPyFormatInvalid_set);