1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:17: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

@ -313,13 +313,13 @@ private:
class MoveEvent final : public Event {
public:
explicit MoveEvent(Gfx::IntPoint const& size)
explicit MoveEvent(Gfx::IntPoint size)
: Event(Event::Move)
, m_position(size)
{
}
Gfx::IntPoint const& position() const { return m_position; }
Gfx::IntPoint position() const { return m_position; }
private:
Gfx::IntPoint m_position;
@ -327,15 +327,15 @@ private:
class ContextMenuEvent final : public Event {
public:
explicit ContextMenuEvent(Gfx::IntPoint const& position, Gfx::IntPoint const& screen_position)
explicit ContextMenuEvent(Gfx::IntPoint position, Gfx::IntPoint screen_position)
: Event(Event::ContextMenu)
, m_position(position)
, m_screen_position(screen_position)
{
}
Gfx::IntPoint const& position() const { return m_position; }
Gfx::IntPoint const& screen_position() const { return m_screen_position; }
Gfx::IntPoint position() const { return m_position; }
Gfx::IntPoint screen_position() const { return m_screen_position; }
private:
Gfx::IntPoint m_position;
@ -419,7 +419,7 @@ private:
class MouseEvent final : public Event {
public:
MouseEvent(Type type, Gfx::IntPoint const& position, unsigned buttons, MouseButton button, unsigned modifiers, int wheel_delta_x, int wheel_delta_y, int wheel_raw_delta_x, int wheel_raw_delta_y)
MouseEvent(Type type, Gfx::IntPoint position, unsigned buttons, MouseButton button, unsigned modifiers, int wheel_delta_x, int wheel_delta_y, int wheel_raw_delta_x, int wheel_raw_delta_y)
: Event(type)
, m_position(position)
, m_buttons(buttons)
@ -432,7 +432,7 @@ public:
{
}
Gfx::IntPoint const& position() const { return m_position; }
Gfx::IntPoint position() const { return m_position; }
int x() const { return m_position.x(); }
int y() const { return m_position.y(); }
MouseButton button() const { return m_button; }
@ -460,14 +460,14 @@ private:
class DragEvent final : public Event {
public:
DragEvent(Type type, Gfx::IntPoint const& position, Vector<DeprecatedString> mime_types)
DragEvent(Type type, Gfx::IntPoint position, Vector<DeprecatedString> mime_types)
: Event(type)
, m_position(position)
, m_mime_types(move(mime_types))
{
}
Gfx::IntPoint const& position() const { return m_position; }
Gfx::IntPoint position() const { return m_position; }
Vector<DeprecatedString> const& mime_types() const { return m_mime_types; }
private:
@ -477,11 +477,11 @@ private:
class DropEvent final : public Event {
public:
DropEvent(Gfx::IntPoint const&, DeprecatedString const& text, NonnullRefPtr<Core::MimeData> mime_data);
DropEvent(Gfx::IntPoint, DeprecatedString const& text, NonnullRefPtr<Core::MimeData> mime_data);
~DropEvent() = default;
Gfx::IntPoint const& position() const { return m_position; }
Gfx::IntPoint position() const { return m_position; }
DeprecatedString const& text() const { return m_text; }
Core::MimeData const& mime_data() const { return m_mime_data; }