X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..5bf2abe34850e0952a44f3be4a4390ea12c55bd0:/wxPython/src/clip_dnd.i diff --git a/wxPython/src/clip_dnd.i b/wxPython/src/clip_dnd.i index a9ff1f6f94..634a2f06fc 100644 --- a/wxPython/src/clip_dnd.i +++ b/wxPython/src/clip_dnd.i @@ -147,7 +147,7 @@ bool wxPyDataObjectSimple::GetDataHere(void *buf) { // C++ version. bool rval = FALSE; - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (m_myInst.findCallback("GetDataHere")) { PyObject* ro; ro = m_myInst.callCallbackObj(Py_BuildValue("()")); @@ -158,7 +158,7 @@ bool wxPyDataObjectSimple::GetDataHere(void *buf) { Py_DECREF(ro); } } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return rval; } @@ -166,13 +166,13 @@ 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; - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (m_myInst.findCallback("SetData")) { PyObject* data = PyString_FromStringAndSize((char*)buf, len); rval = m_myInst.callCallback(Py_BuildValue("(O)", data)); Py_DECREF(data); } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return rval; } %} @@ -264,7 +264,7 @@ public: wxBitmap wxPyBitmapDataObject::GetBitmap() { wxBitmap* rval = &wxNullBitmap; - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (m_myInst.findCallback("GetBitmap")) { PyObject* ro; wxBitmap* ptr; @@ -275,17 +275,17 @@ wxBitmap wxPyBitmapDataObject::GetBitmap() { Py_DECREF(ro); } } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return *rval; } void wxPyBitmapDataObject::SetBitmap(const wxBitmap& bitmap) { - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (m_myInst.findCallback("SetBitmap")) { m_myInst.callCallback(Py_BuildValue("(O)", wxPyConstructObject((void*)&bitmap, "wxBitmap"))); } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); } %} @@ -317,8 +317,9 @@ public: return list; } } - - //void AddFile(const wxString &filename); +#ifdef __WXMSW__ + void AddFile(const wxString &filename); +#endif }; @@ -345,6 +346,7 @@ public: } size_t GetSize(); + //void *GetData(); %addmethods { PyObject* GetData() { @@ -361,7 +363,7 @@ public: //---------------------------------------------------------------------- //---------------------------------------------------------------------- -class wxClipboard { +class wxClipboard : public wxObject { public: wxClipboard(); @@ -581,7 +583,7 @@ public: bool wxPyFileDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames) { bool rval = FALSE; - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); PyObject* list = PyList_New(0); for (size_t i=0; i