mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:47:34 +00:00
LibGUI: Allow extra metadata when copying bitmaps to the clipboard
This commit is contained in:
parent
d6ddca0c0f
commit
112035d5c3
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);
|
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("width", DeprecatedString::number(bitmap.width()));
|
||||||
metadata.set("height", DeprecatedString::number(bitmap.height()));
|
metadata.set("height", DeprecatedString::number(bitmap.height()));
|
||||||
metadata.set("scale", DeprecatedString::number(bitmap.scale()));
|
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_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_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 clear();
|
||||||
|
|
||||||
void clipboard_data_changed(Badge<ConnectionToClipboardServer>, DeprecatedString const& mime_type);
|
void clipboard_data_changed(Badge<ConnectionToClipboardServer>, DeprecatedString const& mime_type);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue