mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 17:07:47 +00:00
Userland: Change IPC funcs to use plain arguments instead of a struct
Instead of having a single overloaded handle method each method gets its own unique method name now.
This commit is contained in:
parent
d47f15ab8b
commit
065040872f
50 changed files with 897 additions and 839 deletions
|
@ -80,22 +80,22 @@ int ClientConnection::get_playing_buffer()
|
|||
return send_sync<Messages::AudioServer::GetPlayingBuffer>()->buffer_id();
|
||||
}
|
||||
|
||||
void ClientConnection::handle(const Messages::AudioClient::FinishedPlayingBuffer& message)
|
||||
void ClientConnection::finished_playing_buffer(i32 buffer_id)
|
||||
{
|
||||
if (on_finish_playing_buffer)
|
||||
on_finish_playing_buffer(message.buffer_id());
|
||||
on_finish_playing_buffer(buffer_id);
|
||||
}
|
||||
|
||||
void ClientConnection::handle(const Messages::AudioClient::MutedStateChanged& message)
|
||||
void ClientConnection::muted_state_changed(bool muted)
|
||||
{
|
||||
if (on_muted_state_change)
|
||||
on_muted_state_change(message.muted());
|
||||
on_muted_state_change(muted);
|
||||
}
|
||||
|
||||
void ClientConnection::handle(const Messages::AudioClient::MainMixVolumeChanged& message)
|
||||
void ClientConnection::main_mix_volume_changed(i32 volume)
|
||||
{
|
||||
if (on_main_mix_volume_change)
|
||||
on_main_mix_volume_change(message.volume());
|
||||
on_main_mix_volume_change(volume);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -42,9 +42,9 @@ public:
|
|||
Function<void(int volume)> on_main_mix_volume_change;
|
||||
|
||||
private:
|
||||
virtual void handle(const Messages::AudioClient::FinishedPlayingBuffer&) override;
|
||||
virtual void handle(const Messages::AudioClient::MutedStateChanged&) override;
|
||||
virtual void handle(const Messages::AudioClient::MainMixVolumeChanged&) override;
|
||||
virtual void finished_playing_buffer(i32) override;
|
||||
virtual void muted_state_changed(bool) override;
|
||||
virtual void main_mix_volume_changed(i32) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ private:
|
|||
: IPC::ServerConnection<LaunchClientEndpoint, LaunchServerEndpoint>(*this, "/tmp/portal/launch")
|
||||
{
|
||||
}
|
||||
virtual void handle(const Messages::LaunchClient::Dummy&) override { }
|
||||
virtual void dummy() override { }
|
||||
};
|
||||
|
||||
static LaunchServerConnection& connection()
|
||||
|
|
|
@ -27,7 +27,7 @@ private:
|
|||
: IPC::ServerConnection<ClipboardClientEndpoint, ClipboardServerEndpoint>(*this, "/tmp/portal/clipboard")
|
||||
{
|
||||
}
|
||||
virtual void handle(const Messages::ClipboardClient::ClipboardDataChanged&) override;
|
||||
virtual void clipboard_data_changed(String const& mime_type) override;
|
||||
};
|
||||
|
||||
Clipboard& Clipboard::the()
|
||||
|
@ -78,11 +78,11 @@ void Clipboard::set_data(ReadonlyBytes data, const String& type, const HashMap<S
|
|||
connection().send_sync<Messages::ClipboardServer::SetClipboardData>(move(buffer), type, metadata);
|
||||
}
|
||||
|
||||
void ClipboardServerConnection::handle(const Messages::ClipboardClient::ClipboardDataChanged& message)
|
||||
void ClipboardServerConnection::clipboard_data_changed(String const& mime_type)
|
||||
{
|
||||
auto& clipboard = Clipboard::the();
|
||||
if (clipboard.on_change)
|
||||
clipboard.on_change(message.mime_type());
|
||||
clipboard.on_change(mime_type);
|
||||
}
|
||||
|
||||
RefPtr<Gfx::Bitmap> Clipboard::bitmap() const
|
||||
|
|
|
@ -34,7 +34,7 @@ private:
|
|||
, m_notification(notification)
|
||||
{
|
||||
}
|
||||
virtual void handle(const Messages::NotificationClient::Dummy&) override { }
|
||||
virtual void dummy() override { }
|
||||
Notification* m_notification;
|
||||
};
|
||||
|
||||
|
|
|
@ -24,40 +24,42 @@ void WindowManagerServerConnection::handshake()
|
|||
// :^)
|
||||
}
|
||||
|
||||
void WindowManagerServerConnection::handle(const Messages::WindowManagerClient::WindowStateChanged& message)
|
||||
void WindowManagerServerConnection::window_state_changed(i32 wm_id, i32 client_id, i32 window_id,
|
||||
i32 parent_client_id, i32 parent_window_id, bool is_active, bool is_minimized, bool is_modal,
|
||||
bool is_frameless, i32 window_type, String const& title, Gfx::IntRect const& rect, Optional<i32> const& progress)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.wm_id()))
|
||||
Core::EventLoop::current().post_event(*window, make<WMWindowStateChangedEvent>(message.client_id(), message.window_id(), message.parent_client_id(), message.parent_window_id(), message.title(), message.rect(), message.is_active(), message.is_modal(), static_cast<WindowType>(message.window_type()), message.is_minimized(), message.is_frameless(), message.progress()));
|
||||
if (auto* window = Window::from_window_id(wm_id))
|
||||
Core::EventLoop::current().post_event(*window, make<WMWindowStateChangedEvent>(client_id, window_id, parent_client_id, parent_window_id, title, rect, is_active, is_modal, static_cast<WindowType>(window_type), is_minimized, is_frameless, progress));
|
||||
}
|
||||
|
||||
void WindowManagerServerConnection::handle(const Messages::WindowManagerClient::AppletAreaSizeChanged& message)
|
||||
void WindowManagerServerConnection::applet_area_size_changed(i32 wm_id, const Gfx::IntSize& size)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.wm_id()))
|
||||
Core::EventLoop::current().post_event(*window, make<WMAppletAreaSizeChangedEvent>(message.size()));
|
||||
if (auto* window = Window::from_window_id(wm_id))
|
||||
Core::EventLoop::current().post_event(*window, make<WMAppletAreaSizeChangedEvent>(size));
|
||||
}
|
||||
|
||||
void WindowManagerServerConnection::handle(const Messages::WindowManagerClient::WindowRectChanged& message)
|
||||
void WindowManagerServerConnection::window_rect_changed(i32 wm_id, i32 client_id, i32 window_id, Gfx::IntRect const& rect)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.wm_id()))
|
||||
Core::EventLoop::current().post_event(*window, make<WMWindowRectChangedEvent>(message.client_id(), message.window_id(), message.rect()));
|
||||
if (auto* window = Window::from_window_id(wm_id))
|
||||
Core::EventLoop::current().post_event(*window, make<WMWindowRectChangedEvent>(client_id, window_id, rect));
|
||||
}
|
||||
|
||||
void WindowManagerServerConnection::handle(const Messages::WindowManagerClient::WindowIconBitmapChanged& message)
|
||||
void WindowManagerServerConnection::window_icon_bitmap_changed(i32 wm_id, i32 client_id, i32 window_id, Gfx::ShareableBitmap const& bitmap)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.wm_id())) {
|
||||
Core::EventLoop::current().post_event(*window, make<WMWindowIconBitmapChangedEvent>(message.client_id(), message.window_id(), message.bitmap().bitmap()));
|
||||
if (auto* window = Window::from_window_id(wm_id)) {
|
||||
Core::EventLoop::current().post_event(*window, make<WMWindowIconBitmapChangedEvent>(client_id, window_id, bitmap.bitmap()));
|
||||
}
|
||||
}
|
||||
|
||||
void WindowManagerServerConnection::handle(const Messages::WindowManagerClient::WindowRemoved& message)
|
||||
void WindowManagerServerConnection::window_removed(i32 wm_id, i32 client_id, i32 window_id)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.wm_id()))
|
||||
Core::EventLoop::current().post_event(*window, make<WMWindowRemovedEvent>(message.client_id(), message.window_id()));
|
||||
if (auto* window = Window::from_window_id(wm_id))
|
||||
Core::EventLoop::current().post_event(*window, make<WMWindowRemovedEvent>(client_id, window_id));
|
||||
}
|
||||
|
||||
void WindowManagerServerConnection::handle(const Messages::WindowManagerClient::SuperKeyPressed& message)
|
||||
void WindowManagerServerConnection::super_key_pressed(i32 wm_id)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.wm_id()))
|
||||
Core::EventLoop::current().post_event(*window, make<WMSuperKeyPressedEvent>(message.wm_id()));
|
||||
if (auto* window = Window::from_window_id(wm_id))
|
||||
Core::EventLoop::current().post_event(*window, make<WMSuperKeyPressedEvent>(wm_id));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,12 +27,12 @@ public:
|
|||
static WindowManagerServerConnection& the();
|
||||
|
||||
private:
|
||||
virtual void handle(const Messages::WindowManagerClient::WindowRemoved&) override;
|
||||
virtual void handle(const Messages::WindowManagerClient::WindowStateChanged&) override;
|
||||
virtual void handle(const Messages::WindowManagerClient::WindowIconBitmapChanged&) override;
|
||||
virtual void handle(const Messages::WindowManagerClient::WindowRectChanged&) override;
|
||||
virtual void handle(const Messages::WindowManagerClient::AppletAreaSizeChanged&) override;
|
||||
virtual void handle(const Messages::WindowManagerClient::SuperKeyPressed&) override;
|
||||
virtual void window_removed(i32, i32, i32) override;
|
||||
virtual void window_state_changed(i32, i32, i32, i32, i32, bool, bool, bool, bool, i32, String const&, Gfx::IntRect const&, Optional<i32> const&) override;
|
||||
virtual void window_icon_bitmap_changed(i32, i32, i32, Gfx::ShareableBitmap const&) override;
|
||||
virtual void window_rect_changed(i32, i32, i32, Gfx::IntRect const&) override;
|
||||
virtual void applet_area_size_changed(i32, Gfx::IntSize const&) override;
|
||||
virtual void super_key_pressed(i32) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -47,77 +47,77 @@ void WindowServerConnection::handshake()
|
|||
Desktop::the().did_receive_screen_rect({}, response->screen_rect());
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::UpdateSystemTheme& message)
|
||||
void WindowServerConnection::update_system_theme(Core::AnonymousBuffer const& theme_buffer)
|
||||
{
|
||||
set_system_theme_from_anonymous_buffer(message.theme_buffer());
|
||||
set_system_theme_from_anonymous_buffer(theme_buffer);
|
||||
Window::update_all_windows({});
|
||||
Window::for_each_window({}, [](auto& window) {
|
||||
Core::EventLoop::current().post_event(window, make<ThemeChangeEvent>());
|
||||
});
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::Paint& message)
|
||||
void WindowServerConnection::paint(i32 window_id, Gfx::IntSize const& window_size, Vector<Gfx::IntRect> const& rects)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.window_id()))
|
||||
Core::EventLoop::current().post_event(*window, make<MultiPaintEvent>(message.rects(), message.window_size()));
|
||||
if (auto* window = Window::from_window_id(window_id))
|
||||
Core::EventLoop::current().post_event(*window, make<MultiPaintEvent>(rects, window_size));
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::WindowResized& message)
|
||||
void WindowServerConnection::window_resized(i32 window_id, Gfx::IntRect const& new_rect)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.window_id())) {
|
||||
Core::EventLoop::current().post_event(*window, make<ResizeEvent>(message.new_rect().size()));
|
||||
if (auto* window = Window::from_window_id(window_id)) {
|
||||
Core::EventLoop::current().post_event(*window, make<ResizeEvent>(new_rect.size()));
|
||||
}
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::WindowActivated& message)
|
||||
void WindowServerConnection::window_activated(i32 window_id)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.window_id()))
|
||||
if (auto* window = Window::from_window_id(window_id))
|
||||
Core::EventLoop::current().post_event(*window, make<Event>(Event::WindowBecameActive));
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::WindowDeactivated& message)
|
||||
void WindowServerConnection::window_deactivated(i32 window_id)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.window_id()))
|
||||
if (auto* window = Window::from_window_id(window_id))
|
||||
Core::EventLoop::current().post_event(*window, make<Event>(Event::WindowBecameInactive));
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::WindowInputEntered& message)
|
||||
void WindowServerConnection::window_input_entered(i32 window_id)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.window_id()))
|
||||
if (auto* window = Window::from_window_id(window_id))
|
||||
Core::EventLoop::current().post_event(*window, make<Event>(Event::WindowInputEntered));
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::WindowInputLeft& message)
|
||||
void WindowServerConnection::window_input_left(i32 window_id)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.window_id()))
|
||||
if (auto* window = Window::from_window_id(window_id))
|
||||
Core::EventLoop::current().post_event(*window, make<Event>(Event::WindowInputLeft));
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::WindowCloseRequest& message)
|
||||
void WindowServerConnection::window_close_request(i32 window_id)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.window_id()))
|
||||
if (auto* window = Window::from_window_id(window_id))
|
||||
Core::EventLoop::current().post_event(*window, make<Event>(Event::WindowCloseRequest));
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::WindowEntered& message)
|
||||
void WindowServerConnection::window_entered(i32 window_id)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.window_id()))
|
||||
if (auto* window = Window::from_window_id(window_id))
|
||||
Core::EventLoop::current().post_event(*window, make<Event>(Event::WindowEntered));
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::WindowLeft& message)
|
||||
void WindowServerConnection::window_left(i32 window_id)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.window_id()))
|
||||
if (auto* window = Window::from_window_id(window_id))
|
||||
Core::EventLoop::current().post_event(*window, make<Event>(Event::WindowLeft));
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::KeyDown& message)
|
||||
void WindowServerConnection::key_down(i32 window_id, u32 code_point, u32 key, u32 modifiers, u32 scancode)
|
||||
{
|
||||
auto* window = Window::from_window_id(message.window_id());
|
||||
auto* window = Window::from_window_id(window_id);
|
||||
if (!window)
|
||||
return;
|
||||
|
||||
auto key_event = make<KeyEvent>(Event::KeyDown, (KeyCode)message.key(), message.modifiers(), message.code_point(), message.scancode());
|
||||
auto key_event = make<KeyEvent>(Event::KeyDown, (KeyCode)key, modifiers, code_point, scancode);
|
||||
Action* action = nullptr;
|
||||
|
||||
dbgln_if(KEYBOARD_SHORTCUTS_DEBUG, "Looking up action for {}", key_event->to_string());
|
||||
|
@ -151,7 +151,7 @@ void WindowServerConnection::handle(const Messages::WindowClient::KeyDown& messa
|
|||
}
|
||||
|
||||
bool focused_widget_accepts_emoji_input = window->focused_widget() && window->focused_widget()->accepts_emoji_input();
|
||||
if (focused_widget_accepts_emoji_input && (message.modifiers() == (Mod_Ctrl | Mod_Alt)) && message.key() == Key_Space) {
|
||||
if (focused_widget_accepts_emoji_input && (modifiers == (Mod_Ctrl | Mod_Alt)) && key == Key_Space) {
|
||||
auto emoji_input_dialog = EmojiInputDialog::construct(window);
|
||||
if (emoji_input_dialog->exec() != EmojiInputDialog::ExecOK)
|
||||
return;
|
||||
|
@ -159,21 +159,21 @@ void WindowServerConnection::handle(const Messages::WindowClient::KeyDown& messa
|
|||
key_event->m_modifiers = 0;
|
||||
|
||||
Utf8View m_utf8_view(emoji_input_dialog->selected_emoji_text().characters());
|
||||
u32 code_point = *m_utf8_view.begin();
|
||||
u32 emoji_code_point = *m_utf8_view.begin();
|
||||
|
||||
key_event->m_code_point = code_point;
|
||||
key_event->m_code_point = emoji_code_point;
|
||||
}
|
||||
|
||||
Core::EventLoop::current().post_event(*window, move(key_event));
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::KeyUp& message)
|
||||
void WindowServerConnection::key_up(i32 window_id, u32 code_point, u32 key, u32 modifiers, u32 scancode)
|
||||
{
|
||||
auto* window = Window::from_window_id(message.window_id());
|
||||
auto* window = Window::from_window_id(window_id);
|
||||
if (!window)
|
||||
return;
|
||||
|
||||
auto key_event = make<KeyEvent>(Event::KeyUp, (KeyCode)message.key(), message.modifiers(), message.code_point(), message.scancode());
|
||||
auto key_event = make<KeyEvent>(Event::KeyUp, (KeyCode)key, modifiers, code_point, scancode);
|
||||
Core::EventLoop::current().post_event(*window, move(key_event));
|
||||
}
|
||||
|
||||
|
@ -198,69 +198,69 @@ static MouseButton to_gmousebutton(u32 button)
|
|||
}
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::MouseDown& message)
|
||||
void WindowServerConnection::mouse_down(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.window_id()))
|
||||
Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseDown, message.mouse_position(), message.buttons(), to_gmousebutton(message.button()), message.modifiers(), message.wheel_delta()));
|
||||
if (auto* window = Window::from_window_id(window_id))
|
||||
Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseDown, mouse_position, buttons, to_gmousebutton(button), modifiers, wheel_delta));
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::MouseUp& message)
|
||||
void WindowServerConnection::mouse_up(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.window_id()))
|
||||
Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseUp, message.mouse_position(), message.buttons(), to_gmousebutton(message.button()), message.modifiers(), message.wheel_delta()));
|
||||
if (auto* window = Window::from_window_id(window_id))
|
||||
Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseUp, mouse_position, buttons, to_gmousebutton(button), modifiers, wheel_delta));
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::MouseMove& message)
|
||||
void WindowServerConnection::mouse_move(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta, bool is_drag, Vector<String> const& mime_types)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.window_id())) {
|
||||
if (message.is_drag())
|
||||
Core::EventLoop::current().post_event(*window, make<DragEvent>(Event::DragMove, message.mouse_position(), message.mime_types()));
|
||||
if (auto* window = Window::from_window_id(window_id)) {
|
||||
if (is_drag)
|
||||
Core::EventLoop::current().post_event(*window, make<DragEvent>(Event::DragMove, mouse_position, mime_types));
|
||||
else
|
||||
Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseMove, message.mouse_position(), message.buttons(), to_gmousebutton(message.button()), message.modifiers(), message.wheel_delta()));
|
||||
Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseMove, mouse_position, buttons, to_gmousebutton(button), modifiers, wheel_delta));
|
||||
}
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::MouseDoubleClick& message)
|
||||
void WindowServerConnection::mouse_double_click(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.window_id()))
|
||||
Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseDoubleClick, message.mouse_position(), message.buttons(), to_gmousebutton(message.button()), message.modifiers(), message.wheel_delta()));
|
||||
if (auto* window = Window::from_window_id(window_id))
|
||||
Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseDoubleClick, mouse_position, buttons, to_gmousebutton(button), modifiers, wheel_delta));
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::MouseWheel& message)
|
||||
void WindowServerConnection::mouse_wheel(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.window_id()))
|
||||
Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseWheel, message.mouse_position(), message.buttons(), to_gmousebutton(message.button()), message.modifiers(), message.wheel_delta()));
|
||||
if (auto* window = Window::from_window_id(window_id))
|
||||
Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseWheel, mouse_position, buttons, to_gmousebutton(button), modifiers, wheel_delta));
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::MenuVisibilityDidChange& message)
|
||||
void WindowServerConnection::menu_visibility_did_change(i32 menu_id, bool visible)
|
||||
{
|
||||
auto* menu = Menu::from_menu_id(message.menu_id());
|
||||
auto* menu = Menu::from_menu_id(menu_id);
|
||||
if (!menu) {
|
||||
dbgln("EventLoop received visibility change event for invalid menu ID {}", message.menu_id());
|
||||
dbgln("EventLoop received visibility change event for invalid menu ID {}", menu_id);
|
||||
return;
|
||||
}
|
||||
menu->visibility_did_change({}, message.visible());
|
||||
menu->visibility_did_change({}, visible);
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::MenuItemActivated& message)
|
||||
void WindowServerConnection::menu_item_activated(i32 menu_id, u32 identifier)
|
||||
{
|
||||
auto* menu = Menu::from_menu_id(message.menu_id());
|
||||
auto* menu = Menu::from_menu_id(menu_id);
|
||||
if (!menu) {
|
||||
dbgln("EventLoop received event for invalid menu ID {}", message.menu_id());
|
||||
dbgln("EventLoop received event for invalid menu ID {}", menu_id);
|
||||
return;
|
||||
}
|
||||
if (auto* action = menu->action_at(message.identifier()))
|
||||
if (auto* action = menu->action_at(identifier))
|
||||
action->activate(menu);
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(Messages::WindowClient::MenuItemEntered const& message)
|
||||
void WindowServerConnection::menu_item_entered(i32 menu_id, u32 identifier)
|
||||
{
|
||||
auto* menu = Menu::from_menu_id(message.menu_id());
|
||||
auto* menu = Menu::from_menu_id(menu_id);
|
||||
if (!menu) {
|
||||
dbgln("WindowServerConnection received MenuItemEntered for invalid menu ID {}", message.menu_id());
|
||||
dbgln("WindowServerConnection received MenuItemEntered for invalid menu ID {}", menu_id);
|
||||
return;
|
||||
}
|
||||
auto* action = menu->action_at(message.identifier());
|
||||
auto* action = menu->action_at(identifier);
|
||||
if (!action)
|
||||
return;
|
||||
auto* app = Application::the();
|
||||
|
@ -269,14 +269,14 @@ void WindowServerConnection::handle(Messages::WindowClient::MenuItemEntered cons
|
|||
Core::EventLoop::current().post_event(*app, make<ActionEvent>(GUI::Event::ActionEnter, *action));
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(Messages::WindowClient::MenuItemLeft const& message)
|
||||
void WindowServerConnection::menu_item_left(i32 menu_id, u32 identifier)
|
||||
{
|
||||
auto* menu = Menu::from_menu_id(message.menu_id());
|
||||
auto* menu = Menu::from_menu_id(menu_id);
|
||||
if (!menu) {
|
||||
dbgln("WindowServerConnection received MenuItemLeft for invalid menu ID {}", message.menu_id());
|
||||
dbgln("WindowServerConnection received MenuItemLeft for invalid menu ID {}", menu_id);
|
||||
return;
|
||||
}
|
||||
auto* action = menu->action_at(message.identifier());
|
||||
auto* action = menu->action_at(identifier);
|
||||
if (!action)
|
||||
return;
|
||||
auto* app = Application::the();
|
||||
|
@ -285,45 +285,45 @@ void WindowServerConnection::handle(Messages::WindowClient::MenuItemLeft const&
|
|||
Core::EventLoop::current().post_event(*app, make<ActionEvent>(GUI::Event::ActionLeave, *action));
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::ScreenRectChanged& message)
|
||||
void WindowServerConnection::screen_rect_changed(Gfx::IntRect const& rect)
|
||||
{
|
||||
Desktop::the().did_receive_screen_rect({}, message.rect());
|
||||
Window::for_each_window({}, [message](auto& window) {
|
||||
Core::EventLoop::current().post_event(window, make<ScreenRectChangeEvent>(message.rect()));
|
||||
Desktop::the().did_receive_screen_rect({}, rect);
|
||||
Window::for_each_window({}, [rect](auto& window) {
|
||||
Core::EventLoop::current().post_event(window, make<ScreenRectChangeEvent>(rect));
|
||||
});
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::AsyncSetWallpaperFinished&)
|
||||
void WindowServerConnection::async_set_wallpaper_finished(bool)
|
||||
{
|
||||
// This is handled manually by Desktop::set_wallpaper().
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::DragDropped& message)
|
||||
void WindowServerConnection::drag_dropped(i32 window_id, Gfx::IntPoint const& mouse_position, String const& text, HashMap<String, ByteBuffer> const& mime_data)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.window_id())) {
|
||||
auto mime_data = Core::MimeData::construct(message.mime_data());
|
||||
Core::EventLoop::current().post_event(*window, make<DropEvent>(message.mouse_position(), message.text(), mime_data));
|
||||
if (auto* window = Window::from_window_id(window_id)) {
|
||||
auto mime_data_obj = Core::MimeData::construct(mime_data);
|
||||
Core::EventLoop::current().post_event(*window, make<DropEvent>(mouse_position, text, mime_data_obj));
|
||||
}
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::DragAccepted&)
|
||||
void WindowServerConnection::drag_accepted()
|
||||
{
|
||||
DragOperation::notify_accepted({});
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::DragCancelled&)
|
||||
void WindowServerConnection::drag_cancelled()
|
||||
{
|
||||
DragOperation::notify_cancelled({});
|
||||
Application::the()->notify_drag_cancelled({});
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::WindowStateChanged& message)
|
||||
void WindowServerConnection::window_state_changed(i32 window_id, bool minimized, bool occluded)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.window_id()))
|
||||
window->notify_state_changed({}, message.minimized(), message.occluded());
|
||||
if (auto* window = Window::from_window_id(window_id))
|
||||
window->notify_state_changed({}, minimized, occluded);
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::DisplayLinkNotification&)
|
||||
void WindowServerConnection::display_link_notification()
|
||||
{
|
||||
if (m_display_link_notification_pending)
|
||||
return;
|
||||
|
@ -335,7 +335,7 @@ void WindowServerConnection::handle(const Messages::WindowClient::DisplayLinkNot
|
|||
});
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::Ping&)
|
||||
void WindowServerConnection::ping()
|
||||
{
|
||||
post_message(Messages::WindowServer::Pong());
|
||||
}
|
||||
|
|
|
@ -27,35 +27,35 @@ public:
|
|||
static WindowServerConnection& the();
|
||||
|
||||
private:
|
||||
virtual void handle(const Messages::WindowClient::Paint&) override;
|
||||
virtual void handle(const Messages::WindowClient::MouseMove&) override;
|
||||
virtual void handle(const Messages::WindowClient::MouseDown&) override;
|
||||
virtual void handle(const Messages::WindowClient::MouseDoubleClick&) override;
|
||||
virtual void handle(const Messages::WindowClient::MouseUp&) override;
|
||||
virtual void handle(const Messages::WindowClient::MouseWheel&) override;
|
||||
virtual void handle(const Messages::WindowClient::WindowEntered&) override;
|
||||
virtual void handle(const Messages::WindowClient::WindowLeft&) override;
|
||||
virtual void handle(const Messages::WindowClient::KeyDown&) override;
|
||||
virtual void handle(const Messages::WindowClient::KeyUp&) override;
|
||||
virtual void handle(const Messages::WindowClient::WindowActivated&) override;
|
||||
virtual void handle(const Messages::WindowClient::WindowDeactivated&) override;
|
||||
virtual void handle(const Messages::WindowClient::WindowInputEntered&) override;
|
||||
virtual void handle(const Messages::WindowClient::WindowInputLeft&) override;
|
||||
virtual void handle(const Messages::WindowClient::WindowCloseRequest&) override;
|
||||
virtual void handle(const Messages::WindowClient::WindowResized&) override;
|
||||
virtual void handle(const Messages::WindowClient::MenuItemActivated&) override;
|
||||
virtual void handle(const Messages::WindowClient::MenuItemEntered&) override;
|
||||
virtual void handle(const Messages::WindowClient::MenuItemLeft&) override;
|
||||
virtual void handle(const Messages::WindowClient::MenuVisibilityDidChange&) override;
|
||||
virtual void handle(const Messages::WindowClient::ScreenRectChanged&) override;
|
||||
virtual void handle(const Messages::WindowClient::AsyncSetWallpaperFinished&) override;
|
||||
virtual void handle(const Messages::WindowClient::DragDropped&) override;
|
||||
virtual void handle(const Messages::WindowClient::DragAccepted&) override;
|
||||
virtual void handle(const Messages::WindowClient::DragCancelled&) override;
|
||||
virtual void handle(const Messages::WindowClient::UpdateSystemTheme&) override;
|
||||
virtual void handle(const Messages::WindowClient::WindowStateChanged&) override;
|
||||
virtual void handle(const Messages::WindowClient::DisplayLinkNotification&) override;
|
||||
virtual void handle(const Messages::WindowClient::Ping&) override;
|
||||
virtual void paint(i32, Gfx::IntSize const&, Vector<Gfx::IntRect> const&) override;
|
||||
virtual void mouse_move(i32, Gfx::IntPoint const&, u32, u32, u32, i32, bool, Vector<String> const&) override;
|
||||
virtual void mouse_down(i32, Gfx::IntPoint const&, u32, u32, u32, i32) override;
|
||||
virtual void mouse_double_click(i32, Gfx::IntPoint const&, u32, u32, u32, i32) override;
|
||||
virtual void mouse_up(i32, Gfx::IntPoint const&, u32, u32, u32, i32) override;
|
||||
virtual void mouse_wheel(i32, Gfx::IntPoint const&, u32, u32, u32, i32) override;
|
||||
virtual void window_entered(i32) override;
|
||||
virtual void window_left(i32) override;
|
||||
virtual void key_down(i32, u32, u32, u32, u32) override;
|
||||
virtual void key_up(i32, u32, u32, u32, u32) override;
|
||||
virtual void window_activated(i32) override;
|
||||
virtual void window_deactivated(i32) override;
|
||||
virtual void window_input_entered(i32) override;
|
||||
virtual void window_input_left(i32) override;
|
||||
virtual void window_close_request(i32) override;
|
||||
virtual void window_resized(i32, Gfx::IntRect const&) override;
|
||||
virtual void menu_item_activated(i32, u32) override;
|
||||
virtual void menu_item_entered(i32, u32) override;
|
||||
virtual void menu_item_left(i32, u32) override;
|
||||
virtual void menu_visibility_did_change(i32, bool) override;
|
||||
virtual void screen_rect_changed(Gfx::IntRect const&) override;
|
||||
virtual void async_set_wallpaper_finished(bool) override;
|
||||
virtual void drag_dropped(i32, Gfx::IntPoint const&, String const&, HashMap<String, ByteBuffer> const&) override;
|
||||
virtual void drag_accepted() override;
|
||||
virtual void drag_cancelled() override;
|
||||
virtual void update_system_theme(Core::AnonymousBuffer const&) override;
|
||||
virtual void window_state_changed(i32, bool, bool) override;
|
||||
virtual void display_link_notification() override;
|
||||
virtual void ping() override;
|
||||
|
||||
bool m_display_link_notification_pending { false };
|
||||
};
|
||||
|
|
|
@ -26,7 +26,7 @@ void Client::handshake()
|
|||
send_sync<Messages::ImageDecoderServer::Greet>();
|
||||
}
|
||||
|
||||
void Client::handle(const Messages::ImageDecoderClient::Dummy&)
|
||||
void Client::dummy()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ private:
|
|||
|
||||
virtual void die() override;
|
||||
|
||||
virtual void handle(const Messages::ImageDecoderClient::Dummy&) override;
|
||||
virtual void dummy() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -58,34 +58,34 @@ bool RequestClient::set_certificate(Badge<Request>, Request& request, String cer
|
|||
return send_sync<Messages::RequestServer::SetCertificate>(request.id(), move(certificate), move(key))->success();
|
||||
}
|
||||
|
||||
void RequestClient::handle(const Messages::RequestClient::RequestFinished& message)
|
||||
void RequestClient::request_finished(i32 request_id, bool success, u32 total_size)
|
||||
{
|
||||
RefPtr<Request> request;
|
||||
if ((request = m_requests.get(message.request_id()).value_or(nullptr))) {
|
||||
request->did_finish({}, message.success(), message.total_size());
|
||||
if ((request = m_requests.get(request_id).value_or(nullptr))) {
|
||||
request->did_finish({}, success, total_size);
|
||||
}
|
||||
m_requests.remove(message.request_id());
|
||||
m_requests.remove(request_id);
|
||||
}
|
||||
|
||||
void RequestClient::handle(const Messages::RequestClient::RequestProgress& message)
|
||||
void RequestClient::request_progress(i32 request_id, const Optional<u32>& total_size, u32 downloaded_size)
|
||||
{
|
||||
if (auto request = const_cast<Request*>(m_requests.get(message.request_id()).value_or(nullptr))) {
|
||||
request->did_progress({}, message.total_size(), message.downloaded_size());
|
||||
if (auto request = const_cast<Request*>(m_requests.get(request_id).value_or(nullptr))) {
|
||||
request->did_progress({}, total_size, downloaded_size);
|
||||
}
|
||||
}
|
||||
|
||||
void RequestClient::handle(const Messages::RequestClient::HeadersBecameAvailable& message)
|
||||
void RequestClient::headers_became_available(i32 request_id, const IPC::Dictionary& response_headers, const Optional<u32>& status_code)
|
||||
{
|
||||
if (auto request = const_cast<Request*>(m_requests.get(message.request_id()).value_or(nullptr))) {
|
||||
if (auto request = const_cast<Request*>(m_requests.get(request_id).value_or(nullptr))) {
|
||||
HashMap<String, String, CaseInsensitiveStringTraits> headers;
|
||||
message.response_headers().for_each_entry([&](auto& name, auto& value) { headers.set(name, value); });
|
||||
request->did_receive_headers({}, headers, message.status_code());
|
||||
response_headers.for_each_entry([&](auto& name, auto& value) { headers.set(name, value); });
|
||||
request->did_receive_headers({}, headers, status_code);
|
||||
}
|
||||
}
|
||||
|
||||
void RequestClient::handle(const Messages::RequestClient::CertificateRequested& message)
|
||||
void RequestClient::certificate_requested(i32 request_id)
|
||||
{
|
||||
if (auto request = const_cast<Request*>(m_requests.get(message.request_id()).value_or(nullptr))) {
|
||||
if (auto request = const_cast<Request*>(m_requests.get(request_id).value_or(nullptr))) {
|
||||
request->did_request_certificates({});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,10 +33,10 @@ public:
|
|||
private:
|
||||
RequestClient();
|
||||
|
||||
virtual void handle(const Messages::RequestClient::RequestProgress&) override;
|
||||
virtual void handle(const Messages::RequestClient::RequestFinished&) override;
|
||||
virtual void handle(const Messages::RequestClient::CertificateRequested&) override;
|
||||
virtual void handle(const Messages::RequestClient::HeadersBecameAvailable&) override;
|
||||
virtual void request_progress(i32, Optional<u32> const&, u32) override;
|
||||
virtual void request_finished(i32, bool, u32) override;
|
||||
virtual void certificate_requested(i32) override;
|
||||
virtual void headers_became_available(i32, IPC::Dictionary const&, Optional<u32> const&) override;
|
||||
|
||||
HashMap<i32, RefPtr<Request>> m_requests;
|
||||
};
|
||||
|
|
|
@ -62,37 +62,37 @@ bool WebSocketClient::set_certificate(Badge<WebSocket>, WebSocket& connection, S
|
|||
return send_sync<Messages::WebSocketServer::SetCertificate>(connection.id(), move(certificate), move(key))->success();
|
||||
}
|
||||
|
||||
void WebSocketClient::handle(const Messages::WebSocketClient::Connected& message)
|
||||
void WebSocketClient::connected(i32 connection_id)
|
||||
{
|
||||
auto maybe_connection = m_connections.get(message.connection_id());
|
||||
auto maybe_connection = m_connections.get(connection_id);
|
||||
if (maybe_connection.has_value())
|
||||
maybe_connection.value()->did_open({});
|
||||
}
|
||||
|
||||
void WebSocketClient::handle(const Messages::WebSocketClient::Received& message)
|
||||
void WebSocketClient::received(i32 connection_id, bool is_text, ByteBuffer const& data)
|
||||
{
|
||||
auto maybe_connection = m_connections.get(message.connection_id());
|
||||
auto maybe_connection = m_connections.get(connection_id);
|
||||
if (maybe_connection.has_value())
|
||||
maybe_connection.value()->did_receive({}, message.data(), message.is_text());
|
||||
maybe_connection.value()->did_receive({}, data, is_text);
|
||||
}
|
||||
|
||||
void WebSocketClient::handle(const Messages::WebSocketClient::Errored& message)
|
||||
void WebSocketClient::errored(i32 connection_id, i32 message)
|
||||
{
|
||||
auto maybe_connection = m_connections.get(message.connection_id());
|
||||
auto maybe_connection = m_connections.get(connection_id);
|
||||
if (maybe_connection.has_value())
|
||||
maybe_connection.value()->did_error({}, message.message());
|
||||
maybe_connection.value()->did_error({}, message);
|
||||
}
|
||||
|
||||
void WebSocketClient::handle(const Messages::WebSocketClient::Closed& message)
|
||||
void WebSocketClient::closed(i32 connection_id, u16 code, String const& reason, bool clean)
|
||||
{
|
||||
auto maybe_connection = m_connections.get(message.connection_id());
|
||||
auto maybe_connection = m_connections.get(connection_id);
|
||||
if (maybe_connection.has_value())
|
||||
maybe_connection.value()->did_close({}, message.code(), message.reason(), message.clean());
|
||||
maybe_connection.value()->did_close({}, code, reason, clean);
|
||||
}
|
||||
|
||||
void WebSocketClient::handle(const Messages::WebSocketClient::CertificateRequested& message)
|
||||
void WebSocketClient::certificate_requested(i32 connection_id)
|
||||
{
|
||||
auto maybe_connection = m_connections.get(message.connection_id());
|
||||
auto maybe_connection = m_connections.get(connection_id);
|
||||
if (maybe_connection.has_value())
|
||||
maybe_connection.value()->did_request_certificates({});
|
||||
}
|
||||
|
|
|
@ -33,11 +33,11 @@ public:
|
|||
private:
|
||||
WebSocketClient();
|
||||
|
||||
virtual void handle(const Messages::WebSocketClient::Connected&) override;
|
||||
virtual void handle(const Messages::WebSocketClient::Received&) override;
|
||||
virtual void handle(const Messages::WebSocketClient::Errored&) override;
|
||||
virtual void handle(const Messages::WebSocketClient::Closed&) override;
|
||||
virtual void handle(const Messages::WebSocketClient::CertificateRequested&) override;
|
||||
virtual void connected(i32) override;
|
||||
virtual void received(i32, bool, ByteBuffer const&) override;
|
||||
virtual void errored(i32, i32) override;
|
||||
virtual void closed(i32, u16, String const&, bool) override;
|
||||
virtual void certificate_requested(i32) override;
|
||||
|
||||
HashMap<i32, NonnullRefPtr<WebSocket>> m_connections;
|
||||
};
|
||||
|
|
|
@ -23,7 +23,7 @@ void Client::handshake()
|
|||
send_sync<Messages::SymbolServer::Greet>();
|
||||
}
|
||||
|
||||
void Client::handle(const Messages::SymbolClient::Dummy&)
|
||||
void Client::dummy()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
private:
|
||||
Client();
|
||||
|
||||
virtual void handle(const Messages::SymbolClient::Dummy&) override;
|
||||
virtual void dummy() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -29,156 +29,156 @@ void WebContentClient::handshake()
|
|||
send_sync<Messages::WebContentServer::Greet>();
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidPaint& message)
|
||||
void WebContentClient::did_paint(const Gfx::IntRect&, i32 bitmap_id)
|
||||
{
|
||||
m_view.notify_server_did_paint({}, message.bitmap_id());
|
||||
m_view.notify_server_did_paint({}, bitmap_id);
|
||||
}
|
||||
|
||||
void WebContentClient::handle([[maybe_unused]] const Messages::WebContentClient::DidFinishLoading& message)
|
||||
void WebContentClient::did_finish_loading(URL const& url)
|
||||
{
|
||||
m_view.notify_server_did_finish_loading({}, message.url());
|
||||
m_view.notify_server_did_finish_loading({}, url);
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidInvalidateContentRect& message)
|
||||
void WebContentClient::did_invalidate_content_rect(Gfx::IntRect const& content_rect)
|
||||
{
|
||||
dbgln_if(SPAM_DEBUG, "handle: WebContentClient::DidInvalidateContentRect! content_rect={}", message.content_rect());
|
||||
dbgln_if(SPAM_DEBUG, "handle: WebContentClient::DidInvalidateContentRect! content_rect={}", content_rect);
|
||||
|
||||
// FIXME: Figure out a way to coalesce these messages to reduce unnecessary painting
|
||||
m_view.notify_server_did_invalidate_content_rect({}, message.content_rect());
|
||||
m_view.notify_server_did_invalidate_content_rect({}, content_rect);
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidChangeSelection&)
|
||||
void WebContentClient::did_change_selection()
|
||||
{
|
||||
dbgln_if(SPAM_DEBUG, "handle: WebContentClient::DidChangeSelection!");
|
||||
m_view.notify_server_did_change_selection({});
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidRequestCursorChange& message)
|
||||
void WebContentClient::did_request_cursor_change(i32 cursor_type)
|
||||
{
|
||||
if (message.cursor_type() < 0 || message.cursor_type() >= (i32)Gfx::StandardCursor::__Count) {
|
||||
if (cursor_type < 0 || cursor_type >= (i32)Gfx::StandardCursor::__Count) {
|
||||
dbgln("DidRequestCursorChange: Bad cursor type");
|
||||
return;
|
||||
}
|
||||
m_view.notify_server_did_request_cursor_change({}, (Gfx::StandardCursor)message.cursor_type());
|
||||
m_view.notify_server_did_request_cursor_change({}, (Gfx::StandardCursor)cursor_type);
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidLayout& message)
|
||||
void WebContentClient::did_layout(Gfx::IntSize const& content_size)
|
||||
{
|
||||
dbgln_if(SPAM_DEBUG, "handle: WebContentClient::DidLayout! content_size={}", message.content_size());
|
||||
m_view.notify_server_did_layout({}, message.content_size());
|
||||
dbgln_if(SPAM_DEBUG, "handle: WebContentClient::DidLayout! content_size={}", content_size);
|
||||
m_view.notify_server_did_layout({}, content_size);
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidChangeTitle& message)
|
||||
void WebContentClient::did_change_title(String const& title)
|
||||
{
|
||||
dbgln_if(SPAM_DEBUG, "handle: WebContentClient::DidChangeTitle! title={}", message.title());
|
||||
m_view.notify_server_did_change_title({}, message.title());
|
||||
dbgln_if(SPAM_DEBUG, "handle: WebContentClient::DidChangeTitle! title={}", title);
|
||||
m_view.notify_server_did_change_title({}, title);
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidRequestScroll& message)
|
||||
void WebContentClient::did_request_scroll(int wheel_delta)
|
||||
{
|
||||
m_view.notify_server_did_request_scroll({}, message.wheel_delta());
|
||||
m_view.notify_server_did_request_scroll({}, wheel_delta);
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidRequestScrollIntoView& message)
|
||||
void WebContentClient::did_request_scroll_into_view(Gfx::IntRect const& rect)
|
||||
{
|
||||
dbgln_if(SPAM_DEBUG, "handle: WebContentClient::DidRequestScrollIntoView! rect={}", message.rect());
|
||||
m_view.notify_server_did_request_scroll_into_view({}, message.rect());
|
||||
dbgln_if(SPAM_DEBUG, "handle: WebContentClient::DidRequestScrollIntoView! rect={}", rect);
|
||||
m_view.notify_server_did_request_scroll_into_view({}, rect);
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidEnterTooltipArea& message)
|
||||
void WebContentClient::did_enter_tooltip_area(Gfx::IntPoint const& content_position, String const& title)
|
||||
{
|
||||
m_view.notify_server_did_enter_tooltip_area({}, message.content_position(), message.title());
|
||||
m_view.notify_server_did_enter_tooltip_area({}, content_position, title);
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidLeaveTooltipArea&)
|
||||
void WebContentClient::did_leave_tooltip_area()
|
||||
{
|
||||
m_view.notify_server_did_leave_tooltip_area({});
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidHoverLink& message)
|
||||
void WebContentClient::did_hover_link(URL const& url)
|
||||
{
|
||||
dbgln_if(SPAM_DEBUG, "handle: WebContentClient::DidHoverLink! url={}", message.url());
|
||||
m_view.notify_server_did_hover_link({}, message.url());
|
||||
dbgln_if(SPAM_DEBUG, "handle: WebContentClient::DidHoverLink! url={}", url);
|
||||
m_view.notify_server_did_hover_link({}, url);
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidUnhoverLink&)
|
||||
void WebContentClient::did_unhover_link()
|
||||
{
|
||||
dbgln_if(SPAM_DEBUG, "handle: WebContentClient::DidUnhoverLink!");
|
||||
m_view.notify_server_did_unhover_link({});
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidClickLink& message)
|
||||
void WebContentClient::did_click_link(URL const& url, String const& target, unsigned modifiers)
|
||||
{
|
||||
m_view.notify_server_did_click_link({}, message.url(), message.target(), message.modifiers());
|
||||
m_view.notify_server_did_click_link({}, url, target, modifiers);
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidMiddleClickLink& message)
|
||||
void WebContentClient::did_middle_click_link(URL const& url, String const& target, unsigned modifiers)
|
||||
{
|
||||
m_view.notify_server_did_middle_click_link({}, message.url(), message.target(), message.modifiers());
|
||||
m_view.notify_server_did_middle_click_link({}, url, target, modifiers);
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidStartLoading& message)
|
||||
void WebContentClient::did_start_loading(URL const& url)
|
||||
{
|
||||
m_view.notify_server_did_start_loading({}, message.url());
|
||||
m_view.notify_server_did_start_loading({}, url);
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidRequestContextMenu& message)
|
||||
void WebContentClient::did_request_context_menu(Gfx::IntPoint const& content_position)
|
||||
{
|
||||
m_view.notify_server_did_request_context_menu({}, message.content_position());
|
||||
m_view.notify_server_did_request_context_menu({}, content_position);
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidRequestLinkContextMenu& message)
|
||||
void WebContentClient::did_request_link_context_menu(Gfx::IntPoint const& content_position, URL const& url, String const& target, unsigned modifiers)
|
||||
{
|
||||
m_view.notify_server_did_request_link_context_menu({}, message.content_position(), message.url(), message.target(), message.modifiers());
|
||||
m_view.notify_server_did_request_link_context_menu({}, content_position, url, target, modifiers);
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidRequestImageContextMenu& message)
|
||||
void WebContentClient::did_request_image_context_menu(Gfx::IntPoint const& content_position, URL const& url, String const& target, unsigned modifiers, Gfx::ShareableBitmap const& bitmap)
|
||||
{
|
||||
m_view.notify_server_did_request_image_context_menu({}, message.content_position(), message.url(), message.target(), message.modifiers(), message.bitmap());
|
||||
m_view.notify_server_did_request_image_context_menu({}, content_position, url, target, modifiers, bitmap);
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidGetSource& message)
|
||||
void WebContentClient::did_get_source(URL const& url, String const& source)
|
||||
{
|
||||
m_view.notify_server_did_get_source(message.url(), message.source());
|
||||
m_view.notify_server_did_get_source(url, source);
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidJSConsoleOutput& message)
|
||||
void WebContentClient::did_jsconsole_output(String const& method, String const& line)
|
||||
{
|
||||
m_view.notify_server_did_js_console_output(message.method(), message.line());
|
||||
m_view.notify_server_did_js_console_output(method, line);
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidRequestAlert& message)
|
||||
void WebContentClient::did_request_alert(String const& message)
|
||||
{
|
||||
m_view.notify_server_did_request_alert({}, message.message());
|
||||
m_view.notify_server_did_request_alert({}, message);
|
||||
}
|
||||
|
||||
Messages::WebContentClient::DidRequestConfirmResponse WebContentClient::handle(const Messages::WebContentClient::DidRequestConfirm& message)
|
||||
Messages::WebContentClient::DidRequestConfirmResponse WebContentClient::did_request_confirm(String const& message)
|
||||
{
|
||||
return m_view.notify_server_did_request_confirm({}, message.message());
|
||||
return m_view.notify_server_did_request_confirm({}, message);
|
||||
}
|
||||
|
||||
Messages::WebContentClient::DidRequestPromptResponse WebContentClient::handle(const Messages::WebContentClient::DidRequestPrompt& message)
|
||||
Messages::WebContentClient::DidRequestPromptResponse WebContentClient::did_request_prompt(String const& message, String const& default_)
|
||||
{
|
||||
return m_view.notify_server_did_request_prompt({}, message.message(), message.default_());
|
||||
return m_view.notify_server_did_request_prompt({}, message, default_);
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidChangeFavicon& message)
|
||||
void WebContentClient::did_change_favicon(Gfx::ShareableBitmap const& favicon)
|
||||
{
|
||||
if (!message.favicon().is_valid()) {
|
||||
if (!favicon.is_valid()) {
|
||||
dbgln("DidChangeFavicon: Received invalid favicon");
|
||||
return;
|
||||
}
|
||||
m_view.notify_server_did_change_favicon(*message.favicon().bitmap());
|
||||
m_view.notify_server_did_change_favicon(*favicon.bitmap());
|
||||
}
|
||||
|
||||
Messages::WebContentClient::DidRequestCookieResponse WebContentClient::handle(const Messages::WebContentClient::DidRequestCookie& message)
|
||||
Messages::WebContentClient::DidRequestCookieResponse WebContentClient::did_request_cookie(URL const& url, u8 source)
|
||||
{
|
||||
return m_view.notify_server_did_request_cookie({}, message.url(), static_cast<Cookie::Source>(message.source()));
|
||||
return m_view.notify_server_did_request_cookie({}, url, static_cast<Cookie::Source>(source));
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidSetCookie& message)
|
||||
void WebContentClient::did_set_cookie(URL const& url, Web::Cookie::ParsedCookie const& cookie, u8 source)
|
||||
{
|
||||
m_view.notify_server_did_set_cookie({}, message.url(), message.cookie(), static_cast<Cookie::Source>(message.source()));
|
||||
m_view.notify_server_did_set_cookie({}, url, cookie, static_cast<Cookie::Source>(source));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -31,33 +31,33 @@ private:
|
|||
|
||||
virtual void die() override;
|
||||
|
||||
virtual void handle(const Messages::WebContentClient::DidPaint&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidFinishLoading&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidInvalidateContentRect&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidChangeSelection&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidRequestCursorChange&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidLayout&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidChangeTitle&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidRequestScroll&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidRequestScrollIntoView&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidEnterTooltipArea&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidLeaveTooltipArea&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidHoverLink&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidUnhoverLink&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidClickLink&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidMiddleClickLink&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidStartLoading&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidRequestContextMenu&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidRequestLinkContextMenu&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidRequestImageContextMenu&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidGetSource&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidJSConsoleOutput&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidChangeFavicon&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidRequestAlert&) override;
|
||||
virtual Messages::WebContentClient::DidRequestConfirmResponse handle(const Messages::WebContentClient::DidRequestConfirm&) override;
|
||||
virtual Messages::WebContentClient::DidRequestPromptResponse handle(const Messages::WebContentClient::DidRequestPrompt&) override;
|
||||
virtual Messages::WebContentClient::DidRequestCookieResponse handle(const Messages::WebContentClient::DidRequestCookie&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidSetCookie&) override;
|
||||
virtual void did_paint(Gfx::IntRect const&, i32) override;
|
||||
virtual void did_finish_loading(URL const&) override;
|
||||
virtual void did_invalidate_content_rect(Gfx::IntRect const&) override;
|
||||
virtual void did_change_selection() override;
|
||||
virtual void did_request_cursor_change(i32) override;
|
||||
virtual void did_layout(Gfx::IntSize const&) override;
|
||||
virtual void did_change_title(String const&) override;
|
||||
virtual void did_request_scroll(int) override;
|
||||
virtual void did_request_scroll_into_view(Gfx::IntRect const&) override;
|
||||
virtual void did_enter_tooltip_area(Gfx::IntPoint const&, String const&) override;
|
||||
virtual void did_leave_tooltip_area() override;
|
||||
virtual void did_hover_link(URL const&) override;
|
||||
virtual void did_unhover_link() override;
|
||||
virtual void did_click_link(URL const&, String const&, unsigned) override;
|
||||
virtual void did_middle_click_link(URL const&, String const&, unsigned) override;
|
||||
virtual void did_start_loading(URL const&) override;
|
||||
virtual void did_request_context_menu(Gfx::IntPoint const&) override;
|
||||
virtual void did_request_link_context_menu(Gfx::IntPoint const&, URL const&, String const&, unsigned) override;
|
||||
virtual void did_request_image_context_menu(Gfx::IntPoint const&, URL const&, String const&, unsigned, Gfx::ShareableBitmap const&) override;
|
||||
virtual void did_get_source(URL const&, String const&) override;
|
||||
virtual void did_jsconsole_output(String const&, String const&) override;
|
||||
virtual void did_change_favicon(Gfx::ShareableBitmap const&) override;
|
||||
virtual void did_request_alert(String const&) override;
|
||||
virtual Messages::WebContentClient::DidRequestConfirmResponse did_request_confirm(String const&) override;
|
||||
virtual Messages::WebContentClient::DidRequestPromptResponse did_request_prompt(String const&, String const&) override;
|
||||
virtual Messages::WebContentClient::DidRequestCookieResponse did_request_cookie(URL const&, u8) override;
|
||||
virtual void did_set_cookie(URL const&, Web::Cookie::ParsedCookie const&, u8) override;
|
||||
|
||||
OutOfProcessWebView& m_view;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue