mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-07 09:31:53 +00:00
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:
parent
5fb5066e89
commit
61c0f67c8c
Notes:
github-actions[bot]
2025-05-02 21:47:42 +00:00
Author: https://github.com/trflynn89
Commit: 61c0f67c8c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4548
Reviewed-by: https://github.com/shannonbooth
23 changed files with 255 additions and 28 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue