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);
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();
}
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
//----------------------------------------------------------------------
%{
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() { }
%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);
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;
}
%init %{
- wxPyTheClipboard = wxTheClipboard;
wxPyPtrTypeMap_Add("wxDropSource", "wxPyDropSource");
wxPyPtrTypeMap_Add("wxTextDropTarget", "wxPyTextDropTarget");
wxPyPtrTypeMap_Add("wxFileDropTarget", "wxPyFileDropTarget");