mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:47:45 +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:
parent
9d2c4d223a
commit
c543ee5c5b
10 changed files with 94 additions and 15 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue