mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +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
|
|
@ -1257,6 +1257,12 @@ void ConnectionFromClient::select_dropdown_closed(u64 page_id, Optional<u32> sel
|
|||
page->page().select_dropdown_closed(selected_item_id);
|
||||
}
|
||||
|
||||
void ConnectionFromClient::retrieved_clipboard_entries(u64 page_id, u64 request_id, Vector<Web::Clipboard::SystemClipboardItem> items)
|
||||
{
|
||||
if (auto page = this->page(page_id); page.has_value())
|
||||
page->page().retrieved_clipboard_entries(request_id, move(items));
|
||||
}
|
||||
|
||||
void ConnectionFromClient::toggle_media_play_state(u64 page_id)
|
||||
{
|
||||
if (auto page = this->page(page_id); page.has_value())
|
||||
|
|
|
|||
|
|
@ -129,6 +129,8 @@ private:
|
|||
virtual void file_picker_closed(u64 page_id, Vector<Web::HTML::SelectedFile> selected_files) override;
|
||||
virtual void select_dropdown_closed(u64 page_id, Optional<u32> selected_item_id) override;
|
||||
|
||||
virtual void retrieved_clipboard_entries(u64 page_id, u64 request_id, Vector<Web::Clipboard::SystemClipboardItem>) override;
|
||||
|
||||
virtual void toggle_media_play_state(u64 page_id) override;
|
||||
virtual void toggle_media_mute_state(u64 page_id) override;
|
||||
virtual void toggle_media_loop_state(u64 page_id) override;
|
||||
|
|
|
|||
|
|
@ -649,9 +649,14 @@ void PageClient::page_did_change_theme_color(Gfx::Color color)
|
|||
client().async_did_change_theme_color(m_id, color);
|
||||
}
|
||||
|
||||
void PageClient::page_did_insert_clipboard_entry(StringView data, StringView presentation_style, StringView mime_type)
|
||||
void PageClient::page_did_insert_clipboard_entry(Web::Clipboard::SystemClipboardRepresentation const& entry, StringView presentation_style)
|
||||
{
|
||||
client().async_did_insert_clipboard_entry(m_id, data, presentation_style, mime_type);
|
||||
client().async_did_insert_clipboard_entry(m_id, entry, presentation_style);
|
||||
}
|
||||
|
||||
void PageClient::page_did_request_clipboard_entries(u64 request_id)
|
||||
{
|
||||
client().async_did_request_clipboard_entries(m_id, request_id);
|
||||
}
|
||||
|
||||
void PageClient::page_did_change_audio_play_state(Web::HTML::AudioPlayState play_state)
|
||||
|
|
|
|||
|
|
@ -169,7 +169,8 @@ private:
|
|||
virtual void page_did_set_test_timeout(double milliseconds) override;
|
||||
virtual void page_did_set_browser_zoom(double factor) override;
|
||||
virtual void page_did_change_theme_color(Gfx::Color color) override;
|
||||
virtual void page_did_insert_clipboard_entry(StringView data, StringView presentation_style, StringView mime_type) override;
|
||||
virtual void page_did_insert_clipboard_entry(Web::Clipboard::SystemClipboardRepresentation const&, StringView presentation_style) override;
|
||||
virtual void page_did_request_clipboard_entries(u64 request_id) override;
|
||||
virtual void page_did_change_audio_play_state(Web::HTML::AudioPlayState) override;
|
||||
virtual void page_did_allocate_backing_stores(i32 front_bitmap_id, Gfx::ShareableBitmap front_bitmap, i32 back_bitmap_id, Gfx::ShareableBitmap back_bitmap) override;
|
||||
virtual IPC::File request_worker_agent(Web::Bindings::AgentType) override;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
#include <LibGfx/Cursor.h>
|
||||
#include <LibGfx/ShareableBitmap.h>
|
||||
#include <LibURL/URL.h>
|
||||
#include <LibWeb/Bindings/MainThreadVM.h>
|
||||
#include <LibWeb/Clipboard/SystemClipboard.h>
|
||||
#include <LibWeb/Cookie/Cookie.h>
|
||||
#include <LibWeb/Cookie/ParsedCookie.h>
|
||||
#include <LibWeb/CSS/Selector.h>
|
||||
|
|
@ -21,7 +23,6 @@
|
|||
#include <LibWebView/Mutation.h>
|
||||
#include <LibWebView/PageInfo.h>
|
||||
#include <LibWebView/ProcessHandle.h>
|
||||
#include <LibWeb/Bindings/MainThreadVM.h>
|
||||
|
||||
endpoint WebContentClient
|
||||
{
|
||||
|
|
@ -91,7 +92,10 @@ endpoint WebContentClient
|
|||
did_request_select_dropdown(u64 page_id, Gfx::IntPoint content_position, i32 minimum_width, Vector<Web::HTML::SelectItem> items) =|
|
||||
did_finish_handling_input_event(u64 page_id, Web::EventResult event_result) =|
|
||||
did_change_theme_color(u64 page_id, Gfx::Color color) =|
|
||||
did_insert_clipboard_entry(u64 page_id, String data, String presentation_style, String mime_type) =|
|
||||
|
||||
did_insert_clipboard_entry(u64 page_id, Web::Clipboard::SystemClipboardRepresentation entry, String presentation_style) =|
|
||||
did_request_clipboard_entries(u64 page_id, u64 request_id) =|
|
||||
|
||||
did_update_navigation_buttons_state(u64 page_id, bool back_enabled, bool forward_enabled) =|
|
||||
did_allocate_backing_stores(u64 page_id, i32 front_bitmap_id, Gfx::ShareableBitmap front_bitmap, i32 back_bitmap_id, Gfx::ShareableBitmap back_bitmap) =|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include <LibGfx/Rect.h>
|
||||
#include <LibIPC/File.h>
|
||||
#include <LibURL/URL.h>
|
||||
#include <LibWeb/Clipboard/SystemClipboard.h>
|
||||
#include <LibWeb/CSS/PreferredColorScheme.h>
|
||||
#include <LibWeb/CSS/PreferredContrast.h>
|
||||
#include <LibWeb/CSS/PreferredMotion.h>
|
||||
|
|
@ -117,6 +118,8 @@ endpoint WebContentServer
|
|||
file_picker_closed(u64 page_id, Vector<Web::HTML::SelectedFile> selected_files) =|
|
||||
select_dropdown_closed(u64 page_id, Optional<u32> selected_item_id) =|
|
||||
|
||||
retrieved_clipboard_entries(u64 page_id, u64 request_id, Vector<Web::Clipboard::SystemClipboardItem> items) =|
|
||||
|
||||
toggle_media_play_state(u64 page_id) =|
|
||||
toggle_media_mute_state(u64 page_id) =|
|
||||
toggle_media_loop_state(u64 page_id) =|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue