mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 07:17: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:
parent
bbc149ebb9
commit
7be0b27dd3
161 changed files with 442 additions and 441 deletions
|
@ -90,7 +90,7 @@ public:
|
|||
Gfx::IntRect& rect() { return m_rect; }
|
||||
Gfx::IntRect const& rect() const { return m_rect; }
|
||||
Gfx::IntPoint position() const { return m_rect.location(); }
|
||||
Gfx::IntPoint const& old_position() const { return m_old_position; }
|
||||
Gfx::IntPoint old_position() const { return m_old_position; }
|
||||
Rank rank() const { return m_rank; };
|
||||
Suit suit() const { return m_suit; }
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ CardStack::CardStack()
|
|||
{
|
||||
}
|
||||
|
||||
CardStack::CardStack(Gfx::IntPoint const& position, Type type, RefPtr<CardStack> covered_stack)
|
||||
CardStack::CardStack(Gfx::IntPoint position, Type type, RefPtr<CardStack> covered_stack)
|
||||
: m_covered_stack(move(covered_stack))
|
||||
, m_position(position)
|
||||
, m_type(type)
|
||||
|
@ -98,7 +98,7 @@ void CardStack::rebound_cards()
|
|||
card.set_position(m_stack_positions.at(card_index++));
|
||||
}
|
||||
|
||||
void CardStack::add_all_grabbed_cards(Gfx::IntPoint const& click_location, NonnullRefPtrVector<Card>& grabbed, MovementRule movement_rule)
|
||||
void CardStack::add_all_grabbed_cards(Gfx::IntPoint click_location, NonnullRefPtrVector<Card>& grabbed, MovementRule movement_rule)
|
||||
{
|
||||
VERIFY(grabbed.is_empty());
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
};
|
||||
|
||||
CardStack();
|
||||
CardStack(Gfx::IntPoint const& position, Type type, RefPtr<CardStack> covered_stack = nullptr);
|
||||
CardStack(Gfx::IntPoint position, Type type, RefPtr<CardStack> covered_stack = nullptr);
|
||||
|
||||
bool is_empty() const { return m_stack.is_empty(); }
|
||||
Type type() const { return m_type; }
|
||||
|
@ -49,7 +49,7 @@ public:
|
|||
void rebound_cards();
|
||||
|
||||
bool is_allowed_to_push(Card const&, size_t stack_size = 1, MovementRule movement_rule = MovementRule::Alternating) const;
|
||||
void add_all_grabbed_cards(Gfx::IntPoint const& click_location, NonnullRefPtrVector<Card>& grabbed, MovementRule movement_rule = MovementRule::Alternating);
|
||||
void add_all_grabbed_cards(Gfx::IntPoint click_location, NonnullRefPtrVector<Card>& grabbed, MovementRule movement_rule = MovementRule::Alternating);
|
||||
void paint(GUI::Painter&, Gfx::Color background_color);
|
||||
void clear();
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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() }; }
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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 };
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 };
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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; }
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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&);
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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 };
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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(); }
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 };
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 }); }
|
||||
|
|
|
@ -148,7 +148,7 @@ void AffineTransform::map(float unmapped_x, float unmapped_y, float& mapped_x, f
|
|||
}
|
||||
|
||||
template<>
|
||||
IntPoint AffineTransform::map(IntPoint const& point) const
|
||||
IntPoint AffineTransform::map(IntPoint point) const
|
||||
{
|
||||
float mapped_x;
|
||||
float mapped_y;
|
||||
|
@ -157,7 +157,7 @@ IntPoint AffineTransform::map(IntPoint const& point) const
|
|||
}
|
||||
|
||||
template<>
|
||||
FloatPoint AffineTransform::map(FloatPoint const& point) const
|
||||
FloatPoint AffineTransform::map(FloatPoint point) const
|
||||
{
|
||||
float mapped_x;
|
||||
float mapped_y;
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
void map(float unmapped_x, float unmapped_y, float& mapped_x, float& mapped_y) const;
|
||||
|
||||
template<Arithmetic T>
|
||||
Point<T> map(Point<T> const&) const;
|
||||
Point<T> map(Point<T>) const;
|
||||
|
||||
template<Arithmetic T>
|
||||
Size<T> map(Size<T> const&) const;
|
||||
|
|
|
@ -366,7 +366,7 @@ void AntiAliasingPainter::draw_ellipse(IntRect const& a_rect, Color color, int t
|
|||
m_underlying_painter.blit(a_rect.location(), outline_ellipse_bitmap, outline_ellipse_bitmap->rect(), color.alpha() / 255.);
|
||||
}
|
||||
|
||||
void AntiAliasingPainter::fill_circle(IntPoint const& center, int radius, Color color, BlendMode blend_mode)
|
||||
void AntiAliasingPainter::fill_circle(IntPoint center, int radius, Color color, BlendMode blend_mode)
|
||||
{
|
||||
if (radius <= 0)
|
||||
return;
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
|
||||
void fill_rect(FloatRect const&, Color);
|
||||
|
||||
void fill_circle(IntPoint const& center, int radius, Color, BlendMode blend_mode = BlendMode::Normal);
|
||||
void fill_circle(IntPoint center, int radius, Color, BlendMode blend_mode = BlendMode::Normal);
|
||||
void fill_ellipse(IntRect const& a_rect, Color, BlendMode blend_mode = BlendMode::Normal);
|
||||
|
||||
void fill_rect_with_rounded_corners(IntRect const&, Color, int radius);
|
||||
|
|
|
@ -636,7 +636,7 @@ Optional<Color> Bitmap::solid_color(u8 alpha_threshold) const
|
|||
return color;
|
||||
}
|
||||
|
||||
void Bitmap::flood_visit_from_point(Gfx::IntPoint const& start_point, int threshold,
|
||||
void Bitmap::flood_visit_from_point(Gfx::IntPoint start_point, int threshold,
|
||||
Function<void(Gfx::IntPoint location)> pixel_reached)
|
||||
{
|
||||
|
||||
|
|
|
@ -217,7 +217,7 @@ public:
|
|||
template<StorageFormat>
|
||||
[[nodiscard]] Color get_pixel(int physical_x, int physical_y) const;
|
||||
[[nodiscard]] Color get_pixel(int physical_x, int physical_y) const;
|
||||
[[nodiscard]] Color get_pixel(IntPoint const& physical_position) const
|
||||
[[nodiscard]] Color get_pixel(IntPoint physical_position) const
|
||||
{
|
||||
return get_pixel(physical_position.x(), physical_position.y());
|
||||
}
|
||||
|
@ -225,7 +225,7 @@ public:
|
|||
template<StorageFormat>
|
||||
void set_pixel(int physical_x, int physical_y, Color);
|
||||
void set_pixel(int physical_x, int physical_y, Color);
|
||||
void set_pixel(IntPoint const& physical_position, Color color)
|
||||
void set_pixel(IntPoint physical_position, Color color)
|
||||
{
|
||||
set_pixel(physical_position.x(), physical_position.y(), color);
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ public:
|
|||
|
||||
[[nodiscard]] Optional<Color> solid_color(u8 alpha_threshold = 0) const;
|
||||
|
||||
void flood_visit_from_point(Gfx::IntPoint const& start_point, int threshold, Function<void(Gfx::IntPoint location)> pixel_reached);
|
||||
void flood_visit_from_point(Gfx::IntPoint start_point, int threshold, Function<void(Gfx::IntPoint location)> pixel_reached);
|
||||
|
||||
private:
|
||||
Bitmap(BitmapFormat, IntSize const&, int, BackingStore const&);
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
namespace Gfx {
|
||||
|
||||
CursorParams CursorParams::parse_from_filename(StringView cursor_path, Gfx::IntPoint const& default_hotspot)
|
||||
CursorParams CursorParams::parse_from_filename(StringView cursor_path, Gfx::IntPoint default_hotspot)
|
||||
{
|
||||
LexicalPath path(cursor_path);
|
||||
auto file_title = path.title();
|
||||
|
|
|
@ -13,17 +13,17 @@ namespace Gfx {
|
|||
|
||||
class CursorParams {
|
||||
public:
|
||||
static CursorParams parse_from_filename(StringView, Gfx::IntPoint const&);
|
||||
static CursorParams parse_from_filename(StringView, Gfx::IntPoint);
|
||||
|
||||
CursorParams() = default;
|
||||
|
||||
CursorParams(Gfx::IntPoint const& hotspot)
|
||||
CursorParams(Gfx::IntPoint hotspot)
|
||||
: m_hotspot(hotspot)
|
||||
{
|
||||
}
|
||||
CursorParams constrained(Gfx::Bitmap const&) const;
|
||||
|
||||
Gfx::IntPoint const& hotspot() const { return m_hotspot; }
|
||||
Gfx::IntPoint hotspot() const { return m_hotspot; }
|
||||
unsigned frames() const { return m_frames; }
|
||||
unsigned frame_ms() const { return m_frame_ms; }
|
||||
|
||||
|
|
|
@ -429,7 +429,7 @@ void Painter::fill_rounded_corner(IntRect const& a_rect, int radius, Color color
|
|||
}
|
||||
}
|
||||
|
||||
void Painter::draw_circle_arc_intersecting(IntRect const& a_rect, IntPoint const& center, int radius, Color color, int thickness)
|
||||
void Painter::draw_circle_arc_intersecting(IntRect const& a_rect, IntPoint center, int radius, Color color, int thickness)
|
||||
{
|
||||
if (thickness <= 0 || radius <= 0)
|
||||
return;
|
||||
|
@ -651,7 +651,7 @@ void Painter::draw_rect_with_thickness(IntRect const& rect, Color color, int thi
|
|||
draw_line(p4, p1, color, thickness);
|
||||
}
|
||||
|
||||
void Painter::draw_bitmap(IntPoint const& p, CharacterBitmap const& bitmap, Color color)
|
||||
void Painter::draw_bitmap(IntPoint p, CharacterBitmap const& bitmap, Color color)
|
||||
{
|
||||
VERIFY(scale() == 1); // FIXME: Add scaling support.
|
||||
|
||||
|
@ -679,7 +679,7 @@ void Painter::draw_bitmap(IntPoint const& p, CharacterBitmap const& bitmap, Colo
|
|||
}
|
||||
}
|
||||
|
||||
void Painter::draw_bitmap(IntPoint const& p, GlyphBitmap const& bitmap, Color color)
|
||||
void Painter::draw_bitmap(IntPoint p, GlyphBitmap const& bitmap, Color color)
|
||||
{
|
||||
auto dst_rect = IntRect(p, bitmap.size()).translated(translation());
|
||||
auto clipped_rect = dst_rect.intersected(clip_rect());
|
||||
|
@ -718,13 +718,13 @@ void Painter::draw_bitmap(IntPoint const& p, GlyphBitmap const& bitmap, Color co
|
|||
}
|
||||
}
|
||||
|
||||
void Painter::draw_triangle(IntPoint const& offset, Span<IntPoint const> control_points, Color color)
|
||||
void Painter::draw_triangle(IntPoint offset, Span<IntPoint const> control_points, Color color)
|
||||
{
|
||||
VERIFY(control_points.size() == 3);
|
||||
draw_triangle(control_points[0] + offset, control_points[1] + offset, control_points[2] + offset, color);
|
||||
}
|
||||
|
||||
void Painter::draw_triangle(IntPoint const& a, IntPoint const& b, IntPoint const& c, Color color)
|
||||
void Painter::draw_triangle(IntPoint a, IntPoint b, IntPoint c, Color color)
|
||||
{
|
||||
IntPoint p0(to_physical(a));
|
||||
IntPoint p1(to_physical(b));
|
||||
|
@ -884,7 +884,7 @@ static void do_blit_with_opacity(BlitState& state)
|
|||
}
|
||||
}
|
||||
|
||||
void Painter::blit_with_opacity(IntPoint const& position, Gfx::Bitmap const& source, IntRect const& a_src_rect, float opacity, bool apply_alpha)
|
||||
void Painter::blit_with_opacity(IntPoint position, Gfx::Bitmap const& source, IntRect const& a_src_rect, float opacity, bool apply_alpha)
|
||||
{
|
||||
VERIFY(scale() >= source.scale() && "painter doesn't support downsampling scale factors");
|
||||
|
||||
|
@ -934,7 +934,7 @@ void Painter::blit_with_opacity(IntPoint const& position, Gfx::Bitmap const& sou
|
|||
}
|
||||
}
|
||||
|
||||
void Painter::blit_filtered(IntPoint const& position, Gfx::Bitmap const& source, IntRect const& src_rect, Function<Color(Color)> filter)
|
||||
void Painter::blit_filtered(IntPoint position, Gfx::Bitmap const& source, IntRect const& src_rect, Function<Color(Color)> filter)
|
||||
{
|
||||
VERIFY((source.scale() == 1 || source.scale() == scale()) && "blit_filtered only supports integer upsampling");
|
||||
|
||||
|
@ -999,14 +999,14 @@ void Painter::blit_filtered(IntPoint const& position, Gfx::Bitmap const& source,
|
|||
}
|
||||
}
|
||||
|
||||
void Painter::blit_brightened(IntPoint const& position, Gfx::Bitmap const& source, IntRect const& src_rect)
|
||||
void Painter::blit_brightened(IntPoint position, Gfx::Bitmap const& source, IntRect const& src_rect)
|
||||
{
|
||||
return blit_filtered(position, source, src_rect, [](Color src) {
|
||||
return src.lightened();
|
||||
});
|
||||
}
|
||||
|
||||
void Painter::blit_dimmed(IntPoint const& position, Gfx::Bitmap const& source, IntRect const& src_rect)
|
||||
void Painter::blit_dimmed(IntPoint position, Gfx::Bitmap const& source, IntRect const& src_rect)
|
||||
{
|
||||
return blit_filtered(position, source, src_rect, [](Color src) {
|
||||
return src.to_grayscale().lightened();
|
||||
|
@ -1059,7 +1059,7 @@ void Painter::draw_tiled_bitmap(IntRect const& a_dst_rect, Gfx::Bitmap const& so
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
void Painter::blit_offset(IntPoint const& a_position, Gfx::Bitmap const& source, IntRect const& a_src_rect, IntPoint const& offset)
|
||||
void Painter::blit_offset(IntPoint a_position, Gfx::Bitmap const& source, IntRect const& a_src_rect, IntPoint offset)
|
||||
{
|
||||
auto src_rect = IntRect { a_src_rect.location() - offset, a_src_rect.size() };
|
||||
auto position = a_position;
|
||||
|
@ -1074,7 +1074,7 @@ void Painter::blit_offset(IntPoint const& a_position, Gfx::Bitmap const& source,
|
|||
blit(position, source, src_rect);
|
||||
}
|
||||
|
||||
void Painter::blit(IntPoint const& position, Gfx::Bitmap const& source, IntRect const& a_src_rect, float opacity, bool apply_alpha)
|
||||
void Painter::blit(IntPoint position, Gfx::Bitmap const& source, IntRect const& a_src_rect, float opacity, bool apply_alpha)
|
||||
{
|
||||
VERIFY(scale() >= source.scale() && "painter doesn't support downsampling scale factors");
|
||||
|
||||
|
@ -1356,12 +1356,12 @@ void Painter::draw_scaled_bitmap(IntRect const& a_dst_rect, Gfx::Bitmap const& s
|
|||
}
|
||||
}
|
||||
|
||||
FLATTEN void Painter::draw_glyph(IntPoint const& point, u32 code_point, Color color)
|
||||
FLATTEN void Painter::draw_glyph(IntPoint point, u32 code_point, Color color)
|
||||
{
|
||||
draw_glyph(point, code_point, font(), color);
|
||||
}
|
||||
|
||||
FLATTEN void Painter::draw_glyph(IntPoint const& point, u32 code_point, Font const& font, Color color)
|
||||
FLATTEN void Painter::draw_glyph(IntPoint point, u32 code_point, Font const& font, Color color)
|
||||
{
|
||||
auto glyph = font.glyph(code_point);
|
||||
auto top_left = point + IntPoint(glyph.left_bearing(), 0);
|
||||
|
@ -1375,7 +1375,7 @@ FLATTEN void Painter::draw_glyph(IntPoint const& point, u32 code_point, Font con
|
|||
}
|
||||
}
|
||||
|
||||
void Painter::draw_emoji(IntPoint const& point, Gfx::Bitmap const& emoji, Font const& font)
|
||||
void Painter::draw_emoji(IntPoint point, Gfx::Bitmap const& emoji, Font const& font)
|
||||
{
|
||||
IntRect dst_rect {
|
||||
point.x(),
|
||||
|
@ -1386,7 +1386,7 @@ void Painter::draw_emoji(IntPoint const& point, Gfx::Bitmap const& emoji, Font c
|
|||
draw_scaled_bitmap(dst_rect, emoji, emoji.rect());
|
||||
}
|
||||
|
||||
void Painter::draw_glyph_or_emoji(IntPoint const& point, u32 code_point, Font const& font, Color color)
|
||||
void Painter::draw_glyph_or_emoji(IntPoint point, u32 code_point, Font const& font, Color color)
|
||||
{
|
||||
StringBuilder builder;
|
||||
builder.append_code_point(code_point);
|
||||
|
@ -1394,7 +1394,7 @@ void Painter::draw_glyph_or_emoji(IntPoint const& point, u32 code_point, Font co
|
|||
return draw_glyph_or_emoji(point, it, font, color);
|
||||
}
|
||||
|
||||
void Painter::draw_glyph_or_emoji(IntPoint const& point, Utf8CodePointIterator& it, Font const& font, Color color)
|
||||
void Painter::draw_glyph_or_emoji(IntPoint point, Utf8CodePointIterator& it, Font const& font, Color color)
|
||||
{
|
||||
// FIXME: These should live somewhere else.
|
||||
constexpr u32 text_variation_selector = 0xFE0E;
|
||||
|
@ -1823,7 +1823,7 @@ void Painter::draw_text(Function<void(IntRect const&, Utf8CodePointIterator&)> d
|
|||
});
|
||||
}
|
||||
|
||||
void Painter::set_pixel(IntPoint const& p, Color color, bool blend)
|
||||
void Painter::set_pixel(IntPoint p, Color color, bool blend)
|
||||
{
|
||||
auto point = p;
|
||||
point.translate_by(state().translation);
|
||||
|
@ -1838,7 +1838,7 @@ void Painter::set_pixel(IntPoint const& p, Color color, bool blend)
|
|||
dst = Color::from_argb(dst).blend(color).value();
|
||||
}
|
||||
|
||||
Optional<Color> Painter::get_pixel(IntPoint const& p)
|
||||
Optional<Color> Painter::get_pixel(IntPoint p)
|
||||
{
|
||||
auto point = p;
|
||||
point.translate_by(state().translation);
|
||||
|
@ -1904,7 +1904,7 @@ ALWAYS_INLINE void Painter::fill_physical_scanline_with_draw_op(int y, int x, in
|
|||
}
|
||||
}
|
||||
|
||||
void Painter::draw_physical_pixel(IntPoint const& physical_position, Color color, int thickness)
|
||||
void Painter::draw_physical_pixel(IntPoint physical_position, Color color, int thickness)
|
||||
{
|
||||
// This always draws a single physical pixel, independent of scale().
|
||||
// This should only be called by routines that already handle scale
|
||||
|
@ -1924,7 +1924,7 @@ void Painter::draw_physical_pixel(IntPoint const& physical_position, Color color
|
|||
fill_physical_rect(rect, color);
|
||||
}
|
||||
|
||||
void Painter::draw_line(IntPoint const& a_p1, IntPoint const& a_p2, Color color, int thickness, LineStyle style, Color alternate_color)
|
||||
void Painter::draw_line(IntPoint a_p1, IntPoint a_p2, Color color, int thickness, LineStyle style, Color alternate_color)
|
||||
{
|
||||
if (thickness <= 0)
|
||||
return;
|
||||
|
@ -2061,7 +2061,7 @@ void Painter::draw_line(IntPoint const& a_p1, IntPoint const& a_p2, Color color,
|
|||
}
|
||||
}
|
||||
|
||||
void Painter::draw_triangle_wave(IntPoint const& a_p1, IntPoint const& a_p2, Color color, int amplitude, int thickness)
|
||||
void Painter::draw_triangle_wave(IntPoint a_p1, IntPoint a_p2, Color color, int amplitude, int thickness)
|
||||
{
|
||||
// FIXME: Support more than horizontal waves
|
||||
VERIFY(a_p1.y() == a_p2.y());
|
||||
|
@ -2137,7 +2137,7 @@ void Painter::for_each_line_segment_on_bezier_curve(FloatPoint const& control_po
|
|||
for_each_line_segment_on_bezier_curve(control_point, p1, p2, callback);
|
||||
}
|
||||
|
||||
void Painter::draw_quadratic_bezier_curve(IntPoint const& control_point, IntPoint const& p1, IntPoint const& p2, Color color, int thickness, LineStyle style)
|
||||
void Painter::draw_quadratic_bezier_curve(IntPoint control_point, IntPoint p1, IntPoint p2, Color color, int thickness, LineStyle style)
|
||||
{
|
||||
VERIFY(scale() == 1); // FIXME: Add scaling support.
|
||||
|
||||
|
@ -2212,7 +2212,7 @@ void Painter::for_each_line_segment_on_cubic_bezier_curve(FloatPoint const& cont
|
|||
}
|
||||
}
|
||||
|
||||
void Painter::draw_cubic_bezier_curve(IntPoint const& control_point_0, IntPoint const& control_point_1, IntPoint const& p1, IntPoint const& p2, Color color, int thickness, Painter::LineStyle style)
|
||||
void Painter::draw_cubic_bezier_curve(IntPoint control_point_0, IntPoint control_point_1, IntPoint p1, IntPoint p2, Color color, int thickness, Painter::LineStyle style)
|
||||
{
|
||||
for_each_line_segment_on_cubic_bezier_curve(FloatPoint(control_point_0), FloatPoint(control_point_1), FloatPoint(p1), FloatPoint(p2), [&](FloatPoint const& fp1, FloatPoint const& fp2) {
|
||||
draw_line(IntPoint(fp1.x(), fp1.y()), IntPoint(fp2.x(), fp2.y()), color, thickness, style);
|
||||
|
@ -2277,7 +2277,7 @@ void Painter::for_each_line_segment_on_elliptical_arc(FloatPoint const& p1, Floa
|
|||
for_each_line_segment_on_elliptical_arc(p1, p2, center, radii, x_axis_rotation, theta_1, theta_delta, callback);
|
||||
}
|
||||
|
||||
void Painter::draw_elliptical_arc(IntPoint const& p1, IntPoint const& p2, IntPoint const& center, FloatPoint const& radii, float x_axis_rotation, float theta_1, float theta_delta, Color color, int thickness, LineStyle style)
|
||||
void Painter::draw_elliptical_arc(IntPoint p1, IntPoint p2, IntPoint center, FloatPoint const& radii, float x_axis_rotation, float theta_1, float theta_delta, Color color, int thickness, LineStyle style)
|
||||
{
|
||||
VERIFY(scale() == 1); // FIXME: Add scaling support.
|
||||
|
||||
|
@ -2361,7 +2361,7 @@ void Painter::fill_path(Path const& path, Color color, WindingRule winding_rule)
|
|||
Detail::fill_path<Detail::FillPathMode::PlaceOnIntGrid>(*this, path, color, winding_rule);
|
||||
}
|
||||
|
||||
void Painter::blit_disabled(IntPoint const& location, Gfx::Bitmap const& bitmap, IntRect const& rect, Palette const& palette)
|
||||
void Painter::blit_disabled(IntPoint location, Gfx::Bitmap const& bitmap, IntRect const& rect, Palette const& palette)
|
||||
{
|
||||
auto bright_color = palette.threed_highlight();
|
||||
auto dark_color = palette.threed_shadow1();
|
||||
|
|
|
@ -55,30 +55,30 @@ public:
|
|||
void draw_rect(IntRect const&, Color, bool rough = false);
|
||||
void draw_rect_with_thickness(IntRect const&, Color, int thickness);
|
||||
void draw_focus_rect(IntRect const&, Color);
|
||||
void draw_bitmap(IntPoint const&, CharacterBitmap const&, Color = Color());
|
||||
void draw_bitmap(IntPoint const&, GlyphBitmap const&, Color = Color());
|
||||
void draw_bitmap(IntPoint, CharacterBitmap const&, Color = Color());
|
||||
void draw_bitmap(IntPoint, GlyphBitmap const&, Color = Color());
|
||||
void draw_scaled_bitmap(IntRect const& dst_rect, Gfx::Bitmap const&, IntRect const& src_rect, float opacity = 1.0f, ScalingMode = ScalingMode::NearestNeighbor);
|
||||
void draw_scaled_bitmap(IntRect const& dst_rect, Gfx::Bitmap const&, FloatRect const& src_rect, float opacity = 1.0f, ScalingMode = ScalingMode::NearestNeighbor);
|
||||
void draw_scaled_bitmap_with_transform(IntRect const& dst_rect, Gfx::Bitmap const&, FloatRect const& src_rect, Gfx::AffineTransform const&, float opacity = 1.0f, ScalingMode = ScalingMode::NearestNeighbor);
|
||||
void draw_triangle(IntPoint const&, IntPoint const&, IntPoint const&, Color);
|
||||
void draw_triangle(IntPoint const& offset, Span<IntPoint const>, Color);
|
||||
void draw_triangle(IntPoint, IntPoint, IntPoint, Color);
|
||||
void draw_triangle(IntPoint offset, Span<IntPoint const>, Color);
|
||||
void draw_ellipse_intersecting(IntRect const&, Color, int thickness = 1);
|
||||
void set_pixel(IntPoint const&, Color, bool blend = false);
|
||||
void set_pixel(IntPoint, Color, bool blend = false);
|
||||
void set_pixel(int x, int y, Color color, bool blend = false) { set_pixel({ x, y }, color, blend); }
|
||||
Optional<Color> get_pixel(IntPoint const&);
|
||||
Optional<Color> get_pixel(IntPoint);
|
||||
ErrorOr<NonnullRefPtr<Bitmap>> get_region_bitmap(IntRect const&, BitmapFormat format, Optional<IntRect&> actual_region = {});
|
||||
void draw_line(IntPoint const&, IntPoint const&, Color, int thickness = 1, LineStyle style = LineStyle::Solid, Color alternate_color = Color::Transparent);
|
||||
void draw_triangle_wave(IntPoint const&, IntPoint const&, Color color, int amplitude, int thickness = 1);
|
||||
void draw_quadratic_bezier_curve(IntPoint const& control_point, IntPoint const&, IntPoint const&, Color, int thickness = 1, LineStyle style = LineStyle::Solid);
|
||||
void draw_cubic_bezier_curve(IntPoint const& control_point_0, IntPoint const& control_point_1, IntPoint const&, IntPoint const&, Color, int thickness = 1, LineStyle style = LineStyle::Solid);
|
||||
void draw_elliptical_arc(IntPoint const& p1, IntPoint const& p2, IntPoint const& center, FloatPoint const& radii, float x_axis_rotation, float theta_1, float theta_delta, Color, int thickness = 1, LineStyle style = LineStyle::Solid);
|
||||
void blit(IntPoint const&, Gfx::Bitmap const&, IntRect const& src_rect, float opacity = 1.0f, bool apply_alpha = true);
|
||||
void blit_dimmed(IntPoint const&, Gfx::Bitmap const&, IntRect const& src_rect);
|
||||
void blit_brightened(IntPoint const&, Gfx::Bitmap const&, IntRect const& src_rect);
|
||||
void blit_filtered(IntPoint const&, Gfx::Bitmap const&, IntRect const& src_rect, Function<Color(Color)>);
|
||||
void draw_line(IntPoint, IntPoint, Color, int thickness = 1, LineStyle style = LineStyle::Solid, Color alternate_color = Color::Transparent);
|
||||
void draw_triangle_wave(IntPoint, IntPoint, Color color, int amplitude, int thickness = 1);
|
||||
void draw_quadratic_bezier_curve(IntPoint control_point, IntPoint, IntPoint, Color, int thickness = 1, LineStyle style = LineStyle::Solid);
|
||||
void draw_cubic_bezier_curve(IntPoint control_point_0, IntPoint control_point_1, IntPoint, IntPoint, Color, int thickness = 1, LineStyle style = LineStyle::Solid);
|
||||
void draw_elliptical_arc(IntPoint p1, IntPoint p2, IntPoint center, FloatPoint const& radii, float x_axis_rotation, float theta_1, float theta_delta, Color, int thickness = 1, LineStyle style = LineStyle::Solid);
|
||||
void blit(IntPoint, Gfx::Bitmap const&, IntRect const& src_rect, float opacity = 1.0f, bool apply_alpha = true);
|
||||
void blit_dimmed(IntPoint, Gfx::Bitmap const&, IntRect const& src_rect);
|
||||
void blit_brightened(IntPoint, Gfx::Bitmap const&, IntRect const& src_rect);
|
||||
void blit_filtered(IntPoint, Gfx::Bitmap const&, IntRect const& src_rect, Function<Color(Color)>);
|
||||
void draw_tiled_bitmap(IntRect const& dst_rect, Gfx::Bitmap const&);
|
||||
void blit_offset(IntPoint const&, Gfx::Bitmap const&, IntRect const& src_rect, IntPoint const&);
|
||||
void blit_disabled(IntPoint const&, Gfx::Bitmap const&, IntRect const&, Palette const&);
|
||||
void blit_offset(IntPoint, Gfx::Bitmap const&, IntRect const& src_rect, IntPoint);
|
||||
void blit_disabled(IntPoint, Gfx::Bitmap const&, IntRect const&, Palette const&);
|
||||
void blit_tiled(IntRect const&, Gfx::Bitmap const&, IntRect const& src_rect);
|
||||
void draw_text(IntRect const&, StringView, Font const&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None, TextWrapping = TextWrapping::DontWrap);
|
||||
void draw_text(IntRect const&, StringView, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None, TextWrapping = TextWrapping::DontWrap);
|
||||
|
@ -88,12 +88,12 @@ public:
|
|||
void draw_text(Function<void(IntRect const&, Utf8CodePointIterator&)>, IntRect const&, Utf8View const&, Font const&, TextAlignment = TextAlignment::TopLeft, TextElision = TextElision::None, TextWrapping = TextWrapping::DontWrap);
|
||||
void draw_text(Function<void(IntRect const&, Utf8CodePointIterator&)>, IntRect const&, Utf32View const&, Font const&, TextAlignment = TextAlignment::TopLeft, TextElision = TextElision::None, TextWrapping = TextWrapping::DontWrap);
|
||||
void draw_ui_text(Gfx::IntRect const&, StringView, Gfx::Font const&, TextAlignment, Gfx::Color);
|
||||
void draw_glyph(IntPoint const&, u32, Color);
|
||||
void draw_glyph(IntPoint const&, u32, Font const&, Color);
|
||||
void draw_emoji(IntPoint const&, Gfx::Bitmap const&, Font const&);
|
||||
void draw_glyph_or_emoji(IntPoint const&, u32, Font const&, Color);
|
||||
void draw_glyph_or_emoji(IntPoint const&, Utf8CodePointIterator&, Font const&, Color);
|
||||
void draw_circle_arc_intersecting(IntRect const&, IntPoint const&, int radius, Color, int thickness);
|
||||
void draw_glyph(IntPoint, u32, Color);
|
||||
void draw_glyph(IntPoint, u32, Font const&, Color);
|
||||
void draw_emoji(IntPoint, Gfx::Bitmap const&, Font const&);
|
||||
void draw_glyph_or_emoji(IntPoint, u32, Font const&, Color);
|
||||
void draw_glyph_or_emoji(IntPoint, Utf8CodePointIterator&, Font const&, Color);
|
||||
void draw_circle_arc_intersecting(IntRect const&, IntPoint, int radius, Color, int thickness);
|
||||
|
||||
// Streamlined text drawing routine that does no wrapping/elision/alignment.
|
||||
void draw_text_run(FloatPoint const& baseline_start, Utf8View const&, Font const&, Color);
|
||||
|
@ -143,7 +143,7 @@ public:
|
|||
void clear_clip_rect();
|
||||
|
||||
void translate(int dx, int dy) { translate({ dx, dy }); }
|
||||
void translate(IntPoint const& delta) { state().translation.translate_by(delta); }
|
||||
void translate(IntPoint delta) { state().translation.translate_by(delta); }
|
||||
|
||||
IntPoint translation() const { return state().translation; }
|
||||
|
||||
|
@ -162,12 +162,12 @@ public:
|
|||
|
||||
protected:
|
||||
IntRect to_physical(IntRect const& r) const { return r.translated(translation()) * scale(); }
|
||||
IntPoint to_physical(IntPoint const& p) const { return p.translated(translation()) * scale(); }
|
||||
IntPoint to_physical(IntPoint p) const { return p.translated(translation()) * scale(); }
|
||||
void set_physical_pixel_with_draw_op(u32& pixel, Color);
|
||||
void fill_physical_scanline_with_draw_op(int y, int x, int width, Color color);
|
||||
void fill_rect_with_draw_op(IntRect const&, Color);
|
||||
void blit_with_opacity(IntPoint const&, Gfx::Bitmap const&, IntRect const& src_rect, float opacity, bool apply_alpha = true);
|
||||
void draw_physical_pixel(IntPoint const&, Color, int thickness = 1);
|
||||
void blit_with_opacity(IntPoint, Gfx::Bitmap const&, IntRect const& src_rect, float opacity, bool apply_alpha = true);
|
||||
void draw_physical_pixel(IntPoint, Color, int thickness = 1);
|
||||
|
||||
struct State {
|
||||
Font const* font;
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
virtual u32 char_code_to_code_point(u16 char_code) const = 0;
|
||||
virtual float get_char_width(u16 char_code) const = 0;
|
||||
|
||||
virtual void draw_glyph(Gfx::Painter& painter, Gfx::IntPoint const& point, float width, u32 char_code, Color color) = 0;
|
||||
virtual void draw_glyph(Gfx::Painter& painter, Gfx::IntPoint point, float width, u32 char_code, Color color) = 0;
|
||||
|
||||
virtual bool is_standard_font() const { return m_is_standard_font; }
|
||||
virtual Type type() const = 0;
|
||||
|
|
|
@ -65,7 +65,7 @@ float TrueTypeFont::get_char_width(u16 char_code) const
|
|||
return static_cast<float>(width) / 1000.0f;
|
||||
}
|
||||
|
||||
void TrueTypeFont::draw_glyph(Gfx::Painter& painter, Gfx::IntPoint const& point, float, u32 char_code, Color color)
|
||||
void TrueTypeFont::draw_glyph(Gfx::Painter& painter, Gfx::IntPoint point, float, u32 char_code, Color color)
|
||||
{
|
||||
if (!m_data.font)
|
||||
return;
|
||||
|
|
|
@ -24,7 +24,7 @@ public:
|
|||
u32 char_code_to_code_point(u16 char_code) const override;
|
||||
float get_char_width(u16 char_code) const override;
|
||||
|
||||
void draw_glyph(Gfx::Painter&, Gfx::IntPoint const&, float, u32, Color) override;
|
||||
void draw_glyph(Gfx::Painter&, Gfx::IntPoint, float, u32, Color) override;
|
||||
|
||||
Type type() const override { return PDFFont::Type::TrueType; }
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibGfx/Point.h>
|
||||
#include <LibPDF/Fonts/PDFFont.h>
|
||||
|
||||
namespace PDF {
|
||||
|
@ -26,7 +27,7 @@ public:
|
|||
u32 char_code_to_code_point(u16 char_code) const override;
|
||||
float get_char_width(u16 char_code) const override;
|
||||
|
||||
void draw_glyph(Gfx::Painter&, Gfx::IntPoint const&, float, u32, Color) override {};
|
||||
void draw_glyph(Gfx::Painter&, Gfx::IntPoint, float, u32, Color) override {};
|
||||
|
||||
Type type() const override { return PDFFont::Type::Type0; }
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ float Type1Font::get_char_width(u16 char_code) const
|
|||
return static_cast<float>(width) / 1000.0f;
|
||||
}
|
||||
|
||||
void Type1Font::draw_glyph(Gfx::Painter& painter, Gfx::IntPoint const& point, float width, u32 char_code, Color color)
|
||||
void Type1Font::draw_glyph(Gfx::Painter& painter, Gfx::IntPoint point, float width, u32 char_code, Color color)
|
||||
{
|
||||
if (!m_data.font_program)
|
||||
return;
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
u32 char_code_to_code_point(u16 char_code) const override;
|
||||
float get_char_width(u16 char_code) const override;
|
||||
|
||||
void draw_glyph(Gfx::Painter& painter, Gfx::IntPoint const& point, float width, u32 char_code, Color color) override;
|
||||
void draw_glyph(Gfx::Painter& painter, Gfx::IntPoint point, float width, u32 char_code, Color color) override;
|
||||
|
||||
Type type() const override { return PDFFont::Type::Type1; }
|
||||
|
||||
|
|
|
@ -591,7 +591,7 @@ bool TerminalWidget::selection_contains(const VT::Position& position) const
|
|||
return position >= normalized_selection.start() && position <= normalized_selection.end();
|
||||
}
|
||||
|
||||
VT::Position TerminalWidget::buffer_position_at(Gfx::IntPoint const& position) const
|
||||
VT::Position TerminalWidget::buffer_position_at(Gfx::IntPoint position) const
|
||||
{
|
||||
auto adjusted_position = position.translated(-(frame_thickness() + m_inset), -(frame_thickness() + m_inset));
|
||||
int row = adjusted_position.y() / m_line_height;
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
DeprecatedString selected_text() const;
|
||||
VT::Range normalized_selection() const { return m_selection.normalized(); }
|
||||
void set_selection(const VT::Range& selection);
|
||||
VT::Position buffer_position_at(Gfx::IntPoint const&) const;
|
||||
VT::Position buffer_position_at(Gfx::IntPoint) const;
|
||||
|
||||
VT::Range find_next(StringView, const VT::Position& start = {}, bool case_sensitivity = false, bool should_wrap = false);
|
||||
VT::Range find_previous(StringView, const VT::Position& start = {}, bool case_sensitivity = false, bool should_wrap = false);
|
||||
|
|
|
@ -383,7 +383,7 @@ void BrowsingContext::set_needs_display(Gfx::IntRect const& rect)
|
|||
container()->layout_node()->set_needs_display();
|
||||
}
|
||||
|
||||
void BrowsingContext::scroll_to(Gfx::IntPoint const& position)
|
||||
void BrowsingContext::scroll_to(Gfx::IntPoint position)
|
||||
{
|
||||
if (active_document())
|
||||
active_document()->force_layout();
|
||||
|
@ -437,7 +437,7 @@ Gfx::IntRect BrowsingContext::to_top_level_rect(Gfx::IntRect const& a_rect)
|
|||
return rect;
|
||||
}
|
||||
|
||||
Gfx::IntPoint BrowsingContext::to_top_level_position(Gfx::IntPoint const& a_position)
|
||||
Gfx::IntPoint BrowsingContext::to_top_level_position(Gfx::IntPoint a_position)
|
||||
{
|
||||
auto position = a_position;
|
||||
for (auto ancestor = parent(); ancestor; ancestor = ancestor->parent()) {
|
||||
|
|
|
@ -140,7 +140,7 @@ public:
|
|||
void set_needs_display();
|
||||
void set_needs_display(Gfx::IntRect const&);
|
||||
|
||||
Gfx::IntPoint const& viewport_scroll_offset() const { return m_viewport_scroll_offset; }
|
||||
Gfx::IntPoint viewport_scroll_offset() const { return m_viewport_scroll_offset; }
|
||||
Gfx::IntRect viewport_rect() const { return { m_viewport_scroll_offset, m_size }; }
|
||||
void set_viewport_rect(Gfx::IntRect const&);
|
||||
|
||||
|
@ -150,7 +150,7 @@ public:
|
|||
Web::EventHandler& event_handler() { return m_event_handler; }
|
||||
Web::EventHandler const& event_handler() const { return m_event_handler; }
|
||||
|
||||
void scroll_to(Gfx::IntPoint const&);
|
||||
void scroll_to(Gfx::IntPoint);
|
||||
void scroll_to_anchor(DeprecatedString const&);
|
||||
|
||||
BrowsingContext& top_level_browsing_context()
|
||||
|
@ -183,7 +183,7 @@ public:
|
|||
HTML::BrowsingContextContainer* container() { return m_container; }
|
||||
HTML::BrowsingContextContainer const* container() const { return m_container; }
|
||||
|
||||
Gfx::IntPoint to_top_level_position(Gfx::IntPoint const&);
|
||||
Gfx::IntPoint to_top_level_position(Gfx::IntPoint);
|
||||
Gfx::IntRect to_top_level_rect(Gfx::IntRect const&);
|
||||
|
||||
DOM::Position const& cursor_position() const { return m_cursor_position; }
|
||||
|
|
|
@ -22,7 +22,7 @@ Label::Label(DOM::Document& document, HTML::HTMLLabelElement* element, NonnullRe
|
|||
|
||||
Label::~Label() = default;
|
||||
|
||||
void Label::handle_mousedown_on_label(Badge<Painting::TextPaintable>, Gfx::IntPoint const&, unsigned button)
|
||||
void Label::handle_mousedown_on_label(Badge<Painting::TextPaintable>, Gfx::IntPoint, unsigned button)
|
||||
{
|
||||
if (button != GUI::MouseButton::Primary)
|
||||
return;
|
||||
|
@ -33,7 +33,7 @@ void Label::handle_mousedown_on_label(Badge<Painting::TextPaintable>, Gfx::IntPo
|
|||
m_tracking_mouse = true;
|
||||
}
|
||||
|
||||
void Label::handle_mouseup_on_label(Badge<Painting::TextPaintable>, Gfx::IntPoint const& position, unsigned button)
|
||||
void Label::handle_mouseup_on_label(Badge<Painting::TextPaintable>, Gfx::IntPoint position, unsigned button)
|
||||
{
|
||||
if (!m_tracking_mouse || button != GUI::MouseButton::Primary)
|
||||
return;
|
||||
|
@ -49,7 +49,7 @@ void Label::handle_mouseup_on_label(Badge<Painting::TextPaintable>, Gfx::IntPoin
|
|||
m_tracking_mouse = false;
|
||||
}
|
||||
|
||||
void Label::handle_mousemove_on_label(Badge<Painting::TextPaintable>, Gfx::IntPoint const& position, unsigned)
|
||||
void Label::handle_mousemove_on_label(Badge<Painting::TextPaintable>, Gfx::IntPoint position, unsigned)
|
||||
{
|
||||
if (!m_tracking_mouse)
|
||||
return;
|
||||
|
@ -62,7 +62,7 @@ void Label::handle_mousemove_on_label(Badge<Painting::TextPaintable>, Gfx::IntPo
|
|||
}
|
||||
}
|
||||
|
||||
bool Label::is_inside_associated_label(LabelableNode const& control, Gfx::IntPoint const& position)
|
||||
bool Label::is_inside_associated_label(LabelableNode const& control, Gfx::IntPoint position)
|
||||
{
|
||||
if (auto* label = label_for_control_node(control); label)
|
||||
return enclosing_int_rect(label->paint_box()->absolute_rect()).contains(position);
|
||||
|
|
|
@ -18,15 +18,15 @@ public:
|
|||
Label(DOM::Document&, HTML::HTMLLabelElement*, NonnullRefPtr<CSS::StyleProperties>);
|
||||
virtual ~Label() override;
|
||||
|
||||
static bool is_inside_associated_label(LabelableNode const&, Gfx::IntPoint const&);
|
||||
static bool is_inside_associated_label(LabelableNode const&, Gfx::IntPoint);
|
||||
static bool is_associated_label_hovered(LabelableNode const&);
|
||||
|
||||
const HTML::HTMLLabelElement& dom_node() const { return static_cast<const HTML::HTMLLabelElement&>(*BlockContainer::dom_node()); }
|
||||
HTML::HTMLLabelElement& dom_node() { return static_cast<HTML::HTMLLabelElement&>(*BlockContainer::dom_node()); }
|
||||
|
||||
void handle_mousedown_on_label(Badge<Painting::TextPaintable>, Gfx::IntPoint const&, unsigned button);
|
||||
void handle_mouseup_on_label(Badge<Painting::TextPaintable>, Gfx::IntPoint const&, unsigned button);
|
||||
void handle_mousemove_on_label(Badge<Painting::TextPaintable>, Gfx::IntPoint const&, unsigned button);
|
||||
void handle_mousedown_on_label(Badge<Painting::TextPaintable>, Gfx::IntPoint, unsigned button);
|
||||
void handle_mouseup_on_label(Badge<Painting::TextPaintable>, Gfx::IntPoint, unsigned button);
|
||||
void handle_mousemove_on_label(Badge<Painting::TextPaintable>, Gfx::IntPoint, unsigned button);
|
||||
|
||||
LabelableNode* labeled_control();
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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&) { }
|
||||
|
|
|
@ -355,7 +355,7 @@ void paint_all_borders(PaintContext& context, Gfx::FloatRect const& bordered_rec
|
|||
|
||||
// TODO: Support dual color corners. Other browsers will render a rounded corner between two borders of
|
||||
// different colors using both colours, normally split at a 45 degree angle (though the exact angle is interpolated).
|
||||
auto blit_corner = [&](Gfx::IntPoint const& position, Gfx::IntRect const& src_rect, Color corner_color) {
|
||||
auto blit_corner = [&](Gfx::IntPoint position, Gfx::IntRect const& src_rect, Color corner_color) {
|
||||
context.painter().blit_filtered(position, *corner_bitmap, src_rect, [&](auto const& corner_pixel) {
|
||||
return corner_color.with_alpha((corner_color.alpha() * corner_pixel.alpha()) / 255);
|
||||
});
|
||||
|
|
|
@ -35,7 +35,7 @@ Layout::FormAssociatedLabelableNode& LabelablePaintable::layout_box()
|
|||
return static_cast<Layout::FormAssociatedLabelableNode&>(PaintableBox::layout_box());
|
||||
}
|
||||
|
||||
LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousedown(Badge<EventHandler>, Gfx::IntPoint const&, unsigned button, unsigned)
|
||||
LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousedown(Badge<EventHandler>, Gfx::IntPoint, unsigned button, unsigned)
|
||||
{
|
||||
if (button != GUI::MouseButton::Primary || !layout_box().dom_node().enabled())
|
||||
return DispatchEventOfSameName::No;
|
||||
|
@ -46,7 +46,7 @@ LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousedown
|
|||
return DispatchEventOfSameName::Yes;
|
||||
}
|
||||
|
||||
LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mouseup(Badge<EventHandler>, Gfx::IntPoint const& position, unsigned button, unsigned)
|
||||
LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mouseup(Badge<EventHandler>, Gfx::IntPoint position, unsigned button, unsigned)
|
||||
{
|
||||
if (!m_tracking_mouse || button != GUI::MouseButton::Primary || !layout_box().dom_node().enabled())
|
||||
return DispatchEventOfSameName::No;
|
||||
|
@ -61,7 +61,7 @@ LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mouseup(B
|
|||
return DispatchEventOfSameName::Yes;
|
||||
}
|
||||
|
||||
LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousemove(Badge<EventHandler>, Gfx::IntPoint const& position, unsigned, unsigned)
|
||||
LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousemove(Badge<EventHandler>, Gfx::IntPoint position, unsigned, unsigned)
|
||||
{
|
||||
if (!m_tracking_mouse || !layout_box().dom_node().enabled())
|
||||
return DispatchEventOfSameName::No;
|
||||
|
|
|
@ -21,9 +21,9 @@ public:
|
|||
Layout::FormAssociatedLabelableNode& layout_box();
|
||||
|
||||
virtual bool wants_mouse_events() const override { return true; }
|
||||
virtual DispatchEventOfSameName handle_mousedown(Badge<EventHandler>, Gfx::IntPoint const&, unsigned button, unsigned modifiers) override;
|
||||
virtual DispatchEventOfSameName handle_mouseup(Badge<EventHandler>, Gfx::IntPoint const&, unsigned button, unsigned modifiers) override;
|
||||
virtual DispatchEventOfSameName handle_mousemove(Badge<EventHandler>, Gfx::IntPoint const&, unsigned buttons, unsigned modifiers) override;
|
||||
virtual DispatchEventOfSameName handle_mousedown(Badge<EventHandler>, Gfx::IntPoint, unsigned button, unsigned modifiers) override;
|
||||
virtual DispatchEventOfSameName handle_mouseup(Badge<EventHandler>, Gfx::IntPoint, unsigned button, unsigned modifiers) override;
|
||||
virtual DispatchEventOfSameName handle_mousemove(Badge<EventHandler>, Gfx::IntPoint, unsigned buttons, unsigned modifiers) override;
|
||||
|
||||
void handle_associated_label_mousedown(Badge<Layout::Label>);
|
||||
void handle_associated_label_mouseup(Badge<Layout::Label>);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
PaintContext::PaintContext(Gfx::Painter& painter, Palette const& palette, Gfx::IntPoint const& scroll_offset)
|
||||
PaintContext::PaintContext(Gfx::Painter& painter, Palette const& palette, Gfx::IntPoint scroll_offset)
|
||||
: m_painter(painter)
|
||||
, m_palette(palette)
|
||||
, m_scroll_offset(scroll_offset)
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Web {
|
|||
|
||||
class PaintContext {
|
||||
public:
|
||||
PaintContext(Gfx::Painter& painter, Palette const& palette, Gfx::IntPoint const& scroll_offset);
|
||||
PaintContext(Gfx::Painter& painter, Palette const& palette, Gfx::IntPoint scroll_offset);
|
||||
|
||||
Gfx::Painter& painter() const { return m_painter; }
|
||||
Palette const& palette() const { return m_palette; }
|
||||
|
|
|
@ -10,22 +10,22 @@
|
|||
|
||||
namespace Web::Painting {
|
||||
|
||||
Paintable::DispatchEventOfSameName Paintable::handle_mousedown(Badge<EventHandler>, Gfx::IntPoint const&, unsigned, unsigned)
|
||||
Paintable::DispatchEventOfSameName Paintable::handle_mousedown(Badge<EventHandler>, Gfx::IntPoint, unsigned, unsigned)
|
||||
{
|
||||
return DispatchEventOfSameName::Yes;
|
||||
}
|
||||
|
||||
Paintable::DispatchEventOfSameName Paintable::handle_mouseup(Badge<EventHandler>, Gfx::IntPoint const&, unsigned, unsigned)
|
||||
Paintable::DispatchEventOfSameName Paintable::handle_mouseup(Badge<EventHandler>, Gfx::IntPoint, unsigned, unsigned)
|
||||
{
|
||||
return DispatchEventOfSameName::Yes;
|
||||
}
|
||||
|
||||
Paintable::DispatchEventOfSameName Paintable::handle_mousemove(Badge<EventHandler>, Gfx::IntPoint const&, unsigned, unsigned)
|
||||
Paintable::DispatchEventOfSameName Paintable::handle_mousemove(Badge<EventHandler>, Gfx::IntPoint, unsigned, unsigned)
|
||||
{
|
||||
return DispatchEventOfSameName::Yes;
|
||||
}
|
||||
|
||||
bool Paintable::handle_mousewheel(Badge<EventHandler>, Gfx::IntPoint const&, unsigned, unsigned, int wheel_delta_x, int wheel_delta_y)
|
||||
bool Paintable::handle_mousewheel(Badge<EventHandler>, Gfx::IntPoint, unsigned, unsigned, int wheel_delta_x, int wheel_delta_y)
|
||||
{
|
||||
if (auto* containing_block = this->containing_block()) {
|
||||
if (!containing_block->is_scrollable())
|
||||
|
|
|
@ -100,12 +100,12 @@ public:
|
|||
// When these methods return true, the DOM event with the same name will be
|
||||
// dispatch at the mouse_event_target if it returns a valid DOM::Node, or
|
||||
// the layout node's associated DOM node if it doesn't.
|
||||
virtual DispatchEventOfSameName handle_mousedown(Badge<EventHandler>, Gfx::IntPoint const&, unsigned button, unsigned modifiers);
|
||||
virtual DispatchEventOfSameName handle_mouseup(Badge<EventHandler>, Gfx::IntPoint const&, unsigned button, unsigned modifiers);
|
||||
virtual DispatchEventOfSameName handle_mousemove(Badge<EventHandler>, Gfx::IntPoint const&, unsigned buttons, unsigned modifiers);
|
||||
virtual DispatchEventOfSameName handle_mousedown(Badge<EventHandler>, Gfx::IntPoint, unsigned button, unsigned modifiers);
|
||||
virtual DispatchEventOfSameName handle_mouseup(Badge<EventHandler>, Gfx::IntPoint, unsigned button, unsigned modifiers);
|
||||
virtual DispatchEventOfSameName handle_mousemove(Badge<EventHandler>, Gfx::IntPoint, unsigned buttons, unsigned modifiers);
|
||||
virtual DOM::Node* mouse_event_target() const { return nullptr; }
|
||||
|
||||
virtual bool handle_mousewheel(Badge<EventHandler>, Gfx::IntPoint const&, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y);
|
||||
virtual bool handle_mousewheel(Badge<EventHandler>, Gfx::IntPoint, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y);
|
||||
|
||||
Layout::Node const& layout_node() const { return m_layout_node; }
|
||||
Layout::Node& layout_node() { return const_cast<Layout::Node&>(m_layout_node); }
|
||||
|
|
|
@ -630,7 +630,7 @@ void PaintableWithLines::paint(PaintContext& context, PaintPhase phase) const
|
|||
}
|
||||
}
|
||||
|
||||
bool PaintableWithLines::handle_mousewheel(Badge<EventHandler>, Gfx::IntPoint const&, unsigned, unsigned, int wheel_delta_x, int wheel_delta_y)
|
||||
bool PaintableWithLines::handle_mousewheel(Badge<EventHandler>, Gfx::IntPoint, unsigned, unsigned, int wheel_delta_x, int wheel_delta_y)
|
||||
{
|
||||
if (!layout_box().is_scrollable())
|
||||
return false;
|
||||
|
|
|
@ -188,7 +188,7 @@ public:
|
|||
|
||||
virtual void paint(PaintContext&, PaintPhase) const override;
|
||||
virtual bool wants_mouse_events() const override { return false; }
|
||||
virtual bool handle_mousewheel(Badge<EventHandler>, Gfx::IntPoint const&, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y) override;
|
||||
virtual bool handle_mousewheel(Badge<EventHandler>, Gfx::IntPoint, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y) override;
|
||||
|
||||
virtual Optional<HitTestResult> hit_test(Gfx::FloatPoint const&, HitTestType) const override;
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ DOM::Node* TextPaintable::mouse_event_target() const
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
TextPaintable::DispatchEventOfSameName TextPaintable::handle_mousedown(Badge<EventHandler>, Gfx::IntPoint const& position, unsigned button, unsigned)
|
||||
TextPaintable::DispatchEventOfSameName TextPaintable::handle_mousedown(Badge<EventHandler>, Gfx::IntPoint position, unsigned button, unsigned)
|
||||
{
|
||||
auto* label = layout_node().first_ancestor_of_type<Layout::Label>();
|
||||
if (!label)
|
||||
|
@ -46,7 +46,7 @@ TextPaintable::DispatchEventOfSameName TextPaintable::handle_mousedown(Badge<Eve
|
|||
return DispatchEventOfSameName::Yes;
|
||||
}
|
||||
|
||||
TextPaintable::DispatchEventOfSameName TextPaintable::handle_mouseup(Badge<EventHandler>, Gfx::IntPoint const& position, unsigned button, unsigned)
|
||||
TextPaintable::DispatchEventOfSameName TextPaintable::handle_mouseup(Badge<EventHandler>, Gfx::IntPoint position, unsigned button, unsigned)
|
||||
{
|
||||
auto* label = layout_node().first_ancestor_of_type<Layout::Label>();
|
||||
if (!label)
|
||||
|
@ -57,7 +57,7 @@ TextPaintable::DispatchEventOfSameName TextPaintable::handle_mouseup(Badge<Event
|
|||
return DispatchEventOfSameName::Yes;
|
||||
}
|
||||
|
||||
TextPaintable::DispatchEventOfSameName TextPaintable::handle_mousemove(Badge<EventHandler>, Gfx::IntPoint const& position, unsigned button, unsigned)
|
||||
TextPaintable::DispatchEventOfSameName TextPaintable::handle_mousemove(Badge<EventHandler>, Gfx::IntPoint position, unsigned button, unsigned)
|
||||
{
|
||||
auto* label = layout_node().first_ancestor_of_type<Layout::Label>();
|
||||
if (!label)
|
||||
|
|
|
@ -18,9 +18,9 @@ public:
|
|||
|
||||
virtual bool wants_mouse_events() const override;
|
||||
virtual DOM::Node* mouse_event_target() const override;
|
||||
virtual DispatchEventOfSameName handle_mousedown(Badge<EventHandler>, Gfx::IntPoint const&, unsigned button, unsigned modifiers) override;
|
||||
virtual DispatchEventOfSameName handle_mouseup(Badge<EventHandler>, Gfx::IntPoint const&, unsigned button, unsigned modifiers) override;
|
||||
virtual DispatchEventOfSameName handle_mousemove(Badge<EventHandler>, Gfx::IntPoint const&, unsigned button, unsigned modifiers) override;
|
||||
virtual DispatchEventOfSameName handle_mousedown(Badge<EventHandler>, Gfx::IntPoint, unsigned button, unsigned modifiers) override;
|
||||
virtual DispatchEventOfSameName handle_mouseup(Badge<EventHandler>, Gfx::IntPoint, unsigned button, unsigned modifiers) override;
|
||||
virtual DispatchEventOfSameName handle_mousemove(Badge<EventHandler>, Gfx::IntPoint, unsigned button, unsigned modifiers) override;
|
||||
|
||||
private:
|
||||
explicit TextPaintable(Layout::TextNode const&);
|
||||
|
|
|
@ -252,7 +252,7 @@ void OutOfProcessWebView::notify_server_did_request_scroll(Badge<WebContentClien
|
|||
vertical_scrollbar().increase_slider_by(y_delta);
|
||||
}
|
||||
|
||||
void OutOfProcessWebView::notify_server_did_request_scroll_to(Badge<WebContentClient>, Gfx::IntPoint const& scroll_position)
|
||||
void OutOfProcessWebView::notify_server_did_request_scroll_to(Badge<WebContentClient>, Gfx::IntPoint scroll_position)
|
||||
{
|
||||
horizontal_scrollbar().set_value(scroll_position.x());
|
||||
vertical_scrollbar().set_value(scroll_position.y());
|
||||
|
@ -263,7 +263,7 @@ void OutOfProcessWebView::notify_server_did_request_scroll_into_view(Badge<WebCo
|
|||
scroll_into_view(rect, true, true);
|
||||
}
|
||||
|
||||
void OutOfProcessWebView::notify_server_did_enter_tooltip_area(Badge<WebContentClient>, Gfx::IntPoint const&, DeprecatedString const& title)
|
||||
void OutOfProcessWebView::notify_server_did_enter_tooltip_area(Badge<WebContentClient>, Gfx::IntPoint, DeprecatedString const& title)
|
||||
{
|
||||
GUI::Application::the()->show_tooltip(title, nullptr);
|
||||
}
|
||||
|
@ -330,19 +330,19 @@ void OutOfProcessWebView::notify_server_did_request_refresh(Badge<WebContentClie
|
|||
on_refresh();
|
||||
}
|
||||
|
||||
void OutOfProcessWebView::notify_server_did_request_context_menu(Badge<WebContentClient>, Gfx::IntPoint const& content_position)
|
||||
void OutOfProcessWebView::notify_server_did_request_context_menu(Badge<WebContentClient>, Gfx::IntPoint content_position)
|
||||
{
|
||||
if (on_context_menu_request)
|
||||
on_context_menu_request(screen_relative_rect().location().translated(to_widget_position(content_position)));
|
||||
}
|
||||
|
||||
void OutOfProcessWebView::notify_server_did_request_link_context_menu(Badge<WebContentClient>, Gfx::IntPoint const& content_position, const AK::URL& url, DeprecatedString const&, unsigned)
|
||||
void OutOfProcessWebView::notify_server_did_request_link_context_menu(Badge<WebContentClient>, Gfx::IntPoint content_position, const AK::URL& url, DeprecatedString const&, unsigned)
|
||||
{
|
||||
if (on_link_context_menu_request)
|
||||
on_link_context_menu_request(url, screen_relative_rect().location().translated(to_widget_position(content_position)));
|
||||
}
|
||||
|
||||
void OutOfProcessWebView::notify_server_did_request_image_context_menu(Badge<WebContentClient>, Gfx::IntPoint const& content_position, const AK::URL& url, DeprecatedString const&, unsigned, Gfx::ShareableBitmap const& bitmap)
|
||||
void OutOfProcessWebView::notify_server_did_request_image_context_menu(Badge<WebContentClient>, Gfx::IntPoint content_position, const AK::URL& url, DeprecatedString const&, unsigned, Gfx::ShareableBitmap const& bitmap)
|
||||
{
|
||||
if (on_image_context_menu_request)
|
||||
on_image_context_menu_request(url, screen_relative_rect().location().translated(to_widget_position(content_position)), bitmap);
|
||||
|
@ -479,7 +479,7 @@ void OutOfProcessWebView::notify_server_did_request_restore_window()
|
|||
on_restore_window();
|
||||
}
|
||||
|
||||
Gfx::IntPoint OutOfProcessWebView::notify_server_did_request_reposition_window(Gfx::IntPoint const& position)
|
||||
Gfx::IntPoint OutOfProcessWebView::notify_server_did_request_reposition_window(Gfx::IntPoint position)
|
||||
{
|
||||
if (on_reposition_window)
|
||||
return on_reposition_window(position);
|
||||
|
@ -648,7 +648,7 @@ void OutOfProcessWebView::connect_to_webdriver(DeprecatedString const& webdriver
|
|||
client().async_connect_to_webdriver(webdriver_ipc_path);
|
||||
}
|
||||
|
||||
void OutOfProcessWebView::set_window_position(Gfx::IntPoint const& position)
|
||||
void OutOfProcessWebView::set_window_position(Gfx::IntPoint position)
|
||||
{
|
||||
client().async_set_window_position(position);
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ public:
|
|||
void set_preferred_color_scheme(Web::CSS::PreferredColorScheme);
|
||||
void connect_to_webdriver(DeprecatedString const& webdriver_ipc_path);
|
||||
|
||||
void set_window_position(Gfx::IntPoint const&);
|
||||
void set_window_position(Gfx::IntPoint);
|
||||
void set_window_size(Gfx::IntSize const&);
|
||||
|
||||
void set_system_visibility_state(bool visible);
|
||||
|
@ -79,10 +79,10 @@ public:
|
|||
Gfx::ShareableBitmap take_screenshot() const;
|
||||
Gfx::ShareableBitmap take_document_screenshot();
|
||||
|
||||
Function<void(Gfx::IntPoint const& screen_position)> on_context_menu_request;
|
||||
Function<void(Gfx::IntPoint screen_position)> on_context_menu_request;
|
||||
Function<void(const AK::URL&, DeprecatedString const& target, unsigned modifiers)> on_link_click;
|
||||
Function<void(const AK::URL&, Gfx::IntPoint const& screen_position)> on_link_context_menu_request;
|
||||
Function<void(const AK::URL&, Gfx::IntPoint const& screen_position, Gfx::ShareableBitmap const&)> on_image_context_menu_request;
|
||||
Function<void(const AK::URL&, Gfx::IntPoint screen_position)> on_link_context_menu_request;
|
||||
Function<void(const AK::URL&, Gfx::IntPoint screen_position, Gfx::ShareableBitmap const&)> on_image_context_menu_request;
|
||||
Function<void(const AK::URL&, DeprecatedString const& target, unsigned modifiers)> on_link_middle_click;
|
||||
Function<void(const AK::URL&)> on_link_hover;
|
||||
Function<void(DeprecatedString const&)> on_title_change;
|
||||
|
@ -106,7 +106,7 @@ public:
|
|||
Function<void(AK::URL const& url, Web::Cookie::Cookie const& cookie)> on_update_cookie;
|
||||
Function<void(i32 count_waiting)> on_resource_status_change;
|
||||
Function<void()> on_restore_window;
|
||||
Function<Gfx::IntPoint(Gfx::IntPoint const&)> on_reposition_window;
|
||||
Function<Gfx::IntPoint(Gfx::IntPoint)> on_reposition_window;
|
||||
Function<Gfx::IntSize(Gfx::IntSize const&)> on_resize_window;
|
||||
Function<Gfx::IntRect()> on_maximize_window;
|
||||
Function<Gfx::IntRect()> on_minimize_window;
|
||||
|
@ -143,9 +143,9 @@ private:
|
|||
virtual void notify_server_did_request_cursor_change(Badge<WebContentClient>, Gfx::StandardCursor cursor) override;
|
||||
virtual void notify_server_did_change_title(Badge<WebContentClient>, DeprecatedString const&) override;
|
||||
virtual void notify_server_did_request_scroll(Badge<WebContentClient>, i32, i32) override;
|
||||
virtual void notify_server_did_request_scroll_to(Badge<WebContentClient>, Gfx::IntPoint const&) override;
|
||||
virtual void notify_server_did_request_scroll_to(Badge<WebContentClient>, Gfx::IntPoint) override;
|
||||
virtual void notify_server_did_request_scroll_into_view(Badge<WebContentClient>, Gfx::IntRect const&) override;
|
||||
virtual void notify_server_did_enter_tooltip_area(Badge<WebContentClient>, Gfx::IntPoint const&, DeprecatedString const&) override;
|
||||
virtual void notify_server_did_enter_tooltip_area(Badge<WebContentClient>, Gfx::IntPoint, DeprecatedString const&) override;
|
||||
virtual void notify_server_did_leave_tooltip_area(Badge<WebContentClient>) override;
|
||||
virtual void notify_server_did_hover_link(Badge<WebContentClient>, const AK::URL&) override;
|
||||
virtual void notify_server_did_unhover_link(Badge<WebContentClient>) override;
|
||||
|
@ -156,9 +156,9 @@ private:
|
|||
virtual void notify_server_did_request_navigate_back(Badge<WebContentClient>) override;
|
||||
virtual void notify_server_did_request_navigate_forward(Badge<WebContentClient>) override;
|
||||
virtual void notify_server_did_request_refresh(Badge<WebContentClient>) override;
|
||||
virtual void notify_server_did_request_context_menu(Badge<WebContentClient>, Gfx::IntPoint const&) override;
|
||||
virtual void notify_server_did_request_link_context_menu(Badge<WebContentClient>, Gfx::IntPoint const&, const AK::URL&, DeprecatedString const& target, unsigned modifiers) override;
|
||||
virtual void notify_server_did_request_image_context_menu(Badge<WebContentClient>, Gfx::IntPoint const&, const AK::URL&, DeprecatedString const& target, unsigned modifiers, Gfx::ShareableBitmap const&) override;
|
||||
virtual void notify_server_did_request_context_menu(Badge<WebContentClient>, Gfx::IntPoint) override;
|
||||
virtual void notify_server_did_request_link_context_menu(Badge<WebContentClient>, Gfx::IntPoint, const AK::URL&, DeprecatedString const& target, unsigned modifiers) override;
|
||||
virtual void notify_server_did_request_image_context_menu(Badge<WebContentClient>, Gfx::IntPoint, const AK::URL&, DeprecatedString const& target, unsigned modifiers, Gfx::ShareableBitmap const&) override;
|
||||
virtual void notify_server_did_request_alert(Badge<WebContentClient>, DeprecatedString const& message) override;
|
||||
virtual void notify_server_did_request_confirm(Badge<WebContentClient>, DeprecatedString const& message) override;
|
||||
virtual void notify_server_did_request_prompt(Badge<WebContentClient>, DeprecatedString const& message, DeprecatedString const& default_) override;
|
||||
|
@ -178,7 +178,7 @@ private:
|
|||
virtual void notify_server_did_update_cookie(Badge<WebContentClient>, AK::URL const& url, Web::Cookie::Cookie const& cookie) override;
|
||||
virtual void notify_server_did_update_resource_count(i32 count_waiting) override;
|
||||
virtual void notify_server_did_request_restore_window() override;
|
||||
virtual Gfx::IntPoint notify_server_did_request_reposition_window(Gfx::IntPoint const&) override;
|
||||
virtual Gfx::IntPoint notify_server_did_request_reposition_window(Gfx::IntPoint) override;
|
||||
virtual Gfx::IntSize notify_server_did_request_resize_window(Gfx::IntSize const&) override;
|
||||
virtual Gfx::IntRect notify_server_did_request_maximize_window() override;
|
||||
virtual Gfx::IntRect notify_server_did_request_minimize_window() override;
|
||||
|
|
|
@ -25,9 +25,9 @@ public:
|
|||
virtual void notify_server_did_request_cursor_change(Badge<WebContentClient>, Gfx::StandardCursor cursor) = 0;
|
||||
virtual void notify_server_did_change_title(Badge<WebContentClient>, DeprecatedString const&) = 0;
|
||||
virtual void notify_server_did_request_scroll(Badge<WebContentClient>, i32, i32) = 0;
|
||||
virtual void notify_server_did_request_scroll_to(Badge<WebContentClient>, Gfx::IntPoint const&) = 0;
|
||||
virtual void notify_server_did_request_scroll_to(Badge<WebContentClient>, Gfx::IntPoint) = 0;
|
||||
virtual void notify_server_did_request_scroll_into_view(Badge<WebContentClient>, Gfx::IntRect const&) = 0;
|
||||
virtual void notify_server_did_enter_tooltip_area(Badge<WebContentClient>, Gfx::IntPoint const&, DeprecatedString const&) = 0;
|
||||
virtual void notify_server_did_enter_tooltip_area(Badge<WebContentClient>, Gfx::IntPoint, DeprecatedString const&) = 0;
|
||||
virtual void notify_server_did_leave_tooltip_area(Badge<WebContentClient>) = 0;
|
||||
virtual void notify_server_did_hover_link(Badge<WebContentClient>, const AK::URL&) = 0;
|
||||
virtual void notify_server_did_unhover_link(Badge<WebContentClient>) = 0;
|
||||
|
@ -38,9 +38,9 @@ public:
|
|||
virtual void notify_server_did_request_navigate_back(Badge<WebContentClient>) = 0;
|
||||
virtual void notify_server_did_request_navigate_forward(Badge<WebContentClient>) = 0;
|
||||
virtual void notify_server_did_request_refresh(Badge<WebContentClient>) = 0;
|
||||
virtual void notify_server_did_request_context_menu(Badge<WebContentClient>, Gfx::IntPoint const&) = 0;
|
||||
virtual void notify_server_did_request_link_context_menu(Badge<WebContentClient>, Gfx::IntPoint const&, const AK::URL&, DeprecatedString const& target, unsigned modifiers) = 0;
|
||||
virtual void notify_server_did_request_image_context_menu(Badge<WebContentClient>, Gfx::IntPoint const&, const AK::URL&, DeprecatedString const& target, unsigned modifiers, Gfx::ShareableBitmap const&) = 0;
|
||||
virtual void notify_server_did_request_context_menu(Badge<WebContentClient>, Gfx::IntPoint) = 0;
|
||||
virtual void notify_server_did_request_link_context_menu(Badge<WebContentClient>, Gfx::IntPoint, const AK::URL&, DeprecatedString const& target, unsigned modifiers) = 0;
|
||||
virtual void notify_server_did_request_image_context_menu(Badge<WebContentClient>, Gfx::IntPoint, const AK::URL&, DeprecatedString const& target, unsigned modifiers, Gfx::ShareableBitmap const&) = 0;
|
||||
virtual void notify_server_did_request_alert(Badge<WebContentClient>, DeprecatedString const& message) = 0;
|
||||
virtual void notify_server_did_request_confirm(Badge<WebContentClient>, DeprecatedString const& message) = 0;
|
||||
virtual void notify_server_did_request_prompt(Badge<WebContentClient>, DeprecatedString const& message, DeprecatedString const& default_) = 0;
|
||||
|
@ -60,7 +60,7 @@ public:
|
|||
virtual void notify_server_did_update_cookie(Badge<WebContentClient>, AK::URL const& url, Web::Cookie::Cookie const& cookie) = 0;
|
||||
virtual void notify_server_did_update_resource_count(i32 count_waiting) = 0;
|
||||
virtual void notify_server_did_request_restore_window() = 0;
|
||||
virtual Gfx::IntPoint notify_server_did_request_reposition_window(Gfx::IntPoint const&) = 0;
|
||||
virtual Gfx::IntPoint notify_server_did_request_reposition_window(Gfx::IntPoint) = 0;
|
||||
virtual Gfx::IntSize notify_server_did_request_resize_window(Gfx::IntSize const&) = 0;
|
||||
virtual Gfx::IntRect notify_server_did_request_maximize_window() = 0;
|
||||
virtual Gfx::IntRect notify_server_did_request_minimize_window() = 0;
|
||||
|
|
|
@ -88,7 +88,7 @@ void WebContentClient::did_request_scroll(i32 x_delta, i32 y_delta)
|
|||
m_view.notify_server_did_request_scroll({}, x_delta, y_delta);
|
||||
}
|
||||
|
||||
void WebContentClient::did_request_scroll_to(Gfx::IntPoint const& scroll_position)
|
||||
void WebContentClient::did_request_scroll_to(Gfx::IntPoint scroll_position)
|
||||
{
|
||||
m_view.notify_server_did_request_scroll_to({}, scroll_position);
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ void WebContentClient::did_request_scroll_into_view(Gfx::IntRect const& rect)
|
|||
m_view.notify_server_did_request_scroll_into_view({}, rect);
|
||||
}
|
||||
|
||||
void WebContentClient::did_enter_tooltip_area(Gfx::IntPoint const& content_position, DeprecatedString const& title)
|
||||
void WebContentClient::did_enter_tooltip_area(Gfx::IntPoint content_position, DeprecatedString const& title)
|
||||
{
|
||||
m_view.notify_server_did_enter_tooltip_area({}, content_position, title);
|
||||
}
|
||||
|
@ -136,17 +136,17 @@ void WebContentClient::did_start_loading(AK::URL const& url, bool is_redirect)
|
|||
m_view.notify_server_did_start_loading({}, url, is_redirect);
|
||||
}
|
||||
|
||||
void WebContentClient::did_request_context_menu(Gfx::IntPoint const& content_position)
|
||||
void WebContentClient::did_request_context_menu(Gfx::IntPoint content_position)
|
||||
{
|
||||
m_view.notify_server_did_request_context_menu({}, content_position);
|
||||
}
|
||||
|
||||
void WebContentClient::did_request_link_context_menu(Gfx::IntPoint const& content_position, AK::URL const& url, DeprecatedString const& target, unsigned modifiers)
|
||||
void WebContentClient::did_request_link_context_menu(Gfx::IntPoint content_position, AK::URL const& url, DeprecatedString const& target, unsigned modifiers)
|
||||
{
|
||||
m_view.notify_server_did_request_link_context_menu({}, content_position, url, target, modifiers);
|
||||
}
|
||||
|
||||
void WebContentClient::did_request_image_context_menu(Gfx::IntPoint const& content_position, AK::URL const& url, DeprecatedString const& target, unsigned modifiers, Gfx::ShareableBitmap const& bitmap)
|
||||
void WebContentClient::did_request_image_context_menu(Gfx::IntPoint content_position, AK::URL const& url, DeprecatedString const& target, unsigned modifiers, Gfx::ShareableBitmap const& bitmap)
|
||||
{
|
||||
m_view.notify_server_did_request_image_context_menu({}, content_position, url, target, modifiers, bitmap);
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ void WebContentClient::did_request_restore_window()
|
|||
m_view.notify_server_did_request_restore_window();
|
||||
}
|
||||
|
||||
Messages::WebContentClient::DidRequestRepositionWindowResponse WebContentClient::did_request_reposition_window(Gfx::IntPoint const& position)
|
||||
Messages::WebContentClient::DidRequestRepositionWindowResponse WebContentClient::did_request_reposition_window(Gfx::IntPoint position)
|
||||
{
|
||||
return m_view.notify_server_did_request_reposition_window(position);
|
||||
}
|
||||
|
|
|
@ -39,18 +39,18 @@ private:
|
|||
virtual void did_layout(Gfx::IntSize const&) override;
|
||||
virtual void did_change_title(DeprecatedString const&) override;
|
||||
virtual void did_request_scroll(i32, i32) override;
|
||||
virtual void did_request_scroll_to(Gfx::IntPoint const&) override;
|
||||
virtual void did_request_scroll_to(Gfx::IntPoint) override;
|
||||
virtual void did_request_scroll_into_view(Gfx::IntRect const&) override;
|
||||
virtual void did_enter_tooltip_area(Gfx::IntPoint const&, DeprecatedString const&) override;
|
||||
virtual void did_enter_tooltip_area(Gfx::IntPoint, DeprecatedString const&) override;
|
||||
virtual void did_leave_tooltip_area() override;
|
||||
virtual void did_hover_link(AK::URL const&) override;
|
||||
virtual void did_unhover_link() override;
|
||||
virtual void did_click_link(AK::URL const&, DeprecatedString const&, unsigned) override;
|
||||
virtual void did_middle_click_link(AK::URL const&, DeprecatedString const&, unsigned) override;
|
||||
virtual void did_start_loading(AK::URL const&, bool) override;
|
||||
virtual void did_request_context_menu(Gfx::IntPoint const&) override;
|
||||
virtual void did_request_link_context_menu(Gfx::IntPoint const&, AK::URL const&, DeprecatedString const&, unsigned) override;
|
||||
virtual void did_request_image_context_menu(Gfx::IntPoint const&, AK::URL const&, DeprecatedString const&, unsigned, Gfx::ShareableBitmap const&) override;
|
||||
virtual void did_request_context_menu(Gfx::IntPoint) override;
|
||||
virtual void did_request_link_context_menu(Gfx::IntPoint, AK::URL const&, DeprecatedString const&, unsigned) override;
|
||||
virtual void did_request_image_context_menu(Gfx::IntPoint, AK::URL const&, DeprecatedString const&, unsigned, Gfx::ShareableBitmap const&) override;
|
||||
virtual void did_get_source(AK::URL const&, DeprecatedString const&) override;
|
||||
virtual void did_get_dom_tree(DeprecatedString const&) override;
|
||||
virtual void did_get_dom_node_properties(i32 node_id, DeprecatedString const& specified_style, DeprecatedString const& computed_style, DeprecatedString const& custom_properties, DeprecatedString const& node_box_sizing) override;
|
||||
|
@ -70,7 +70,7 @@ private:
|
|||
virtual void did_update_cookie(AK::URL const&, Web::Cookie::Cookie const&) override;
|
||||
virtual void did_update_resource_count(i32 count_waiting) override;
|
||||
virtual void did_request_restore_window() override;
|
||||
virtual Messages::WebContentClient::DidRequestRepositionWindowResponse did_request_reposition_window(Gfx::IntPoint const&) override;
|
||||
virtual Messages::WebContentClient::DidRequestRepositionWindowResponse did_request_reposition_window(Gfx::IntPoint) override;
|
||||
virtual Messages::WebContentClient::DidRequestResizeWindowResponse did_request_resize_window(Gfx::IntSize const&) override;
|
||||
virtual Messages::WebContentClient::DidRequestMaximizeWindowResponse did_request_maximize_window() override;
|
||||
virtual Messages::WebContentClient::DidRequestMinimizeWindowResponse did_request_minimize_window() override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue