1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 00:37:35 +00:00

Meta+Userland: Pass Gfx::IntPoint by value

This is just two ints or 8 bytes or the size of the reference on
x86_64 or AArch64.
This commit is contained in:
MacDue 2022-12-06 20:27:44 +00:00 committed by Andreas Kling
parent bbc149ebb9
commit 7be0b27dd3
161 changed files with 442 additions and 441 deletions

View file

@ -102,7 +102,7 @@ static Gfx::StandardCursor cursor_css_to_gfx(Optional<CSS::Cursor> cursor)
}
}
static Gfx::IntPoint compute_mouse_event_offset(Gfx::IntPoint const& position, Layout::Node const& layout_node)
static Gfx::IntPoint compute_mouse_event_offset(Gfx::IntPoint position, Layout::Node const& layout_node)
{
auto top_left_of_layout_node = layout_node.box_type_agnostic_position();
return {
@ -147,7 +147,7 @@ Painting::PaintableBox const* EventHandler::paint_root() const
return const_cast<Painting::PaintableBox*>(m_browsing_context.active_document()->paint_box());
}
bool EventHandler::handle_mousewheel(Gfx::IntPoint const& position, unsigned button, unsigned buttons, unsigned int modifiers, int wheel_delta_x, int wheel_delta_y)
bool EventHandler::handle_mousewheel(Gfx::IntPoint position, unsigned button, unsigned buttons, unsigned int modifiers, int wheel_delta_x, int wheel_delta_y)
{
if (m_browsing_context.active_document())
m_browsing_context.active_document()->update_layout();
@ -198,7 +198,7 @@ bool EventHandler::handle_mousewheel(Gfx::IntPoint const& position, unsigned but
return handled_event;
}
bool EventHandler::handle_mouseup(Gfx::IntPoint const& position, unsigned button, unsigned buttons, unsigned modifiers)
bool EventHandler::handle_mouseup(Gfx::IntPoint position, unsigned button, unsigned buttons, unsigned modifiers)
{
if (m_browsing_context.active_document())
m_browsing_context.active_document()->update_layout();
@ -313,7 +313,7 @@ after_node_use:
return handled_event;
}
bool EventHandler::handle_mousedown(Gfx::IntPoint const& position, unsigned button, unsigned buttons, unsigned modifiers)
bool EventHandler::handle_mousedown(Gfx::IntPoint position, unsigned button, unsigned buttons, unsigned modifiers)
{
if (m_browsing_context.active_document())
m_browsing_context.active_document()->update_layout();
@ -404,7 +404,7 @@ bool EventHandler::handle_mousedown(Gfx::IntPoint const& position, unsigned butt
return true;
}
bool EventHandler::handle_mousemove(Gfx::IntPoint const& position, unsigned buttons, unsigned modifiers)
bool EventHandler::handle_mousemove(Gfx::IntPoint position, unsigned buttons, unsigned modifiers)
{
if (m_browsing_context.active_document())
m_browsing_context.active_document()->update_layout();
@ -516,7 +516,7 @@ bool EventHandler::handle_mousemove(Gfx::IntPoint const& position, unsigned butt
return true;
}
bool EventHandler::handle_doubleclick(Gfx::IntPoint const& position, unsigned button, unsigned buttons, unsigned modifiers)
bool EventHandler::handle_doubleclick(Gfx::IntPoint position, unsigned button, unsigned buttons, unsigned modifiers)
{
if (m_browsing_context.active_document())
m_browsing_context.active_document()->update_layout();

View file

@ -22,11 +22,11 @@ public:
explicit EventHandler(Badge<HTML::BrowsingContext>, HTML::BrowsingContext&);
~EventHandler();
bool handle_mouseup(Gfx::IntPoint const&, unsigned button, unsigned buttons, unsigned modifiers);
bool handle_mousedown(Gfx::IntPoint const&, unsigned button, unsigned buttons, unsigned modifiers);
bool handle_mousemove(Gfx::IntPoint const&, unsigned buttons, unsigned modifiers);
bool handle_mousewheel(Gfx::IntPoint const&, unsigned button, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y);
bool handle_doubleclick(Gfx::IntPoint const&, unsigned button, unsigned buttons, unsigned modifiers);
bool handle_mouseup(Gfx::IntPoint, unsigned button, unsigned buttons, unsigned modifiers);
bool handle_mousedown(Gfx::IntPoint, unsigned button, unsigned buttons, unsigned modifiers);
bool handle_mousemove(Gfx::IntPoint, unsigned buttons, unsigned modifiers);
bool handle_mousewheel(Gfx::IntPoint, unsigned button, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y);
bool handle_doubleclick(Gfx::IntPoint, unsigned button, unsigned buttons, unsigned modifiers);
bool handle_keydown(KeyCode, unsigned modifiers, u32 code_point);
bool handle_keyup(KeyCode, unsigned modifiers, u32 code_point);

View file

@ -64,27 +64,27 @@ CSS::PreferredColorScheme Page::preferred_color_scheme() const
return m_client.preferred_color_scheme();
}
bool Page::handle_mousewheel(Gfx::IntPoint const& position, unsigned button, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y)
bool Page::handle_mousewheel(Gfx::IntPoint position, unsigned button, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y)
{
return top_level_browsing_context().event_handler().handle_mousewheel(position, button, buttons, modifiers, wheel_delta_x, wheel_delta_y);
}
bool Page::handle_mouseup(Gfx::IntPoint const& position, unsigned button, unsigned buttons, unsigned modifiers)
bool Page::handle_mouseup(Gfx::IntPoint position, unsigned button, unsigned buttons, unsigned modifiers)
{
return top_level_browsing_context().event_handler().handle_mouseup(position, button, buttons, modifiers);
}
bool Page::handle_mousedown(Gfx::IntPoint const& position, unsigned button, unsigned buttons, unsigned modifiers)
bool Page::handle_mousedown(Gfx::IntPoint position, unsigned button, unsigned buttons, unsigned modifiers)
{
return top_level_browsing_context().event_handler().handle_mousedown(position, button, buttons, modifiers);
}
bool Page::handle_mousemove(Gfx::IntPoint const& position, unsigned buttons, unsigned modifiers)
bool Page::handle_mousemove(Gfx::IntPoint position, unsigned buttons, unsigned modifiers)
{
return top_level_browsing_context().event_handler().handle_mousemove(position, buttons, modifiers);
}
bool Page::handle_doubleclick(Gfx::IntPoint const& position, unsigned button, unsigned buttons, unsigned modifiers)
bool Page::handle_doubleclick(Gfx::IntPoint position, unsigned button, unsigned buttons, unsigned modifiers)
{
return top_level_browsing_context().event_handler().handle_doubleclick(position, button, buttons, modifiers);
}

View file

@ -54,11 +54,11 @@ public:
void load_html(StringView, const AK::URL&);
bool handle_mouseup(Gfx::IntPoint const&, unsigned button, unsigned buttons, unsigned modifiers);
bool handle_mousedown(Gfx::IntPoint const&, unsigned button, unsigned buttons, unsigned modifiers);
bool handle_mousemove(Gfx::IntPoint const&, unsigned buttons, unsigned modifiers);
bool handle_mousewheel(Gfx::IntPoint const&, unsigned button, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y);
bool handle_doubleclick(Gfx::IntPoint const&, unsigned button, unsigned buttons, unsigned modifiers);
bool handle_mouseup(Gfx::IntPoint, unsigned button, unsigned buttons, unsigned modifiers);
bool handle_mousedown(Gfx::IntPoint, unsigned button, unsigned buttons, unsigned modifiers);
bool handle_mousemove(Gfx::IntPoint, unsigned buttons, unsigned modifiers);
bool handle_mousewheel(Gfx::IntPoint, unsigned button, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y);
bool handle_doubleclick(Gfx::IntPoint, unsigned button, unsigned buttons, unsigned modifiers);
bool handle_keydown(KeyCode, unsigned modifiers, u32 code_point);
bool handle_keyup(KeyCode, unsigned modifiers, u32 code_point);
@ -79,8 +79,8 @@ public:
bool is_webdriver_active() const { return m_is_webdriver_active; }
void set_is_webdriver_active(bool b) { m_is_webdriver_active = b; }
Gfx::IntPoint const& window_position() const { return m_window_position; }
void set_window_position(Gfx::IntPoint const& position) { m_window_position = position; }
Gfx::IntPoint window_position() const { return m_window_position; }
void set_window_position(Gfx::IntPoint position) { m_window_position = position; }
Gfx::IntSize const& window_size() const { return m_window_size; }
void set_window_size(Gfx::IntSize const& size) { m_window_size = size; }
@ -147,7 +147,7 @@ public:
virtual void page_did_request_navigate_forward() { }
virtual void page_did_request_refresh() { }
virtual Gfx::IntSize page_did_request_resize_window(Gfx::IntSize const&) { return {}; }
virtual Gfx::IntPoint page_did_request_reposition_window(Gfx::IntPoint const&) { return {}; }
virtual Gfx::IntPoint page_did_request_reposition_window(Gfx::IntPoint) { return {}; }
virtual void page_did_request_restore_window() { }
virtual Gfx::IntRect page_did_request_maximize_window() { return {}; }
virtual Gfx::IntRect page_did_request_minimize_window() { return {}; }
@ -157,12 +157,12 @@ public:
virtual void page_did_finish_loading(const AK::URL&) { }
virtual void page_did_change_selection() { }
virtual void page_did_request_cursor_change(Gfx::StandardCursor) { }
virtual void page_did_request_context_menu(Gfx::IntPoint const&) { }
virtual void page_did_request_link_context_menu(Gfx::IntPoint const&, const AK::URL&, [[maybe_unused]] DeprecatedString const& target, [[maybe_unused]] unsigned modifiers) { }
virtual void page_did_request_image_context_menu(Gfx::IntPoint const&, const AK::URL&, [[maybe_unused]] DeprecatedString const& target, [[maybe_unused]] unsigned modifiers, Gfx::Bitmap const*) { }
virtual void page_did_request_context_menu(Gfx::IntPoint) { }
virtual void page_did_request_link_context_menu(Gfx::IntPoint, const AK::URL&, [[maybe_unused]] DeprecatedString const& target, [[maybe_unused]] unsigned modifiers) { }
virtual void page_did_request_image_context_menu(Gfx::IntPoint, const AK::URL&, [[maybe_unused]] DeprecatedString const& target, [[maybe_unused]] unsigned modifiers, Gfx::Bitmap const*) { }
virtual void page_did_click_link(const AK::URL&, [[maybe_unused]] DeprecatedString const& target, [[maybe_unused]] unsigned modifiers) { }
virtual void page_did_middle_click_link(const AK::URL&, [[maybe_unused]] DeprecatedString const& target, [[maybe_unused]] unsigned modifiers) { }
virtual void page_did_enter_tooltip_area(Gfx::IntPoint const&, DeprecatedString const&) { }
virtual void page_did_enter_tooltip_area(Gfx::IntPoint, DeprecatedString const&) { }
virtual void page_did_leave_tooltip_area() { }
virtual void page_did_hover_link(const AK::URL&) { }
virtual void page_did_unhover_link() { }
@ -170,7 +170,7 @@ public:
virtual void page_did_change_favicon(Gfx::Bitmap const&) { }
virtual void page_did_layout() { }
virtual void page_did_request_scroll(i32, i32) { }
virtual void page_did_request_scroll_to(Gfx::IntPoint const&) { }
virtual void page_did_request_scroll_to(Gfx::IntPoint) { }
virtual void page_did_request_scroll_into_view(Gfx::IntRect const&) { }
virtual void page_did_request_alert(DeprecatedString const&) { }
virtual void page_did_request_confirm(DeprecatedString const&) { }