mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:17:35 +00:00
SpiceAgent: Implement sending clipboard data to the spice server
This commit is contained in:
parent
9f92e52464
commit
0d98920930
4 changed files with 94 additions and 0 deletions
|
@ -43,6 +43,27 @@ ErrorOr<ClipboardDataType> clipboard_data_type_from_raw_value(u32 value)
|
|||
return static_cast<ClipboardDataType>(value);
|
||||
}
|
||||
|
||||
ErrorOr<ClipboardDataType> clipboard_data_type_from_mime_type(String const& mime_type)
|
||||
{
|
||||
if (mime_type == "text/plain")
|
||||
return ClipboardDataType::Text;
|
||||
|
||||
// We treat image/x-serenityos as a standard PNG here
|
||||
if (mime_type == "image/png" || mime_type == "image/x-serenityos")
|
||||
return ClipboardDataType::PNG;
|
||||
|
||||
if (mime_type == "image/bitmap")
|
||||
return ClipboardDataType::BMP;
|
||||
|
||||
if (mime_type == "image/jpeg")
|
||||
return ClipboardDataType::JPG;
|
||||
|
||||
if (mime_type == "image/tiff")
|
||||
return ClipboardDataType::TIFF;
|
||||
|
||||
return Error::from_string_literal("Unable to determine clipboard data type!");
|
||||
}
|
||||
|
||||
ErrorOr<AnnounceCapabilitiesMessage> AnnounceCapabilitiesMessage::read_from_stream(AK::Stream& stream)
|
||||
{
|
||||
// If this message is a capabilities request, we don't have to parse anything else.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue