Meta+Userland: Pass Gfx::IntPoint by value

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

View file

@ -69,7 +69,7 @@ static bool is_primitive_type(DeprecatedString const& type)
static bool is_simple_type(DeprecatedString const& type)
{
// Small types that it makes sense just to pass by value.
return type.is_one_of("Gfx::Color");
return type.is_one_of("Gfx::Color", "Gfx::IntPoint");
}
static bool is_primitive_or_simple_type(DeprecatedString const& type)

View file

@ -690,7 +690,7 @@ void BrowserWindow::config_bool_did_change(DeprecatedString const& domain, Depre
// NOTE: CloseDownloadWidgetOnFinish is read each time in DownloadWindow
}
void BrowserWindow::broadcast_window_position(Gfx::IntPoint const& position)
void BrowserWindow::broadcast_window_position(Gfx::IntPoint position)
{
tab_widget().for_each_child_of_type<Browser::Tab>([&](auto& tab) {
tab.window_position_changed(position);

View file

@ -45,7 +45,7 @@ public:
void content_filters_changed();
void proxy_mappings_changed();
void broadcast_window_position(Gfx::IntPoint const&);
void broadcast_window_position(Gfx::IntPoint);
void broadcast_window_size(Gfx::IntSize const&);
private:

View file

@ -272,7 +272,7 @@ Tab::Tab(BrowserWindow& window)
m_web_content_view->set_system_visibility_state(true);
};
view().on_reposition_window = [this](Gfx::IntPoint const& position) {
view().on_reposition_window = [this](Gfx::IntPoint position) {
this->window().move_to(position);
return this->window().position();
};
@ -318,7 +318,7 @@ Tab::Tab(BrowserWindow& window)
m_link_context_menu->add_separator();
m_link_context_menu->add_action(window.inspect_dom_node_action());
view().on_link_context_menu_request = [this](auto& url, auto& screen_position) {
view().on_link_context_menu_request = [this](auto& url, auto screen_position) {
m_link_context_menu_url = url;
m_link_context_menu->popup(screen_position, m_link_context_menu_default_action);
};
@ -345,7 +345,7 @@ Tab::Tab(BrowserWindow& window)
m_image_context_menu->add_separator();
m_image_context_menu->add_action(window.inspect_dom_node_action());
view().on_image_context_menu_request = [this](auto& image_url, auto& screen_position, Gfx::ShareableBitmap const& shareable_bitmap) {
view().on_image_context_menu_request = [this](auto& image_url, auto screen_position, Gfx::ShareableBitmap const& shareable_bitmap) {
m_image_context_menu_url = image_url;
m_image_context_menu_bitmap = shareable_bitmap;
m_image_context_menu->popup(screen_position);
@ -473,7 +473,7 @@ Tab::Tab(BrowserWindow& window)
m_page_context_menu->add_separator();
m_page_context_menu->add_action(window.take_visible_screenshot_action());
m_page_context_menu->add_action(window.take_full_screenshot_action());
view().on_context_menu_request = [&](auto& screen_position) {
view().on_context_menu_request = [&](auto screen_position) {
m_page_context_menu->popup(screen_position);
};
}
@ -586,7 +586,7 @@ void Tab::did_become_active()
update_actions();
}
void Tab::context_menu_requested(Gfx::IntPoint const& screen_position)
void Tab::context_menu_requested(Gfx::IntPoint screen_position)
{
m_tab_context_menu->popup(screen_position);
}
@ -614,7 +614,7 @@ void Tab::action_left(GUI::Action&)
m_statusbar->set_override_text({});
}
void Tab::window_position_changed(Gfx::IntPoint const& position)
void Tab::window_position_changed(Gfx::IntPoint position)
{
m_web_content_view->set_window_position(position);
}

View file

@ -49,14 +49,14 @@ public:
void go_forward(int steps = 1);
void did_become_active();
void context_menu_requested(Gfx::IntPoint const& screen_position);
void context_menu_requested(Gfx::IntPoint screen_position);
void content_filters_changed();
void proxy_mappings_changed();
void action_entered(GUI::Action&);
void action_left(GUI::Action&);
void window_position_changed(Gfx::IntPoint const&);
void window_position_changed(Gfx::IntPoint);
void window_size_changed(Gfx::IntSize const&);
Function<void(DeprecatedString const&)> on_title_change;

View file

@ -125,7 +125,7 @@ MainWidget::MainWidget()
open_external(url);
}
};
m_web_view->on_context_menu_request = [this](auto& screen_position) {
m_web_view->on_context_menu_request = [this](auto screen_position) {
m_copy_action->set_enabled(!m_web_view->selected_text().is_empty());
m_context_menu->popup(screen_position);
};

View file

@ -71,7 +71,7 @@ MailWidget::MailWidget()
GUI::Clipboard::the().set_plain_text(m_link_context_menu_url.to_deprecated_string());
}));
m_web_view->on_link_context_menu_request = [this](auto& url, auto& screen_position) {
m_web_view->on_link_context_menu_request = [this](auto& url, auto screen_position) {
m_link_context_menu_url = url;
m_link_context_menu->popup(screen_position, m_link_context_menu_default_action);
};
@ -89,7 +89,7 @@ MailWidget::MailWidget()
m_web_view->on_link_click(m_image_context_menu_url, "", 0);
}));
m_web_view->on_image_context_menu_request = [this](auto& image_url, auto& screen_position, Gfx::ShareableBitmap const& shareable_bitmap) {
m_web_view->on_image_context_menu_request = [this](auto& image_url, auto screen_position, Gfx::ShareableBitmap const& shareable_bitmap) {
m_image_context_menu_url = image_url;
m_image_context_menu_bitmap = shareable_bitmap;
m_image_context_menu->popup(screen_position);

View file

@ -214,7 +214,7 @@ static inline int note_from_white_keys(int white_keys)
return note;
}
int KeysWidget::note_for_event_position(Gfx::IntPoint const& a_point) const
int KeysWidget::note_for_event_position(Gfx::IntPoint a_point) const
{
if (!frame_inner_rect().contains(a_point))
return -1;

View file

@ -31,7 +31,7 @@ private:
virtual void mouseup_event(GUI::MouseEvent&) override;
virtual void mousemove_event(GUI::MouseEvent&) override;
int note_for_event_position(Gfx::IntPoint const&) const;
int note_for_event_position(Gfx::IntPoint) const;
void set_key(i8 key, DSP::Keyboard::Switch);

View file

@ -570,7 +570,7 @@ void Image::resize(Gfx::IntSize const& new_size, Gfx::Painter::ScalingMode scali
did_change_rect();
}
Color Image::color_at(Gfx::IntPoint const& point) const
Color Image::color_at(Gfx::IntPoint point) const
{
Color color;
for (auto& layer : m_layers) {

View file

@ -104,7 +104,7 @@ public:
Optional<Gfx::IntRect> nonempty_content_bounding_rect() const;
Color color_at(Gfx::IntPoint const& point) const;
Color color_at(Gfx::IntPoint point) const;
private:
explicit Image(Gfx::IntSize const&);

View file

@ -609,7 +609,7 @@ void ImageEditor::set_secondary_color(Color color)
on_secondary_color_change(color);
}
Layer* ImageEditor::layer_at_editor_position(Gfx::IntPoint const& editor_position)
Layer* ImageEditor::layer_at_editor_position(Gfx::IntPoint editor_position)
{
auto image_position = frame_to_content_position(editor_position);
for (ssize_t i = m_image->layer_count() - 1; i >= 0; --i) {

View file

@ -64,7 +64,7 @@ public:
void layers_did_change();
Layer* layer_at_editor_position(Gfx::IntPoint const&);
Layer* layer_at_editor_position(Gfx::IntPoint);
void fit_image_to_view(FitType type = FitType::Both);
@ -84,7 +84,7 @@ public:
Function<void(DeprecatedString const&)> on_title_change;
Function<void(Gfx::IntPoint const&)> on_image_mouse_position_change;
Function<void(Gfx::IntPoint)> on_image_mouse_position_change;
Function<void(void)> on_leave;
Function<void(bool modified)> on_modified_change;

View file

@ -221,7 +221,7 @@ void Layer::crop(Gfx::IntRect const& rect)
did_modify_bitmap();
}
void Layer::resize(Gfx::IntSize const& new_size, Gfx::IntPoint const& new_location, Gfx::Painter::ScalingMode scaling_mode)
void Layer::resize(Gfx::IntSize const& new_size, Gfx::IntPoint new_location, Gfx::Painter::ScalingMode scaling_mode)
{
auto src_rect = Gfx::IntRect(Gfx::IntPoint(0, 0), size());
auto dst_rect = Gfx::IntRect(Gfx::IntPoint(0, 0), new_size);

View file

@ -35,8 +35,8 @@ public:
~Layer() = default;
Gfx::IntPoint const& location() const { return m_location; }
void set_location(Gfx::IntPoint const& location) { m_location = location; }
Gfx::IntPoint location() const { return m_location; }
void set_location(Gfx::IntPoint location) { m_location = location; }
Gfx::Bitmap const& display_bitmap() const { return m_cached_display_bitmap; }
Gfx::Bitmap const& content_bitmap() const { return m_content_bitmap; }
@ -61,7 +61,7 @@ public:
void crop(Gfx::IntRect const& rect);
void resize(Gfx::IntSize const& new_size, Gfx::Painter::ScalingMode scaling_mode);
void resize(Gfx::IntRect const& new_rect, Gfx::Painter::ScalingMode scaling_mode);
void resize(Gfx::IntSize const& new_size, Gfx::IntPoint const& new_location, Gfx::Painter::ScalingMode scaling_mode);
void resize(Gfx::IntSize const& new_size, Gfx::IntPoint new_location, Gfx::Painter::ScalingMode scaling_mode);
Optional<Gfx::IntRect> nonempty_content_bounding_rect() const;

View file

@ -186,7 +186,7 @@ void LayerListWidget::paint_event(GUI::PaintEvent& event)
Gfx::StylePainter::paint_frame(painter, rect(), palette(), Gfx::FrameShape::Box, Gfx::FrameShadow::Sunken, 2);
}
Optional<size_t> LayerListWidget::gadget_at(Gfx::IntPoint const& position)
Optional<size_t> LayerListWidget::gadget_at(Gfx::IntPoint position)
{
for (size_t i = 0; i < m_gadgets.size(); ++i) {
if (m_gadgets[i].rect.contains(position))

View file

@ -63,7 +63,7 @@ private:
void get_gadget_rects(Gadget const& gadget, bool is_masked, Gfx::IntRect& outer_rect, Gfx::IntRect& outer_thumbnail_rect, Gfx::IntRect& inner_thumbnail_rect, Gfx::IntRect& outer_mask_thumbnail_rect, Gfx::IntRect& inner_mask_thumbnail_rect, Gfx::IntRect& text_rect);
bool is_moving_gadget() const { return m_moving_gadget_index.has_value(); }
Optional<size_t> gadget_at(Gfx::IntPoint const&);
Optional<size_t> gadget_at(Gfx::IntPoint);
size_t to_layer_index(size_t gadget_index) const;
size_t to_gadget_index(size_t layer_index) const;

View file

@ -44,10 +44,10 @@ public:
Gfx::IntRect bounding_rect() const { return m_mask.bounding_rect(); }
[[nodiscard]] bool is_selected(int x, int y) const { return m_mask.get(x, y) > 0; }
[[nodiscard]] bool is_selected(Gfx::IntPoint const& point) const { return is_selected(point.x(), point.y()); }
[[nodiscard]] bool is_selected(Gfx::IntPoint point) const { return is_selected(point.x(), point.y()); }
[[nodiscard]] u8 get_selection_alpha(int x, int y) const { return m_mask.get(x, y); }
[[nodiscard]] u8 get_selection_alpha(Gfx::IntPoint const& point) const { return get_selection_alpha(point.x(), point.y()); }
[[nodiscard]] u8 get_selection_alpha(Gfx::IntPoint point) const { return get_selection_alpha(point.x(), point.y()); }
Mask const& mask() const { return m_mask; }
void set_mask(Mask);

View file

@ -84,7 +84,7 @@ Color BrushTool::color_for(GUI::MouseEvent const& event)
return m_editor->color_for(event);
}
void BrushTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& point)
void BrushTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint point)
{
constexpr auto flow_scale = 10;
for (int y = point.y() - size(); y < point.y() + size(); y++) {
@ -103,7 +103,7 @@ void BrushTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint
}
}
void BrushTool::draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& start, Gfx::IntPoint const& end)
void BrushTool::draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint start, Gfx::IntPoint end)
{
int length_x = end.x() - start.x();
int length_y = end.y() - start.y();

View file

@ -46,8 +46,8 @@ protected:
virtual StringView tool_name() const override { return "Brush Tool"sv; }
virtual Color color_for(GUI::MouseEvent const& event);
virtual void draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& point);
virtual void draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& start, Gfx::IntPoint const& end);
virtual void draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint point);
virtual void draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint start, Gfx::IntPoint end);
virtual NonnullRefPtr<Gfx::Bitmap> build_cursor();
void refresh_editor_cursor();
float m_scale_last_created_cursor = 0;

View file

@ -27,7 +27,7 @@ BucketTool::BucketTool()
m_cursor = Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/bucket.png"sv).release_value_but_fixme_should_propagate_errors();
}
static void flood_fill(Gfx::Bitmap& bitmap, Gfx::IntPoint const& start_position, Color fill_color, int threshold)
static void flood_fill(Gfx::Bitmap& bitmap, Gfx::IntPoint start_position, Color fill_color, int threshold)
{
VERIFY(bitmap.bpp() == 32);

View file

@ -16,7 +16,7 @@
namespace PixelPaint {
void CloneTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color, Gfx::IntPoint const& point)
void CloneTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color, Gfx::IntPoint point)
{
if (!m_sample_location.has_value())
return;
@ -45,7 +45,7 @@ void CloneTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color, Gfx::IntPoint const&
}
}
void CloneTool::draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& start, Gfx::IntPoint const& end)
void CloneTool::draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint start, Gfx::IntPoint end)
{
if (!m_sample_location.has_value())
return;

View file

@ -21,8 +21,8 @@ public:
virtual bool is_overriding_alt() override { return true; }
protected:
virtual void draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& point) override;
virtual void draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& start, Gfx::IntPoint const& end) override;
virtual void draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint point) override;
virtual void draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint start, Gfx::IntPoint end) override;
virtual void on_mousedown(Layer*, MouseEvent&) override;
virtual void on_mousemove(Layer*, MouseEvent&) override;

View file

@ -23,7 +23,7 @@
namespace PixelPaint {
void EllipseTool::draw_using(GUI::Painter& painter, Gfx::IntPoint const& start_position, Gfx::IntPoint const& end_position, int thickness)
void EllipseTool::draw_using(GUI::Painter& painter, Gfx::IntPoint start_position, Gfx::IntPoint end_position, int thickness)
{
Gfx::IntRect ellipse_intersecting_rect;
if (m_draw_mode == DrawMode::FromCenter) {

View file

@ -41,7 +41,7 @@ private:
FromCorner,
};
void draw_using(GUI::Painter&, Gfx::IntPoint const& start_position, Gfx::IntPoint const& end_position, int thickness);
void draw_using(GUI::Painter&, Gfx::IntPoint start_position, Gfx::IntPoint end_position, int thickness);
RefPtr<GUI::Widget> m_properties_widget;
RefPtr<GUI::TextBox> m_aspect_w_textbox;

View file

@ -28,7 +28,7 @@ Color EraseTool::color_for(GUI::MouseEvent const&)
return Color(255, 255, 255, 0);
}
void EraseTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& point)
void EraseTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint point)
{
if (m_draw_mode == DrawMode::Pencil) {
int radius = size() / 2;

View file

@ -24,7 +24,7 @@ public:
protected:
virtual Color color_for(GUI::MouseEvent const& event) override;
virtual void draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& point) override;
virtual void draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint point) override;
virtual NonnullRefPtr<Gfx::Bitmap> build_cursor() override;
private:

View file

@ -16,7 +16,7 @@
namespace PixelPaint {
RefPtr<Guide> GuideTool::closest_guide(Gfx::IntPoint const& point)
RefPtr<Guide> GuideTool::closest_guide(Gfx::IntPoint point)
{
auto guides = editor()->guides();
Guide* closest_guide = nullptr;

View file

@ -33,7 +33,7 @@ public:
private:
virtual StringView tool_name() const override { return "Guide Tool"sv; }
RefPtr<Guide> closest_guide(Gfx::IntPoint const&);
RefPtr<Guide> closest_guide(Gfx::IntPoint);
RefPtr<GUI::Widget> m_properties_widget;

View file

@ -22,7 +22,7 @@
namespace PixelPaint {
static Gfx::IntPoint constrain_line_angle(Gfx::IntPoint const& start_pos, Gfx::IntPoint const& end_pos, float angle_increment)
static Gfx::IntPoint constrain_line_angle(Gfx::IntPoint start_pos, Gfx::IntPoint end_pos, float angle_increment)
{
float current_angle = AK::atan2<float>(end_pos.y() - start_pos.y(), end_pos.x() - start_pos.x()) + float { M_PI * 2 };
@ -56,7 +56,7 @@ void LineTool::on_mousedown(Layer* layer, MouseEvent& event)
m_editor->update();
}
void LineTool::draw_using(GUI::Painter& painter, Gfx::IntPoint const& start_position, Gfx::IntPoint const& end_position, Color color, int thickness)
void LineTool::draw_using(GUI::Painter& painter, Gfx::IntPoint start_position, Gfx::IntPoint end_position, Color color, int thickness)
{
if (m_antialias_enabled) {
Gfx::AntiAliasingPainter aa_painter { painter };

View file

@ -26,7 +26,7 @@ public:
virtual GUI::Widget* get_properties_widget() override;
virtual Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> cursor() override { return Gfx::StandardCursor::Crosshair; }
void draw_using(GUI::Painter&, Gfx::IntPoint const& start_position, Gfx::IntPoint const& end_position, Color color, int thickness);
void draw_using(GUI::Painter&, Gfx::IntPoint start_position, Gfx::IntPoint end_position, Color color, int thickness);
virtual bool is_overriding_alt() override { return true; }

View file

@ -58,7 +58,7 @@ void MoveTool::on_mousemove(Layer* layer, MouseEvent& event)
}
if (m_scaling) {
auto& cursor_location = event.image_event().position();
auto cursor_location = event.image_event().position();
auto width = abs(m_layer_being_moved->location().x() - cursor_location.x());
auto height = abs(m_layer_being_moved->location().y() - cursor_location.y());
if (m_keep_ascept_ratio) {

View file

@ -23,13 +23,13 @@ PenTool::PenTool()
set_size(1);
}
void PenTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& point)
void PenTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint point)
{
GUI::Painter painter(bitmap);
painter.draw_line(point, point, color, size());
}
void PenTool::draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& start, Gfx::IntPoint const& end)
void PenTool::draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint start, Gfx::IntPoint end)
{
GUI::Painter painter(bitmap);
painter.draw_line(start, end, color, size());

View file

@ -22,8 +22,8 @@ public:
virtual GUI::Widget* get_properties_widget() override;
protected:
virtual void draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& point) override;
virtual void draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& start, Gfx::IntPoint const& end) override;
virtual void draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint point) override;
virtual void draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint start, Gfx::IntPoint end) override;
private:
virtual StringView tool_name() const override { return "Pen Tool"sv; }

View file

@ -24,7 +24,7 @@
namespace PixelPaint {
void RectangleTool::draw_using(GUI::Painter& painter, Gfx::IntPoint const& start_position, Gfx::IntPoint const& end_position, int thickness, int corner_radius)
void RectangleTool::draw_using(GUI::Painter& painter, Gfx::IntPoint start_position, Gfx::IntPoint end_position, int thickness, int corner_radius)
{
Gfx::IntRect rect;
if (m_draw_mode == DrawMode::FromCenter) {

View file

@ -42,7 +42,7 @@ private:
FromCorner,
};
void draw_using(GUI::Painter&, Gfx::IntPoint const& start_position, Gfx::IntPoint const& end_position, int thickness, int corner_radius);
void draw_using(GUI::Painter&, Gfx::IntPoint start_position, Gfx::IntPoint end_position, int thickness, int corner_radius);
RefPtr<GUI::Widget> m_properties_widget;
RefPtr<GUI::TextBox> m_aspect_w_textbox;

View file

@ -62,7 +62,7 @@ Gfx::IntPoint Tool::editor_layer_location(Layer const& layer) const
return (Gfx::FloatPoint { layer.location() } * m_editor->scale()).to_rounded<int>();
}
Gfx::IntPoint Tool::editor_stroke_position(Gfx::IntPoint const& pixel_coords, int stroke_thickness) const
Gfx::IntPoint Tool::editor_stroke_position(Gfx::IntPoint pixel_coords, int stroke_thickness) const
{
auto position = m_editor->content_to_frame_position(pixel_coords);
auto offset = (stroke_thickness % 2 == 0) ? 0 : m_editor->scale() / 2;

View file

@ -89,7 +89,7 @@ protected:
Gfx::IntPoint editor_layer_location(Layer const& layer) const;
virtual Gfx::IntPoint editor_stroke_position(Gfx::IntPoint const& pixel_coords, int stroke_thickness) const;
virtual Gfx::IntPoint editor_stroke_position(Gfx::IntPoint pixel_coords, int stroke_thickness) const;
void set_primary_slider(GUI::ValueSlider* primary) { m_primary_slider = primary; }
void set_secondary_slider(GUI::ValueSlider* secondary) { m_secondary_slider = secondary; }

View file

@ -21,7 +21,7 @@
namespace PixelPaint {
static void set_flood_selection(Gfx::Bitmap& bitmap, Image& image, Gfx::IntPoint const& start_position, Gfx::IntPoint const& selection_offset, int threshold, Selection::MergeMode merge_mode)
static void set_flood_selection(Gfx::Bitmap& bitmap, Image& image, Gfx::IntPoint start_position, Gfx::IntPoint selection_offset, int threshold, Selection::MergeMode merge_mode)
{
VERIFY(bitmap.bpp() == 32);

View file

@ -258,7 +258,7 @@ void TreeMapWidget::paint_event(GUI::PaintEvent& event)
}
}
Vector<int> TreeMapWidget::path_to_position(Gfx::IntPoint const& position)
Vector<int> TreeMapWidget::path_to_position(Gfx::IntPoint position)
{
TreeMapNode const* node = path_node(m_viewpoint);
if (!node) {

View file

@ -64,7 +64,7 @@ private:
template<typename Function>
void lay_out_children(TreeMapNode const&, Gfx::IntRect const&, int depth, Function);
void paint_cell_frame(GUI::Painter&, TreeMapNode const&, Gfx::IntRect const&, Gfx::IntRect const&, int depth, HasLabel has_label) const;
Vector<int> path_to_position(Gfx::IntPoint const&);
Vector<int> path_to_position(Gfx::IntPoint);
RefPtr<TreeMap> m_tree;
Vector<int> m_path;

View file

@ -128,7 +128,7 @@ void CatDog::paint_event(GUI::PaintEvent& event)
painter.blit(Gfx::IntPoint(0, 0), *m_curr_bmp, m_curr_bmp->rect());
}
void CatDog::track_mouse_move(Gfx::IntPoint const& point)
void CatDog::track_mouse_move(Gfx::IntPoint point)
{
if (!m_roaming)
return;

View file

@ -37,7 +37,7 @@ public:
virtual void timer_event(Core::TimerEvent&) override;
virtual void paint_event(GUI::PaintEvent& event) override;
virtual void track_mouse_move(Gfx::IntPoint const& point) override;
virtual void track_mouse_move(Gfx::IntPoint point) override;
virtual void mousedown_event(GUI::MouseEvent& event) override;
virtual void context_menu_event(GUI::ContextMenuEvent& event) override;

View file

@ -11,7 +11,7 @@
#include <LibGUI/Window.h>
#include <LibGfx/Palette.h>
void EyesWidget::track_mouse_move(Gfx::IntPoint const& point)
void EyesWidget::track_mouse_move(Gfx::IntPoint point)
{
m_mouse_position = point - window()->position();
update();

View file

@ -37,7 +37,7 @@ private:
}
virtual void paint_event(GUI::PaintEvent&) override;
virtual void track_mouse_move(Gfx::IntPoint const&) override;
virtual void track_mouse_move(Gfx::IntPoint) override;
void render_eyeball(int row, int column, Gfx::AntiAliasingPainter& aa_painter) const;
Gfx::IntPoint pupil_center(Gfx::IntRect& eyeball_bounds) const;

View file

@ -55,7 +55,7 @@ public:
calculate();
}
void pan_by(Gfx::IntPoint const& delta)
void pan_by(Gfx::IntPoint delta)
{
auto relative_width_pixel = (m_x_end - m_x_start) / m_bitmap->width();
auto relative_height_pixel = (m_y_end - m_y_start) / m_bitmap->height();
@ -179,7 +179,7 @@ private:
m_y_end = y_mid + aspect_corrected_y_length / 2;
}
void move_contents_by(Gfx::IntPoint const& delta)
void move_contents_by(Gfx::IntPoint delta)
{
// If we're moving down we paint upwards, else we paint downwards, to
// avoid overwriting.
@ -223,7 +223,7 @@ class Mandelbrot : public GUI::Frame {
In,
Out,
};
void zoom(Zoom in_out, Gfx::IntPoint const& center);
void zoom(Zoom in_out, Gfx::IntPoint center);
void reset();
@ -247,7 +247,7 @@ private:
MandelbrotSet m_set;
};
void Mandelbrot::zoom(Zoom in_out, Gfx::IntPoint const& center)
void Mandelbrot::zoom(Zoom in_out, Gfx::IntPoint center)
{
static constexpr double zoom_in_multiplier = 0.8;
static constexpr double zoom_out_multiplier = 1.25;

View file

@ -214,7 +214,7 @@ static HashMap<DeprecatedString, DeprecatedString>& man_paths()
return paths;
}
void Editor::show_documentation_tooltip_if_available(DeprecatedString const& hovered_token, Gfx::IntPoint const& screen_location)
void Editor::show_documentation_tooltip_if_available(DeprecatedString const& hovered_token, Gfx::IntPoint screen_location)
{
auto it = man_paths().find(hovered_token);
if (it == man_paths().end()) {

View file

@ -71,7 +71,7 @@ private:
virtual void leave_event(Core::Event&) override;
virtual void keydown_event(GUI::KeyEvent&) override;
void show_documentation_tooltip_if_available(DeprecatedString const&, Gfx::IntPoint const& screen_location);
void show_documentation_tooltip_if_available(DeprecatedString const&, Gfx::IntPoint screen_location);
void navigate_to_include_if_available(DeprecatedString);
void on_navigatable_link_click(const GUI::TextDocumentSpan&);
void on_identifier_click(const GUI::TextDocumentSpan&);

View file

@ -222,7 +222,7 @@ void Game::setup(DeprecatedString player_name, int hand_number)
continue_game_after_delay();
}
void Game::start_animation(NonnullRefPtrVector<Card> cards, Gfx::IntPoint const& end, Function<void()> did_finish_callback, int initial_delay_ms, int steps)
void Game::start_animation(NonnullRefPtrVector<Card> cards, Gfx::IntPoint end, Function<void()> did_finish_callback, int initial_delay_ms, int steps)
{
stop_animation();

View file

@ -64,7 +64,7 @@ private:
void pass_cards();
PassingDirection passing_direction() const;
void start_animation(NonnullRefPtrVector<Card> cards, Gfx::IntPoint const& end, Function<void()> did_finish_callback, int initial_delay_ms, int steps = 30);
void start_animation(NonnullRefPtrVector<Card> cards, Gfx::IntPoint end, Function<void()> did_finish_callback, int initial_delay_ms, int steps = 30);
void stop_animation();
virtual void paint_event(GUI::PaintEvent&) override;

View file

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

View file

@ -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());

View file

@ -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();

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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);

View file

@ -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)
{

View file

@ -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&);

View file

@ -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();

Some files were not shown because too many files have changed in this diff Show more