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

WindowServer+LibGUI: Store a "data type" with the clipboard content

This will allow us to distinguish between different types of data
stored on the clipboard.
This commit is contained in:
Andreas Kling 2019-09-14 09:19:05 +02:00
parent 9d2c4d223a
commit c543ee5c5b
10 changed files with 94 additions and 15 deletions

View file

@ -36,9 +36,13 @@ void WSClipboard::clear()
m_contents_size = 0;
}
void WSClipboard::set_data(NonnullRefPtr<SharedBuffer>&& data, int contents_size)
void WSClipboard::set_data(NonnullRefPtr<SharedBuffer>&& data, int contents_size, const String& data_type)
{
dbgprintf("WSClipboard::set_data <- %p (%u bytes)\n", data->data(), contents_size);
dbg() << "WSClipboard::set_data <- [" << data_type << "] " << data->data() << " (" << contents_size << " bytes)";
m_shared_buffer = move(data);
m_contents_size = contents_size;
m_data_type = data_type;
if (on_content_change)
on_content_change();
}