LibWeb+LibWebVew+WebContent+UI: Add IPC to retrieve the system clipboard

We currently have a single IPC to set clipboard data. We will also need
an IPC to retrieve that data from the UI. This defines system clipboard
data in LibWeb to handle this transfer, and adds the IPC to provide it.
This commit is contained in:
Timothy Flynn 2025-05-01 11:38:31 -04:00 committed by Tim Flynn
parent 5fb5066e89
commit 61c0f67c8c
Notes: github-actions[bot] 2025-05-02 21:47:42 +00:00
23 changed files with 255 additions and 28 deletions

View file

@ -633,11 +633,19 @@ void WebContentClient::did_change_theme_color(u64 page_id, Gfx::Color color)
}
}
void WebContentClient::did_insert_clipboard_entry(u64 page_id, String data, String presentation_style, String mime_type)
void WebContentClient::did_insert_clipboard_entry(u64 page_id, Web::Clipboard::SystemClipboardRepresentation entry, String presentation_style)
{
if (auto view = view_for_page_id(page_id); view.has_value()) {
if (view->on_insert_clipboard_entry)
view->on_insert_clipboard_entry(data, presentation_style, mime_type);
view->on_insert_clipboard_entry(move(entry), presentation_style);
}
}
void WebContentClient::did_request_clipboard_entries(u64 page_id, u64 request_id)
{
if (auto view = view_for_page_id(page_id); view.has_value()) {
if (view->on_request_clipboard_entries)
view->on_request_clipboard_entries(request_id);
}
}