X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c86f1403c3737c07d58676a203f4707942684a01..3efb01df7b4f5d6adb165119aa219c9ffde3cf42:/include/wx/gtk/dnd.h diff --git a/include/wx/gtk/dnd.h b/include/wx/gtk/dnd.h index fa97fdc5cd..7f72906e47 100644 --- a/include/wx/gtk/dnd.h +++ b/include/wx/gtk/dnd.h @@ -123,7 +123,7 @@ public: wxFileDataObject(void) { } void AddFile( const wxString &file ) - { m_files += file; m_files += ";"; } + { m_files += file; m_files += '\0'; } // implement base class pure virtuals virtual wxDataFormat GetPreferredFormat() const @@ -131,7 +131,7 @@ public: virtual bool IsSupportedFormat(wxDataFormat format) const { return format == wxDF_FILENAME; } virtual size_t GetDataSize() const - { return m_files.Len() + 1; } // +1 for trailing '\0'of course + { return m_files.Len(); } // no trailing '\0' virtual void GetDataHere(void *pBuf) const { memcpy(pBuf, m_files.c_str(), GetDataSize()); } @@ -154,16 +154,16 @@ class wxDropTarget: public wxObject virtual void OnLeave() { } virtual bool OnDrop( long x, long y, const void *pData ) = 0; -// protected: + // implementation - friend wxWindow; + int m_size; // Override these to indicate what kind of data you support: virtual size_t GetFormatCount() const = 0; virtual wxDataFormat GetFormat(size_t n) const = 0; - void Drop( GdkEvent *event, int x, int y ); + void Drop( GdkEventDropDataAvailable *event, int x, int y ); void RegisterWidget( GtkWidget *widget ); void UnregisterWidget( GtkWidget *widget ); }; @@ -210,28 +210,28 @@ 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: @@ -242,7 +242,7 @@ class wxDropSource: public wxObject GtkWidget *m_widget; wxWindow *m_window; - DragResult m_retValue; + wxDragResult m_retValue; wxDataObject *m_data; wxCursor m_defaultCursor;