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

WindowServer+LibGUI: Add data_type and data fields to drag operations

These fields are intended to carry the real meat of a drag operation,
and the "text" is just for what we show on screen (alongside the cursor
during the actual drag.)

The data field is just a String for now, but in the future we should
make it something more flexible.
This commit is contained in:
Andreas Kling 2019-12-19 20:09:31 +01:00
parent af7cb7ce1b
commit cfcb38dff1
13 changed files with 50 additions and 15 deletions

View file

@ -68,10 +68,12 @@ public:
WSClientConnection* dnd_client() { 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 GraphicsBitmap* dnd_bitmap() const { return m_dnd_bitmap; }
Rect dnd_rect() const;
void start_dnd_drag(WSClientConnection&, const String& text, GraphicsBitmap*);
void start_dnd_drag(WSClientConnection&, const String& text, GraphicsBitmap*, const String& data_type, const String& data);
void end_dnd_drag();
WSWindow* active_window() { return m_active_window.ptr(); }
@ -283,6 +285,8 @@ private:
WeakPtr<WSClientConnection> m_dnd_client;
String m_dnd_text;
String m_dnd_data_type;
String m_dnd_data;
RefPtr<GraphicsBitmap> m_dnd_bitmap;
};