1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:17:44 +00:00

LibGUI+WindowServer: Make DragOperation hold a MimeData instance

...instead of maybe bitmap + a single mime type and its corresponding data.
This allows drag&drop operations to hold multiple different kinds of
data, and the views/applications to choose between those.
For instance, Spreadsheet can keep the structure of the dragged cells,
and still provide text-only data to be passed to different unrelated editors.
This commit is contained in:
AnotherTest 2020-11-07 23:14:21 +03:30 committed by Andreas Kling
parent c930e02624
commit 6d1e47e7dd
15 changed files with 98 additions and 59 deletions

View file

@ -100,12 +100,11 @@ public:
const ClientConnection* dnd_client() const { return m_dnd_client.ptr(); }
const String& dnd_text() const { return m_dnd_text; }
const String& dnd_data_type() const { return m_dnd_data_type; }
const String& dnd_data() const { return m_dnd_data; }
const Core::MimeData& dnd_mime_data() const { return *m_dnd_mime_data; }
const Gfx::Bitmap* dnd_bitmap() const { return m_dnd_bitmap; }
Gfx::IntRect dnd_rect() const;
void start_dnd_drag(ClientConnection&, const String& text, Gfx::Bitmap*, const String& data_type, const String& data);
void start_dnd_drag(ClientConnection&, const String& text, Gfx::Bitmap*, const Core::MimeData&);
void end_dnd_drag();
Window* active_window() { return m_active_window.ptr(); }
@ -331,8 +330,7 @@ private:
WeakPtr<ClientConnection> m_dnd_client;
String m_dnd_text;
String m_dnd_data_type;
String m_dnd_data;
RefPtr<Core::MimeData> m_dnd_mime_data;
RefPtr<Gfx::Bitmap> m_dnd_bitmap;
};