mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +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
|
@ -164,6 +164,10 @@ public:
|
|||
void did_request_select_dropdown(WeakPtr<HTML::HTMLSelectElement> target, Web::CSSPixelPoint content_position, Web::CSSPixels minimum_width, Vector<Web::HTML::SelectItem> items);
|
||||
void select_dropdown_closed(Optional<u32> const& selected_item_id);
|
||||
|
||||
using ClipboardRequest = GC::Ref<GC::Function<void(Vector<Clipboard::SystemClipboardItem>)>>;
|
||||
void request_clipboard_entries(ClipboardRequest);
|
||||
void retrieved_clipboard_entries(u64 request_id, Vector<Clipboard::SystemClipboardItem>);
|
||||
|
||||
enum class PendingNonBlockingDialog {
|
||||
None,
|
||||
ColorPicker,
|
||||
|
@ -272,6 +276,9 @@ private:
|
|||
PendingNonBlockingDialog m_pending_non_blocking_dialog { PendingNonBlockingDialog::None };
|
||||
WeakPtr<HTML::HTMLElement> m_pending_non_blocking_dialog_target;
|
||||
|
||||
HashMap<u64, ClipboardRequest> m_pending_clipboard_requests;
|
||||
u64 m_next_clipboard_request_id { 0 };
|
||||
|
||||
Vector<UniqueNodeID> m_media_elements;
|
||||
Optional<UniqueNodeID> m_media_context_menu_element_id;
|
||||
|
||||
|
@ -393,7 +400,8 @@ public:
|
|||
|
||||
virtual void page_did_change_theme_color(Gfx::Color) { }
|
||||
|
||||
virtual void page_did_insert_clipboard_entry([[maybe_unused]] StringView data, [[maybe_unused]] StringView presentation_style, [[maybe_unused]] StringView mime_type) { }
|
||||
virtual void page_did_insert_clipboard_entry(Clipboard::SystemClipboardRepresentation const&, [[maybe_unused]] StringView presentation_style) { }
|
||||
virtual void page_did_request_clipboard_entries([[maybe_unused]] u64 request_id) { }
|
||||
|
||||
virtual void page_did_change_audio_play_state(HTML::AudioPlayState) { }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue