X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d18c7c6dfc9b9358eadadf8144e01d817674033b..0c8392cac2d36d0d211432e71d3b24d3d93c22db:/wxPython/src/clip_dnd.i diff --git a/wxPython/src/clip_dnd.i b/wxPython/src/clip_dnd.i index 1c0b7b3dc5..0fe784009d 100644 --- a/wxPython/src/clip_dnd.i +++ b/wxPython/src/clip_dnd.i @@ -111,10 +111,13 @@ public: wxDataFormat GetPreferredFormat(Direction dir = wxDataObject::Get); size_t GetFormatCount(Direction dir = wxDataObject::Get); + + // TODO: Fix these two to be usable from wxPython. void GetAllFormats(wxDataFormat *formats, Direction dir = wxDataObject::Get); - size_t GetDataSize(const wxDataFormat& format); bool GetDataHere(const wxDataFormat& format, void *buf); + + size_t GetDataSize(const wxDataFormat& format); bool SetData(const wxDataFormat& format, size_t len, const void * buf); bool IsSupportedFormat(const wxDataFormat& format); @@ -288,8 +291,9 @@ wxBitmap wxPyBitmapDataObject::GetBitmap() { void wxPyBitmapDataObject::SetBitmap(const wxBitmap& bitmap) { wxPyBeginBlockThreads(); if (m_myInst.findCallback("SetBitmap")) { - m_myInst.callCallback(Py_BuildValue("(O)", - wxPyConstructObject((void*)&bitmap, "wxBitmap"))); + PyObject* bo = wxPyConstructObject((void*)&bitmap, wxT("wxBitmap")); + m_myInst.callCallback(Py_BuildValue("(O)", bo)); + Py_DECREF(bo); } wxPyEndBlockThreads(); } @@ -414,12 +418,16 @@ public: void UsePrimarySelection( int primary = FALSE ); }; + +%readonly %{ - // See below in the init function... - wxClipboard* wxPyTheClipboard; +#if 0 +%} +// See also wxPy_ReinitStockObjects in helpers.cpp +extern wxClipboard* wxTheClipboard; +%{ +#endif %} -%readonly -%name(wxTheClipboard) wxClipboard* wxPyTheClipboard; %readwrite //---------------------------------------------------------------------- @@ -450,16 +458,18 @@ bool wxIsDragResultOk(wxDragResult res); %{ class wxPyDropSource : public wxDropSource { public: -#ifdef __WXMSW__ - wxPyDropSource(wxWindow *win = NULL, - const wxCursor &cursorCopy = wxNullCursor, - const wxCursor &cursorMove = wxNullCursor, - const wxCursor &cursorStop = wxNullCursor) - : wxDropSource(win, cursorCopy, cursorMove, cursorStop) {} +#ifndef __WXGTK__ + wxPyDropSource(wxWindow *win = NULL, + const wxCursor © = wxNullCursor, + const wxCursor &move = wxNullCursor, + const wxCursor &none = wxNullCursor) + : wxDropSource(win, copy, move, none) {} #else wxPyDropSource(wxWindow *win = NULL, - const wxIcon &go = wxNullIcon) - : wxDropSource(win, go) {} + const wxIcon& copy = wxNullIcon, + const wxIcon& move = wxNullIcon, + const wxIcon& none = wxNullIcon) + : wxDropSource(win, copy, move, none) {} #endif ~wxPyDropSource() { } @@ -474,14 +484,16 @@ IMP_PYCALLBACK_BOOL_DR(wxPyDropSource, wxDropSource, GiveFeedback); %name(wxDropSource) class wxPyDropSource { public: -#ifdef __WXMSW__ - wxPyDropSource(wxWindow *win = NULL, - const wxCursor &cursorCopy = wxNullCursor, - const wxCursor &cursorMove = wxNullCursor, - const wxCursor &cursorStop = wxNullCursor); +#ifndef __WXGTK__ + wxPyDropSource(wxWindow *win = NULL, + const wxCursor © = wxNullCursor, + const wxCursor &move = wxNullCursor, + const wxCursor &none = wxNullCursor); #else wxPyDropSource(wxWindow *win = NULL, - const wxIcon &go = wxNullIcon); + const wxIcon& copy = wxNullIcon, + const wxIcon& move = wxNullIcon, + const wxIcon& none = wxNullIcon); #endif void _setCallbackInfo(PyObject* self, PyObject* _class, int incref); @@ -625,10 +637,11 @@ bool wxPyFileDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames) { bool rval = FALSE; wxPyBeginBlockThreads(); - PyObject* list = wxArrayString2PyList_helper(filenames); - if (m_myInst.findCallback("OnDropFiles")) + if (m_myInst.findCallback("OnDropFiles")) { + PyObject* list = wxArrayString2PyList_helper(filenames); rval = m_myInst.callCallback(Py_BuildValue("(iiO)",x,y,list)); - Py_DECREF(list); + Py_DECREF(list); + } wxPyEndBlockThreads(); return rval; } @@ -665,7 +678,6 @@ public: %init %{ - wxPyTheClipboard = wxTheClipboard; wxPyPtrTypeMap_Add("wxDropSource", "wxPyDropSource"); wxPyPtrTypeMap_Add("wxTextDropTarget", "wxPyTextDropTarget"); wxPyPtrTypeMap_Add("wxFileDropTarget", "wxPyFileDropTarget");