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

@ -318,7 +318,7 @@ void AbstractScrollableWidget::set_automatic_scrolling_timer(bool active)
}
}
Gfx::IntPoint AbstractScrollableWidget::automatic_scroll_delta_from_position(Gfx::IntPoint const& pos) const
Gfx::IntPoint AbstractScrollableWidget::automatic_scroll_delta_from_position(Gfx::IntPoint pos) const
{
Gfx::IntPoint delta { 0, 0 };
@ -344,7 +344,7 @@ Gfx::IntRect AbstractScrollableWidget::widget_inner_rect() const
return rect;
}
Gfx::IntPoint AbstractScrollableWidget::to_content_position(Gfx::IntPoint const& widget_position) const
Gfx::IntPoint AbstractScrollableWidget::to_content_position(Gfx::IntPoint widget_position) const
{
auto content_position = widget_position;
content_position.translate_by(horizontal_scrollbar().value(), vertical_scrollbar().value());
@ -352,7 +352,7 @@ Gfx::IntPoint AbstractScrollableWidget::to_content_position(Gfx::IntPoint const&
return content_position;
}
Gfx::IntPoint AbstractScrollableWidget::to_widget_position(Gfx::IntPoint const& content_position) const
Gfx::IntPoint AbstractScrollableWidget::to_widget_position(Gfx::IntPoint content_position) const
{
auto widget_position = content_position;
widget_position.translate_by(-horizontal_scrollbar().value(), -vertical_scrollbar().value());

View file

@ -59,7 +59,7 @@ public:
void update_scrollbar_ranges();
void set_automatic_scrolling_timer(bool active);
virtual Gfx::IntPoint automatic_scroll_delta_from_position(Gfx::IntPoint const&) const;
virtual Gfx::IntPoint automatic_scroll_delta_from_position(Gfx::IntPoint) const;
int width_occupied_by_vertical_scrollbar() const;
int height_occupied_by_horizontal_scrollbar() const;
@ -70,8 +70,8 @@ public:
void set_should_hide_unnecessary_scrollbars(bool);
bool should_hide_unnecessary_scrollbars() const { return m_should_hide_unnecessary_scrollbars; }
Gfx::IntPoint to_content_position(Gfx::IntPoint const& widget_position) const;
Gfx::IntPoint to_widget_position(Gfx::IntPoint const& content_position) const;
Gfx::IntPoint to_content_position(Gfx::IntPoint widget_position) const;
Gfx::IntPoint to_widget_position(Gfx::IntPoint content_position) const;
Gfx::IntRect to_content_rect(Gfx::IntRect const& widget_rect) const { return { to_content_position(widget_rect.location()), widget_rect.size() }; }
Gfx::IntRect to_widget_rect(Gfx::IntRect const& content_rect) const { return { to_widget_position(content_rect.location()), content_rect.size() }; }

View file

@ -222,7 +222,7 @@ void AbstractTableView::mousedown_event(MouseEvent& event)
AbstractView::mousedown_event(event);
}
ModelIndex AbstractTableView::index_at_event_position(Gfx::IntPoint const& position, bool& is_toggle) const
ModelIndex AbstractTableView::index_at_event_position(Gfx::IntPoint position, bool& is_toggle) const
{
is_toggle = false;
if (!model())
@ -242,7 +242,7 @@ ModelIndex AbstractTableView::index_at_event_position(Gfx::IntPoint const& posit
return {};
}
ModelIndex AbstractTableView::index_at_event_position(Gfx::IntPoint const& position) const
ModelIndex AbstractTableView::index_at_event_position(Gfx::IntPoint position) const
{
bool is_toggle;
auto index = index_at_event_position(position, is_toggle);
@ -343,7 +343,7 @@ Gfx::IntRect AbstractTableView::row_rect(int item_index) const
row_height() };
}
Gfx::IntPoint AbstractTableView::adjusted_position(Gfx::IntPoint const& position) const
Gfx::IntPoint AbstractTableView::adjusted_position(Gfx::IntPoint position) const
{
return position.translated(horizontal_scrollbar().value() - frame_thickness(), vertical_scrollbar().value() - frame_thickness());
}
@ -477,7 +477,7 @@ bool AbstractTableView::is_navigation(GUI::KeyEvent& event)
}
}
Gfx::IntPoint AbstractTableView::automatic_scroll_delta_from_position(Gfx::IntPoint const& pos) const
Gfx::IntPoint AbstractTableView::automatic_scroll_delta_from_position(Gfx::IntPoint pos) const
{
if (pos.y() > column_header().height() + autoscroll_threshold())
return AbstractScrollableWidget::automatic_scroll_delta_from_position(pos);

View file

@ -52,7 +52,7 @@ public:
void set_column_painting_delegate(int column, OwnPtr<TableCellPaintingDelegate>);
Gfx::IntPoint adjusted_position(Gfx::IntPoint const&) const;
Gfx::IntPoint adjusted_position(Gfx::IntPoint) const;
virtual Gfx::IntRect content_rect(ModelIndex const&) const override;
Gfx::IntRect content_rect_minus_scrollbars(ModelIndex const&) const;
@ -67,8 +67,8 @@ public:
scroll_into_view(index, orientation == Gfx::Orientation::Horizontal, orientation == Gfx::Orientation::Vertical);
}
virtual ModelIndex index_at_event_position(Gfx::IntPoint const&, bool& is_toggle) const;
virtual ModelIndex index_at_event_position(Gfx::IntPoint const&) const override;
virtual ModelIndex index_at_event_position(Gfx::IntPoint, bool& is_toggle) const;
virtual ModelIndex index_at_event_position(Gfx::IntPoint) const override;
virtual void select_all() override;
@ -106,7 +106,7 @@ protected:
void move_cursor_relative(int vertical_steps, int horizontal_steps, SelectionUpdate);
virtual Gfx::IntPoint automatic_scroll_delta_from_position(Gfx::IntPoint const& pos) const override;
virtual Gfx::IntPoint automatic_scroll_delta_from_position(Gfx::IntPoint pos) const override;
private:
void layout_headers();

View file

@ -93,7 +93,7 @@ public:
virtual Gfx::IntRect editing_rect(ModelIndex const& index) const { return content_rect(index); }
virtual Gfx::IntRect paint_invalidation_rect(ModelIndex const& index) const { return content_rect(index); }
virtual ModelIndex index_at_event_position(Gfx::IntPoint const&) const { return {}; }
virtual ModelIndex index_at_event_position(Gfx::IntPoint) const { return {}; }
void begin_editing(ModelIndex const&);
void stop_editing();

View file

@ -34,7 +34,7 @@ void AbstractZoomPanWidget::scale_by(float delta)
set_scale(new_scale);
}
void AbstractZoomPanWidget::scale_centered(float new_scale, Gfx::IntPoint const& center)
void AbstractZoomPanWidget::scale_centered(float new_scale, Gfx::IntPoint center)
{
if (m_original_rect.is_null())
return;
@ -51,7 +51,7 @@ void AbstractZoomPanWidget::scale_centered(float new_scale, Gfx::IntPoint const&
set_scale(new_scale);
}
void AbstractZoomPanWidget::start_panning(Gfx::IntPoint const& position)
void AbstractZoomPanWidget::start_panning(Gfx::IntPoint position)
{
m_saved_cursor = override_cursor();
set_override_cursor(Gfx::StandardCursor::Drag);
@ -66,7 +66,7 @@ void AbstractZoomPanWidget::stop_panning()
set_override_cursor(m_saved_cursor);
}
void AbstractZoomPanWidget::pan_to(Gfx::IntPoint const& position)
void AbstractZoomPanWidget::pan_to(Gfx::IntPoint position)
{
// NOTE: `position` here (and `m_pan_mouse_pos`) are both in frame coordinates, not
// content coordinates, by design. The derived class should not have to keep track of
@ -76,7 +76,7 @@ void AbstractZoomPanWidget::pan_to(Gfx::IntPoint const& position)
relayout();
}
Gfx::FloatPoint AbstractZoomPanWidget::frame_to_content_position(Gfx::IntPoint const& frame_position) const
Gfx::FloatPoint AbstractZoomPanWidget::frame_to_content_position(Gfx::IntPoint frame_position) const
{
return {
(static_cast<float>(frame_position.x()) - m_content_rect.x()) / m_scale,
@ -95,7 +95,7 @@ Gfx::FloatRect AbstractZoomPanWidget::frame_to_content_rect(Gfx::IntRect const&
return content_rect;
}
Gfx::FloatPoint AbstractZoomPanWidget::content_to_frame_position(Gfx::IntPoint const& content_position) const
Gfx::FloatPoint AbstractZoomPanWidget::content_to_frame_position(Gfx::IntPoint content_position) const
{
return {
m_content_rect.x() + content_position.x() * m_scale,

View file

@ -21,21 +21,21 @@ public:
void set_scale_bounds(float min_scale, float max_scale);
void scale_by(float amount);
void scale_centered(float new_scale, Gfx::IntPoint const& center);
void scale_centered(float new_scale, Gfx::IntPoint center);
bool is_panning() const { return m_is_panning; }
void start_panning(Gfx::IntPoint const& position);
void start_panning(Gfx::IntPoint position);
void stop_panning();
void pan_to(Gfx::IntPoint const& position);
void pan_to(Gfx::IntPoint position);
// Should be overridden by derived classes if they want updates.
virtual void handle_relayout(Gfx::IntRect const&) { update(); }
void relayout();
Gfx::FloatPoint frame_to_content_position(Gfx::IntPoint const& frame_position) const;
Gfx::FloatPoint frame_to_content_position(Gfx::IntPoint frame_position) const;
Gfx::FloatRect frame_to_content_rect(Gfx::IntRect const& frame_rect) const;
Gfx::FloatPoint content_to_frame_position(Gfx::IntPoint const& content_position) const;
Gfx::FloatPoint content_to_frame_position(Gfx::IntPoint content_position) const;
Gfx::FloatRect content_to_frame_rect(Gfx::IntRect const& content_rect) const;
virtual void mousewheel_event(GUI::MouseEvent& event) override;

View file

@ -276,7 +276,7 @@ void Application::set_pending_drop_widget(Widget* widget)
m_pending_drop_widget->update();
}
void Application::set_drag_hovered_widget_impl(Widget* widget, Gfx::IntPoint const& position, Vector<DeprecatedString> mime_types)
void Application::set_drag_hovered_widget_impl(Widget* widget, Gfx::IntPoint position, Vector<DeprecatedString> mime_types)
{
if (widget == m_drag_hovered_widget)
return;

View file

@ -75,7 +75,7 @@ public:
Widget* pending_drop_widget() { return m_pending_drop_widget.ptr(); }
Widget const* pending_drop_widget() const { return m_pending_drop_widget.ptr(); }
void set_drag_hovered_widget(Badge<Window>, Widget* widget, Gfx::IntPoint const& position = {}, Vector<DeprecatedString> mime_types = {})
void set_drag_hovered_widget(Badge<Window>, Widget* widget, Gfx::IntPoint position = {}, Vector<DeprecatedString> mime_types = {})
{
set_drag_hovered_widget_impl(widget, position, move(mime_types));
}
@ -99,7 +99,7 @@ private:
void request_tooltip_show();
void tooltip_hide_timer_did_fire();
void set_drag_hovered_widget_impl(Widget*, Gfx::IntPoint const& = {}, Vector<DeprecatedString> = {});
void set_drag_hovered_widget_impl(Widget*, Gfx::IntPoint = {}, Vector<DeprecatedString> = {});
void set_pending_drop_widget(Widget*);
OwnPtr<Core::EventLoop> m_event_loop;

View file

@ -238,7 +238,7 @@ void ColumnsView::update_column_sizes()
set_content_size({ total_width, total_height });
}
Optional<ColumnsView::Column> ColumnsView::column_at_event_position(Gfx::IntPoint const& a_position) const
Optional<ColumnsView::Column> ColumnsView::column_at_event_position(Gfx::IntPoint a_position) const
{
if (!model())
return {};
@ -275,7 +275,7 @@ void ColumnsView::select_range(ModelIndex const& index)
}
}
ModelIndex ColumnsView::index_at_event_position_in_column(Gfx::IntPoint const& position, Column const& column) const
ModelIndex ColumnsView::index_at_event_position_in_column(Gfx::IntPoint position, Column const& column) const
{
int row = position.y() / item_height();
int row_count = model()->row_count(column.parent_index);
@ -285,7 +285,7 @@ ModelIndex ColumnsView::index_at_event_position_in_column(Gfx::IntPoint const& p
return model()->index(row, m_model_column, column.parent_index);
}
ModelIndex ColumnsView::index_at_event_position(Gfx::IntPoint const& position) const
ModelIndex ColumnsView::index_at_event_position(Gfx::IntPoint position) const
{
auto const& column = column_at_event_position(position);
if (!column.has_value())

View file

@ -18,7 +18,7 @@ public:
int model_column() const { return m_model_column; }
void set_model_column(int column) { m_model_column = column; }
virtual ModelIndex index_at_event_position(Gfx::IntPoint const&) const override;
virtual ModelIndex index_at_event_position(Gfx::IntPoint) const override;
virtual Gfx::IntRect content_rect(ModelIndex const&) const override;
virtual Gfx::IntRect paint_invalidation_rect(ModelIndex const&) const override;
@ -51,8 +51,8 @@ private:
// TODO: per-column vertical scroll?
};
Optional<Column> column_at_event_position(Gfx::IntPoint const&) const;
ModelIndex index_at_event_position_in_column(Gfx::IntPoint const&, Column const&) const;
Optional<Column> column_at_event_position(Gfx::IntPoint) const;
ModelIndex index_at_event_position_in_column(Gfx::IntPoint, Column const&) const;
bool m_rubber_banding { false };
int m_rubber_band_origin { 0 };

View file

@ -232,7 +232,7 @@ static MouseButton to_mouse_button(u32 button)
}
}
void ConnectionToWindowServer::mouse_down(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y, i32 wheel_raw_delta_x, i32 wheel_raw_delta_y)
void ConnectionToWindowServer::mouse_down(i32 window_id, Gfx::IntPoint mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y, i32 wheel_raw_delta_x, i32 wheel_raw_delta_y)
{
auto* window = Window::from_window_id(window_id);
if (!window)
@ -253,13 +253,13 @@ void ConnectionToWindowServer::mouse_down(i32 window_id, Gfx::IntPoint const& mo
Core::EventLoop::current().post_event(*window, move(mouse_event));
}
void ConnectionToWindowServer::mouse_up(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y, i32 wheel_raw_delta_x, i32 wheel_raw_delta_y)
void ConnectionToWindowServer::mouse_up(i32 window_id, Gfx::IntPoint mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y, i32 wheel_raw_delta_x, i32 wheel_raw_delta_y)
{
if (auto* window = Window::from_window_id(window_id))
Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseUp, mouse_position, buttons, to_mouse_button(button), modifiers, wheel_delta_x, wheel_delta_y, wheel_raw_delta_x, wheel_raw_delta_y));
}
void ConnectionToWindowServer::mouse_move(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y, i32 wheel_raw_delta_x, i32 wheel_raw_delta_y, bool is_drag, Vector<DeprecatedString> const& mime_types)
void ConnectionToWindowServer::mouse_move(i32 window_id, Gfx::IntPoint mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y, i32 wheel_raw_delta_x, i32 wheel_raw_delta_y, bool is_drag, Vector<DeprecatedString> const& mime_types)
{
if (auto* window = Window::from_window_id(window_id)) {
if (is_drag)
@ -269,13 +269,13 @@ void ConnectionToWindowServer::mouse_move(i32 window_id, Gfx::IntPoint const& mo
}
}
void ConnectionToWindowServer::mouse_double_click(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y, i32 wheel_raw_delta_x, i32 wheel_raw_delta_y)
void ConnectionToWindowServer::mouse_double_click(i32 window_id, Gfx::IntPoint mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y, i32 wheel_raw_delta_x, i32 wheel_raw_delta_y)
{
if (auto* window = Window::from_window_id(window_id))
Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseDoubleClick, mouse_position, buttons, to_mouse_button(button), modifiers, wheel_delta_x, wheel_delta_y, wheel_raw_delta_x, wheel_raw_delta_y));
}
void ConnectionToWindowServer::mouse_wheel(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y, i32 wheel_raw_delta_x, i32 wheel_raw_delta_y)
void ConnectionToWindowServer::mouse_wheel(i32 window_id, Gfx::IntPoint mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y, i32 wheel_raw_delta_x, i32 wheel_raw_delta_y)
{
if (auto* window = Window::from_window_id(window_id))
Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseWheel, mouse_position, buttons, to_mouse_button(button), modifiers, wheel_delta_x, wheel_delta_y, wheel_raw_delta_x, wheel_raw_delta_y));
@ -349,7 +349,7 @@ void ConnectionToWindowServer::applet_area_rect_changed(Gfx::IntRect const& rect
});
}
void ConnectionToWindowServer::drag_dropped(i32 window_id, Gfx::IntPoint const& mouse_position, DeprecatedString const& text, HashMap<DeprecatedString, ByteBuffer> const& mime_data)
void ConnectionToWindowServer::drag_dropped(i32 window_id, Gfx::IntPoint mouse_position, DeprecatedString const& text, HashMap<DeprecatedString, ByteBuffer> const& mime_data)
{
if (auto* window = Window::from_window_id(window_id)) {
auto mime_data_obj = Core::MimeData::construct(mime_data);
@ -386,7 +386,7 @@ void ConnectionToWindowServer::display_link_notification()
});
}
void ConnectionToWindowServer::track_mouse_move(Gfx::IntPoint const& mouse_position)
void ConnectionToWindowServer::track_mouse_move(Gfx::IntPoint mouse_position)
{
MouseTracker::track_mouse_move({}, mouse_position);
}

View file

@ -26,11 +26,11 @@ private:
virtual void fast_greet(Vector<Gfx::IntRect> const&, u32, u32, u32, Core::AnonymousBuffer const&, DeprecatedString const&, DeprecatedString const&, DeprecatedString const&, Vector<bool> const&, i32) 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, i32, i32, i32, bool, Vector<DeprecatedString> const&) override;
virtual void mouse_down(i32, Gfx::IntPoint const&, u32, u32, u32, i32, i32, i32, i32) override;
virtual void mouse_double_click(i32, Gfx::IntPoint const&, u32, u32, u32, i32, i32, i32, i32) override;
virtual void mouse_up(i32, Gfx::IntPoint const&, u32, u32, u32, i32, i32, i32, i32) override;
virtual void mouse_wheel(i32, Gfx::IntPoint const&, u32, u32, u32, i32, i32, i32, i32) override;
virtual void mouse_move(i32, Gfx::IntPoint, u32, u32, u32, i32, i32, i32, i32, bool, Vector<DeprecatedString> const&) override;
virtual void mouse_down(i32, Gfx::IntPoint, u32, u32, u32, i32, i32, i32, i32) override;
virtual void mouse_double_click(i32, Gfx::IntPoint, u32, u32, u32, i32, i32, i32, i32) override;
virtual void mouse_up(i32, Gfx::IntPoint, u32, u32, u32, i32, i32, i32, i32) override;
virtual void mouse_wheel(i32, Gfx::IntPoint, u32, u32, u32, i32, i32, i32, i32) override;
virtual void window_entered(i32) override;
virtual void window_left(i32) override;
virtual void key_down(i32, u32, u32, u32, u32) override;
@ -48,7 +48,7 @@ private:
virtual void menu_visibility_did_change(i32, bool) override;
virtual void screen_rects_changed(Vector<Gfx::IntRect> const&, u32, u32, u32) override;
virtual void applet_area_rect_changed(Gfx::IntRect const&) override;
virtual void drag_dropped(i32, Gfx::IntPoint const&, DeprecatedString const&, HashMap<DeprecatedString, ByteBuffer> const&) override;
virtual void drag_dropped(i32, Gfx::IntPoint, DeprecatedString const&, HashMap<DeprecatedString, ByteBuffer> const&) override;
virtual void drag_accepted() override;
virtual void drag_cancelled() override;
virtual void update_system_theme(Core::AnonymousBuffer const&) override;
@ -56,7 +56,7 @@ private:
virtual void update_system_effects(Vector<bool> const&) override;
virtual void window_state_changed(i32, bool, bool, bool) override;
virtual void display_link_notification() override;
virtual void track_mouse_move(Gfx::IntPoint const&) override;
virtual void track_mouse_move(Gfx::IntPoint) override;
virtual void ping() override;
bool m_in_command_palette { false };

View file

@ -12,7 +12,7 @@
namespace GUI {
DropEvent::DropEvent(Gfx::IntPoint const& position, DeprecatedString const& text, NonnullRefPtr<Core::MimeData> mime_data)
DropEvent::DropEvent(Gfx::IntPoint position, DeprecatedString const& text, NonnullRefPtr<Core::MimeData> mime_data)
: Event(Event::Drop)
, m_position(position)
, m_text(text)

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; }

View file

@ -106,7 +106,7 @@ auto IconView::get_item_data(int item_index) const -> ItemData&
return item_data;
}
auto IconView::item_data_from_content_position(Gfx::IntPoint const& content_position) const -> ItemData*
auto IconView::item_data_from_content_position(Gfx::IntPoint content_position) const -> ItemData*
{
if (!m_visual_row_count || !m_visual_column_count)
return nullptr;
@ -195,7 +195,7 @@ Gfx::IntRect IconView::item_rect(int item_index) const
};
}
ModelIndex IconView::index_at_event_position(Gfx::IntPoint const& position) const
ModelIndex IconView::index_at_event_position(Gfx::IntPoint position) const
{
VERIFY(model());
auto adjusted_position = to_content_position(position);
@ -244,7 +244,7 @@ void IconView::mouseup_event(MouseEvent& event)
AbstractView::mouseup_event(event);
}
bool IconView::update_rubber_banding(Gfx::IntPoint const& input_position)
bool IconView::update_rubber_banding(Gfx::IntPoint input_position)
{
auto adjusted_position = to_content_position(input_position.constrained(widget_inner_rect().inflated(1, 1)));
if (m_rubber_band_current != adjusted_position) {

View file

@ -39,7 +39,7 @@ public:
int model_column() const { return m_model_column; }
void set_model_column(int column) { m_model_column = column; }
virtual ModelIndex index_at_event_position(Gfx::IntPoint const&) const override;
virtual ModelIndex index_at_event_position(Gfx::IntPoint) const override;
virtual Gfx::IntRect content_rect(ModelIndex const&) const override;
virtual Gfx::IntRect editing_rect(ModelIndex const&) const override;
virtual Gfx::IntRect paint_invalidation_rect(ModelIndex const&) const override;
@ -93,7 +93,7 @@ private:
return hot_icon_rect().intersects(rect) || hot_text_rect().intersects(rect);
}
bool is_containing(Gfx::IntPoint const& point) const
bool is_containing(Gfx::IntPoint point) const
{
VERIFY(valid);
return hot_icon_rect().contains(point) || hot_text_rect().contains(point);
@ -113,7 +113,7 @@ private:
template<typename Function>
IterationDecision for_each_item_intersecting_rects(Vector<Gfx::IntRect> const&, Function) const;
void column_row_from_content_position(Gfx::IntPoint const& content_position, int& row, int& column) const
void column_row_from_content_position(Gfx::IntPoint content_position, int& row, int& column) const
{
row = max(0, min(m_visual_row_count - 1, content_position.y() / effective_item_size().height()));
column = max(0, min(m_visual_column_count - 1, content_position.x() / effective_item_size().width()));
@ -124,7 +124,7 @@ private:
void update_content_size();
void update_item_rects(int item_index, ItemData& item_data) const;
void get_item_rects(int item_index, ItemData& item_data, Gfx::Font const&) const;
bool update_rubber_banding(Gfx::IntPoint const&);
bool update_rubber_banding(Gfx::IntPoint);
int items_per_page() const;
void rebuild_item_cache() const;
@ -141,7 +141,7 @@ private:
virtual void toggle_selection(ModelIndex const& new_index) override;
ItemData& get_item_data(int) const;
ItemData* item_data_from_content_position(Gfx::IntPoint const&) const;
ItemData* item_data_from_content_position(Gfx::IntPoint) const;
void do_clear_selection();
bool do_add_selection(ItemData&);
void add_selection(ItemData&);

View file

@ -80,7 +80,7 @@ Gfx::IntRect ListView::content_rect(ModelIndex const& index) const
return content_rect(index.row());
}
ModelIndex ListView::index_at_event_position(Gfx::IntPoint const& point) const
ModelIndex ListView::index_at_event_position(Gfx::IntPoint point) const
{
VERIFY(model());
@ -93,7 +93,7 @@ ModelIndex ListView::index_at_event_position(Gfx::IntPoint const& point) const
return {};
}
Gfx::IntPoint ListView::adjusted_position(Gfx::IntPoint const& position) const
Gfx::IntPoint ListView::adjusted_position(Gfx::IntPoint position) const
{
return position.translated(horizontal_scrollbar().value() - frame_thickness(), vertical_scrollbar().value() - frame_thickness());
}

View file

@ -29,9 +29,9 @@ public:
virtual void scroll_into_view(ModelIndex const& index, bool scroll_horizontally, bool scroll_vertically) override;
Gfx::IntPoint adjusted_position(Gfx::IntPoint const&) const;
Gfx::IntPoint adjusted_position(Gfx::IntPoint) const;
virtual ModelIndex index_at_event_position(Gfx::IntPoint const&) const override;
virtual ModelIndex index_at_event_position(Gfx::IntPoint) const override;
virtual Gfx::IntRect content_rect(ModelIndex const&) const override;
int model_column() const { return m_model_column; }

View file

@ -116,7 +116,7 @@ void Menu::realize_if_needed(RefPtr<Action> const& default_action)
realize_menu(default_action);
}
void Menu::popup(Gfx::IntPoint const& screen_position, RefPtr<Action> const& default_action, Gfx::IntRect const& button_rect)
void Menu::popup(Gfx::IntPoint screen_position, RefPtr<Action> const& default_action, Gfx::IntRect const& button_rect)
{
realize_if_needed(default_action);
ConnectionToWindowServer::the().async_popup_menu(m_menu_id, screen_position, button_rect);

View file

@ -48,7 +48,7 @@ public:
Menu& add_submenu(DeprecatedString name);
void remove_all_actions();
void popup(Gfx::IntPoint const& screen_position, RefPtr<Action> const& default_action = nullptr, Gfx::IntRect const& button_rect = {});
void popup(Gfx::IntPoint screen_position, RefPtr<Action> const& default_action = nullptr, Gfx::IntRect const& button_rect = {});
void dismiss();
void visibility_did_change(Badge<ConnectionToWindowServer>, bool visible);

View file

@ -26,7 +26,7 @@ MouseTracker::~MouseTracker()
}
}
void MouseTracker::track_mouse_move(Badge<ConnectionToWindowServer>, Gfx::IntPoint const& point)
void MouseTracker::track_mouse_move(Badge<ConnectionToWindowServer>, Gfx::IntPoint point)
{
for (auto& tracker : s_trackers) {
tracker.track_mouse_move(point);

View file

@ -19,10 +19,10 @@ public:
MouseTracker();
virtual ~MouseTracker();
static void track_mouse_move(Badge<ConnectionToWindowServer>, Gfx::IntPoint const&);
static void track_mouse_move(Badge<ConnectionToWindowServer>, Gfx::IntPoint);
protected:
virtual void track_mouse_move(Gfx::IntPoint const&) = 0;
virtual void track_mouse_move(Gfx::IntPoint) = 0;
private:
IntrusiveListNode<MouseTracker> m_list_node;

View file

@ -95,7 +95,7 @@ void OpacitySlider::paint_event(PaintEvent& event)
Gfx::StylePainter::paint_frame(painter, rect(), palette(), Gfx::FrameShape::Container, Gfx::FrameShadow::Sunken, 2);
}
int OpacitySlider::value_at(Gfx::IntPoint const& position) const
int OpacitySlider::value_at(Gfx::IntPoint position) const
{
auto inner_rect = frame_inner_rect();
if (position.x() < inner_rect.left())

View file

@ -29,7 +29,7 @@ private:
Gfx::IntRect frame_inner_rect() const;
int value_at(Gfx::IntPoint const&) const;
int value_at(Gfx::IntPoint) const;
bool m_dragging { false };
};

View file

@ -324,7 +324,7 @@ void Scrollbar::set_automatic_scrolling_active(bool active, Component pressed_co
}
}
void Scrollbar::scroll_by_page(Gfx::IntPoint const& click_position)
void Scrollbar::scroll_by_page(Gfx::IntPoint click_position)
{
float range_size = max() - min();
float available = scrubbable_range_in_pixels();
@ -340,7 +340,7 @@ void Scrollbar::scroll_by_page(Gfx::IntPoint const& click_position)
}
}
void Scrollbar::scroll_to_position(Gfx::IntPoint const& click_position)
void Scrollbar::scroll_to_position(Gfx::IntPoint click_position)
{
float range_size = max() - min();
float available = scrubbable_range_in_pixels();
@ -350,7 +350,7 @@ void Scrollbar::scroll_to_position(Gfx::IntPoint const& click_position)
set_target_value(min() + rel_x_or_y * range_size);
}
Scrollbar::Component Scrollbar::component_at_position(Gfx::IntPoint const& position)
Scrollbar::Component Scrollbar::component_at_position(Gfx::IntPoint position)
{
if (scrubber_rect().contains(position))
return Component::Scrubber;

View file

@ -82,10 +82,10 @@ private:
void on_automatic_scrolling_timer_fired();
void set_automatic_scrolling_active(bool, Component);
void scroll_to_position(Gfx::IntPoint const&);
void scroll_by_page(Gfx::IntPoint const&);
void scroll_to_position(Gfx::IntPoint);
void scroll_by_page(Gfx::IntPoint);
Component component_at_position(Gfx::IntPoint const&);
Component component_at_position(Gfx::IntPoint);
void update_animated_scroll();

View file

@ -115,7 +115,7 @@ void Splitter::leave_event(Core::Event&)
set_hovered_grabbable(nullptr);
}
Splitter::Grabbable* Splitter::grabbable_at(Gfx::IntPoint const& position)
Splitter::Grabbable* Splitter::grabbable_at(Gfx::IntPoint position)
{
for (auto& grabbable : m_grabbables) {
if (grabbable.grabbable_rect.contains(position))

View file

@ -70,7 +70,7 @@ private:
WeakPtr<Widget> second_widget;
};
Grabbable* grabbable_at(Gfx::IntPoint const&);
Grabbable* grabbable_at(Gfx::IntPoint);
void set_hovered_grabbable(Grabbable*);
Vector<Grabbable> m_grabbables;

View file

@ -144,7 +144,7 @@ void TextEditor::update_content_size()
set_size_occupied_by_fixed_elements({ ruler_width() + gutter_width(), 0 });
}
TextPosition TextEditor::text_position_at_content_position(Gfx::IntPoint const& content_position) const
TextPosition TextEditor::text_position_at_content_position(Gfx::IntPoint content_position) const
{
auto position = content_position;
if (is_single_line() && icon())
@ -205,7 +205,7 @@ TextPosition TextEditor::text_position_at_content_position(Gfx::IntPoint const&
return { line_index, column_index };
}
TextPosition TextEditor::text_position_at(Gfx::IntPoint const& widget_position) const
TextPosition TextEditor::text_position_at(Gfx::IntPoint widget_position) const
{
auto content_position = widget_position;
content_position.translate_by(horizontal_scrollbar().value(), vertical_scrollbar().value());

View file

@ -216,7 +216,7 @@ public:
int number_of_visible_lines() const;
Gfx::IntRect cursor_content_rect() const;
TextPosition text_position_at_content_position(Gfx::IntPoint const&) const;
TextPosition text_position_at_content_position(Gfx::IntPoint) const;
void delete_text_range(TextRange);
@ -263,7 +263,7 @@ protected:
Gfx::IntRect ruler_content_rect(size_t line) const;
Gfx::IntRect gutter_content_rect(size_t line) const;
TextPosition text_position_at(Gfx::IntPoint const&) const;
TextPosition text_position_at(Gfx::IntPoint) const;
bool ruler_visible() const { return m_ruler_visible; }
bool gutter_visible() const { return m_gutter_visible; }
Gfx::IntRect content_rect_for_position(TextPosition const&) const;

View file

@ -155,7 +155,7 @@ void Tray::leave_event(Core::Event&)
update();
}
Tray::Item* Tray::item_at(Gfx::IntPoint const& position)
Tray::Item* Tray::item_at(Gfx::IntPoint position)
{
for (auto& item : m_items) {
if (item.rect(*this).contains(position))

View file

@ -45,7 +45,7 @@ private:
Gfx::IntRect rect(Tray const&) const;
};
Item* item_at(Gfx::IntPoint const&);
Item* item_at(Gfx::IntPoint);
Vector<Item> m_items;

View file

@ -46,7 +46,7 @@ TreeView::TreeView()
m_collapse_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/serenity/treeview-collapse.png"sv).release_value_but_fixme_should_propagate_errors();
}
ModelIndex TreeView::index_at_event_position(Gfx::IntPoint const& a_position, bool& is_toggle) const
ModelIndex TreeView::index_at_event_position(Gfx::IntPoint a_position, bool& is_toggle) const
{
auto position = a_position.translated(0, -column_header().height()).translated(horizontal_scrollbar().value() - frame_thickness(), vertical_scrollbar().value() - frame_thickness());
is_toggle = false;

View file

@ -53,7 +53,7 @@ protected:
virtual void move_cursor(CursorMovement, SelectionUpdate) override;
private:
virtual ModelIndex index_at_event_position(Gfx::IntPoint const&, bool& is_toggle) const override;
virtual ModelIndex index_at_event_position(Gfx::IntPoint, bool& is_toggle) const override;
int row_height() const { return 16; }
int max_item_width() const { return frame_inner_rect().width(); }

View file

@ -132,7 +132,7 @@ Gfx::IntRect ValueSlider::knob_rect() const
return knob_rect;
}
int ValueSlider::value_at(Gfx::IntPoint const& position) const
int ValueSlider::value_at(Gfx::IntPoint position) const
{
if (position.x() < bar_rect().left())
return min();

View file

@ -39,7 +39,7 @@ private:
explicit ValueSlider(Gfx::Orientation = Gfx::Orientation::Horizontal, DeprecatedString suffix = "");
DeprecatedString formatted_value() const;
int value_at(Gfx::IntPoint const& position) const;
int value_at(Gfx::IntPoint position) const;
Gfx::IntRect bar_rect() const;
Gfx::IntRect knob_rect() const;

View file

@ -697,7 +697,7 @@ Gfx::IntRect Widget::screen_relative_rect() const
return window_relative_rect().translated(window_position);
}
Widget* Widget::child_at(Gfx::IntPoint const& point) const
Widget* Widget::child_at(Gfx::IntPoint point) const
{
for (int i = children().size() - 1; i >= 0; --i) {
if (!is<Widget>(children()[i]))
@ -711,7 +711,7 @@ Widget* Widget::child_at(Gfx::IntPoint const& point) const
return nullptr;
}
Widget::HitTestResult Widget::hit_test(Gfx::IntPoint const& position, ShouldRespectGreediness should_respect_greediness)
Widget::HitTestResult Widget::hit_test(Gfx::IntPoint position, ShouldRespectGreediness should_respect_greediness)
{
if (should_respect_greediness == ShouldRespectGreediness::Yes && is_greedy_for_hits())
return { this, position };

View file

@ -240,8 +240,8 @@ public:
WeakPtr<Widget> widget;
Gfx::IntPoint local_position;
};
HitTestResult hit_test(Gfx::IntPoint const&, ShouldRespectGreediness = ShouldRespectGreediness::Yes);
Widget* child_at(Gfx::IntPoint const&) const;
HitTestResult hit_test(Gfx::IntPoint, ShouldRespectGreediness = ShouldRespectGreediness::Yes);
Widget* child_at(Gfx::IntPoint) const;
void set_relative_rect(Gfx::IntRect const&);
void set_relative_rect(int x, int y, int width, int height) { set_relative_rect({ x, y, width, height }); }
@ -251,13 +251,13 @@ public:
void set_width(int width) { set_relative_rect(x(), y(), width, height()); }
void set_height(int height) { set_relative_rect(x(), y(), width(), height); }
void move_to(Gfx::IntPoint const& point) { set_relative_rect({ point, relative_rect().size() }); }
void move_to(Gfx::IntPoint point) { set_relative_rect({ point, relative_rect().size() }); }
void move_to(int x, int y) { move_to({ x, y }); }
void resize(Gfx::IntSize const& size) { set_relative_rect({ relative_rect().location(), size }); }
void resize(int width, int height) { resize({ width, height }); }
void move_by(int x, int y) { move_by({ x, y }); }
void move_by(Gfx::IntPoint const& delta) { set_relative_rect({ relative_position().translated(delta), size() }); }
void move_by(Gfx::IntPoint delta) { set_relative_rect({ relative_position().translated(delta), size() }); }
Gfx::ColorRole background_role() const { return m_background_role; }
void set_background_role(Gfx::ColorRole);

View file

@ -117,7 +117,7 @@ public:
void set_minimum_size(int width, int height) { set_minimum_size({ width, height }); }
void move_to(int x, int y) { move_to({ x, y }); }
void move_to(Gfx::IntPoint const& point) { set_rect({ point, size() }); }
void move_to(Gfx::IntPoint point) { set_rect({ point, size() }); }
void resize(int width, int height) { resize({ width, height }); }
void resize(Gfx::IntSize const& size) { set_rect({ position(), size }); }