1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:04:59 +00:00
serenity/Userland/Services/WebContent/WebContentServer.ipc
Timothy Flynn baf359354b LibWebView+WebContent: Use Web::InputEvent for WebContent input IPC
Now that all input events are handled by LibWebView, replace the IPCs
which send the fields of Web::KeyEvent / Web::MouseEvent individually
with one IPC per event type (key or mouse).

We can also replace the ad-hoc queued input structure with a smaller
struct that simply holds the tranferred Web::KeyEvent / Web::MouseEvent.

In the future, we can also adapt Web::EventHandler to use these structs.
2024-03-06 07:46:18 +01:00

103 lines
4.6 KiB
Text

#include <AK/URL.h>
#include <LibIPC/File.h>
#include <LibCore/AnonymousBuffer.h>
#include <LibGfx/Rect.h>
#include <LibGfx/ShareableBitmap.h>
#include <LibWeb/CSS/PreferredColorScheme.h>
#include <LibWeb/CSS/Selector.h>
#include <LibWeb/HTML/ColorPickerUpdateState.h>
#include <LibWeb/HTML/SelectedFile.h>
#include <LibWeb/Page/InputEvent.h>
#include <LibWeb/WebDriver/ExecuteScript.h>
#include <LibWebView/Attribute.h>
endpoint WebContentServer
{
get_window_handle(u64 page_id) => (String handle)
set_window_handle(u64 page_id, String handle) =|
connect_to_webdriver(u64 page_id, ByteString webdriver_ipc_path) =|
update_system_theme(u64 page_id, Core::AnonymousBuffer theme_buffer) =|
update_system_fonts(u64 page_id, ByteString default_font_query, ByteString fixed_width_font_query, ByteString window_title_font_query) =|
update_screen_rects(u64 page_id, Vector<Web::DevicePixelRect> rects, u32 main_screen_index) =|
load_url(u64 page_id, URL url) =|
load_html(u64 page_id, ByteString html) =|
add_backing_store(u64 page_id, i32 front_bitmap_id, Gfx::ShareableBitmap front_bitmap, i32 back_bitmap_id, Gfx::ShareableBitmap back_bitmap) =|
ready_to_paint(u64 page_id) =|
set_viewport_rect(u64 page_id, Web::DevicePixelRect rect) =|
key_event(u64 page_id, Web::KeyEvent event) =|
mouse_event(u64 page_id, Web::MouseEvent event) =|
debug_request(u64 page_id, ByteString request, ByteString argument) =|
get_source(u64 page_id) =|
inspect_dom_tree(u64 page_id) =|
inspect_dom_node(u64 page_id, i32 node_id, Optional<Web::CSS::Selector::PseudoElement::Type> pseudo_element) =|
inspect_accessibility_tree(u64 page_id) =|
get_hovered_node_id(u64 page_id) =|
js_console_input(u64 page_id, ByteString js_source) =|
js_console_request_messages(u64 page_id, i32 start_index) =|
set_dom_node_text(u64 page_id, i32 node_id, String text) =|
set_dom_node_tag(u64 page_id, i32 node_id, String name) =|
add_dom_node_attributes(u64 page_id, i32 node_id, Vector<WebView::Attribute> attributes) =|
replace_dom_node_attribute(u64 page_id, i32 node_id, String name, Vector<WebView::Attribute> replacement_attributes) =|
create_child_element(u64 page_id, i32 node_id) =|
create_child_text_node(u64 page_id, i32 node_id) =|
clone_dom_node(u64 page_id, i32 node_id) =|
remove_dom_node(u64 page_id, i32 node_id) =|
get_dom_node_html(u64 page_id, i32 node_id) =|
take_document_screenshot(u64 page_id) =|
take_dom_node_screenshot(u64 page_id, i32 node_id) =|
dump_gc_graph(u64 page_id) => (String json)
run_javascript(u64 page_id, ByteString js_source) =|
dump_layout_tree(u64 page_id) => (ByteString dump)
dump_paint_tree(u64 page_id) => (ByteString dump)
dump_text(u64 page_id) => (ByteString dump)
get_selected_text(u64 page_id) => (ByteString selection)
select_all(u64 page_id) =|
set_content_filters(u64 page_id, Vector<String> filters) =|
set_autoplay_allowed_on_all_websites(u64 page_id) =|
set_autoplay_allowlist(u64 page_id, Vector<String> allowlist) =|
set_proxy_mappings(u64 page_id, Vector<ByteString> proxies, HashMap<ByteString,size_t> mappings) =|
set_preferred_color_scheme(u64 page_id, Web::CSS::PreferredColorScheme color_scheme) =|
set_has_focus(u64 page_id, bool has_focus) =|
set_is_scripting_enabled(u64 page_id, bool is_scripting_enabled) =|
set_device_pixels_per_css_pixel(u64 page_id, float device_pixels_per_css_pixel) =|
set_window_position(u64 page_id, Web::DevicePixelPoint position) =|
set_window_size(u64 page_id, Web::DevicePixelSize size) =|
get_local_storage_entries(u64 page_id) => (OrderedHashMap<String,String> entries)
get_session_storage_entries(u64 page_id) => (OrderedHashMap<String,String> entries)
handle_file_return(u64 page_id, i32 error, Optional<IPC::File> file, i32 request_id) =|
set_system_visibility_state(u64 page_id, bool visible) =|
alert_closed(u64 page_id) =|
confirm_closed(u64 page_id, bool accepted) =|
prompt_closed(u64 page_id, Optional<String> response) =|
color_picker_update(u64 page_id, Optional<Color> picked_color, Web::HTML::ColorPickerUpdateState state) =|
file_picker_closed(u64 page_id, Vector<Web::HTML::SelectedFile> selected_files) =|
select_dropdown_closed(u64 page_id, Optional<String> value) =|
toggle_media_play_state(u64 page_id) =|
toggle_media_mute_state(u64 page_id) =|
toggle_media_loop_state(u64 page_id) =|
toggle_media_controls_state(u64 page_id) =|
set_user_style(u64 page_id, String source) =|
enable_inspector_prototype(u64 page_id) =|
}