LibGUI: Allow extra metadata when copying bitmaps to the clipboard
This commit is contained in:
parent
d6ddca0c0f
commit
112035d5c3
Notes:
sideshowbarker
2024-07-17 07:35:03 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/112035d5c3 Pull-request: https://github.com/SerenityOS/serenity/pull/17046 Reviewed-by: https://github.com/gmta ✅
2 changed files with 3 additions and 3 deletions
|
@ -137,9 +137,9 @@ void Clipboard::set_data(ReadonlyBytes data, DeprecatedString const& type, HashM
|
|||
connection().async_set_clipboard_data(move(buffer), type, metadata);
|
||||
}
|
||||
|
||||
void Clipboard::set_bitmap(Gfx::Bitmap const& bitmap)
|
||||
void Clipboard::set_bitmap(Gfx::Bitmap const& bitmap, HashMap<DeprecatedString, DeprecatedString> const& additional_metadata)
|
||||
{
|
||||
HashMap<DeprecatedString, DeprecatedString> metadata;
|
||||
HashMap<DeprecatedString, DeprecatedString> metadata(additional_metadata);
|
||||
metadata.set("width", DeprecatedString::number(bitmap.width()));
|
||||
metadata.set("height", DeprecatedString::number(bitmap.height()));
|
||||
metadata.set("scale", DeprecatedString::number(bitmap.scale()));
|
||||
|
|
|
@ -44,7 +44,7 @@ public:
|
|||
|
||||
void set_data(ReadonlyBytes data, DeprecatedString const& mime_type = "text/plain", HashMap<DeprecatedString, DeprecatedString> const& metadata = {});
|
||||
void set_plain_text(DeprecatedString const& text) { set_data(text.bytes()); }
|
||||
void set_bitmap(Gfx::Bitmap const&);
|
||||
void set_bitmap(Gfx::Bitmap const&, HashMap<DeprecatedString, DeprecatedString> const& additional_metadata = {});
|
||||
void clear();
|
||||
|
||||
void clipboard_data_changed(Badge<ConnectionToClipboardServer>, DeprecatedString const& mime_type);
|
||||
|
|
Loading…
Add table
Reference in a new issue