X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e3e65dac0c4e7ad19e3c270caa1e0eea138e5d8d..f96aa4d9eb296b3dfc468a351ce013bf92fab983:/include/wx/gtk/dnd.h diff --git a/include/wx/gtk/dnd.h b/include/wx/gtk/dnd.h index 2c2a0f5338..962161ea94 100644 --- a/include/wx/gtk/dnd.h +++ b/include/wx/gtk/dnd.h @@ -80,7 +80,7 @@ public: // StdFormat enumerations or a user-defined format) virtual bool IsSupportedFormat(wxDataFormat format) const = 0; // get the (total) size of data - virtual uint GetDataSize() const = 0; + virtual size_t GetDataSize() const = 0; // copy raw data to provided pointer virtual void GetDataHere(void *pBuf) const = 0; @@ -103,7 +103,7 @@ public: { return wxDF_TEXT; } virtual bool IsSupportedFormat(wxDataFormat format) const { return format == wxDF_TEXT; } - virtual uint GetDataSize() const + virtual size_t GetDataSize() const { return m_strText.Len() + 1; } // +1 for trailing '\0'of course virtual void GetDataHere(void *pBuf) const { memcpy(pBuf, m_strText.c_str(), GetDataSize()); } @@ -130,7 +130,7 @@ public: { return wxDF_FILENAME; } virtual bool IsSupportedFormat(wxDataFormat format) const { return format == wxDF_FILENAME; } - virtual uint GetDataSize() const + virtual size_t GetDataSize() const { return m_files.Len() + 1; } // +1 for trailing '\0'of course virtual void GetDataHere(void *pBuf) const { memcpy(pBuf, m_files.c_str(), GetDataSize()); } @@ -210,37 +210,39 @@ class wxFileDropTarget: public wxDropTarget // wxDropSource //------------------------------------------------------------------------- + enum wxDragResult + { + wxDragError, // error prevented the d&d operation from completing + wxDragNone, // drag target didn't accept the data + wxDragCopy, // the data was successfully copied + wxDragMove, // the data was successfully moved + wxDragCancel // the operation was cancelled by user (not an error) + }; + class wxDropSource: public wxObject { public: - enum DragResult - { - Error, // error prevented the d&d operation from completing - None, // drag target didn't accept the data - Copy, // the data was successfully copied - Move, // the data was successfully moved - Cancel // the operation was cancelled by user (not an error) - }; - wxDropSource( wxWindow *win ); wxDropSource( wxDataObject &data, wxWindow *win ); ~wxDropSource(void); void SetData( wxDataObject &data ); - DragResult DoDragDrop( bool bAllowMove = FALSE ); + wxDragResult DoDragDrop( bool bAllowMove = FALSE ); - virtual bool GiveFeedback( DragResult WXUNUSED(effect), bool WXUNUSED(bScrolling) ) { return TRUE; }; + virtual bool GiveFeedback( wxDragResult WXUNUSED(effect), bool WXUNUSED(bScrolling) ) { return TRUE; }; protected: + friend void gtk_drag_callback( GtkWidget *widget, GdkEvent *event, wxDropSource *source ); + void RegisterWindow(void); void UnregisterWindow(void); GtkWidget *m_widget; wxWindow *m_window; - + wxDragResult m_retValue; wxDataObject *m_data; wxCursor m_defaultCursor;