From 7be0b27dd3cd7185c1b8dc52747c50aad479bc6a Mon Sep 17 00:00:00 2001 From: MacDue Date: Tue, 6 Dec 2022 20:27:44 +0000 Subject: [PATCH] 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. --- .../Tools/CodeGenerators/IPCCompiler/main.cpp | 2 +- .../Applications/Browser/BrowserWindow.cpp | 2 +- Userland/Applications/Browser/BrowserWindow.h | 2 +- Userland/Applications/Browser/Tab.cpp | 12 ++--- Userland/Applications/Browser/Tab.h | 4 +- Userland/Applications/Help/MainWidget.cpp | 2 +- Userland/Applications/Mail/MailWidget.cpp | 4 +- Userland/Applications/Piano/KeysWidget.cpp | 2 +- Userland/Applications/Piano/KeysWidget.h | 2 +- Userland/Applications/PixelPaint/Image.cpp | 2 +- Userland/Applications/PixelPaint/Image.h | 2 +- .../Applications/PixelPaint/ImageEditor.cpp | 2 +- .../Applications/PixelPaint/ImageEditor.h | 4 +- Userland/Applications/PixelPaint/Layer.cpp | 2 +- Userland/Applications/PixelPaint/Layer.h | 6 +-- .../PixelPaint/LayerListWidget.cpp | 2 +- .../Applications/PixelPaint/LayerListWidget.h | 2 +- Userland/Applications/PixelPaint/Selection.h | 4 +- .../PixelPaint/Tools/BrushTool.cpp | 4 +- .../Applications/PixelPaint/Tools/BrushTool.h | 4 +- .../PixelPaint/Tools/BucketTool.cpp | 2 +- .../PixelPaint/Tools/CloneTool.cpp | 4 +- .../Applications/PixelPaint/Tools/CloneTool.h | 4 +- .../PixelPaint/Tools/EllipseTool.cpp | 2 +- .../PixelPaint/Tools/EllipseTool.h | 2 +- .../PixelPaint/Tools/EraseTool.cpp | 2 +- .../Applications/PixelPaint/Tools/EraseTool.h | 2 +- .../PixelPaint/Tools/GuideTool.cpp | 2 +- .../Applications/PixelPaint/Tools/GuideTool.h | 2 +- .../PixelPaint/Tools/LineTool.cpp | 4 +- .../Applications/PixelPaint/Tools/LineTool.h | 2 +- .../PixelPaint/Tools/MoveTool.cpp | 2 +- .../Applications/PixelPaint/Tools/PenTool.cpp | 4 +- .../Applications/PixelPaint/Tools/PenTool.h | 4 +- .../PixelPaint/Tools/RectangleTool.cpp | 2 +- .../PixelPaint/Tools/RectangleTool.h | 2 +- .../Applications/PixelPaint/Tools/Tool.cpp | 2 +- Userland/Applications/PixelPaint/Tools/Tool.h | 2 +- .../PixelPaint/Tools/WandSelectTool.cpp | 2 +- .../SpaceAnalyzer/TreeMapWidget.cpp | 2 +- .../SpaceAnalyzer/TreeMapWidget.h | 2 +- Userland/Demos/CatDog/CatDog.cpp | 2 +- Userland/Demos/CatDog/CatDog.h | 2 +- Userland/Demos/Eyes/EyesWidget.cpp | 2 +- Userland/Demos/Eyes/EyesWidget.h | 2 +- Userland/Demos/Mandelbrot/Mandelbrot.cpp | 8 +-- Userland/DevTools/HackStudio/Editor.cpp | 2 +- Userland/DevTools/HackStudio/Editor.h | 2 +- Userland/Games/Hearts/Game.cpp | 2 +- Userland/Games/Hearts/Game.h | 2 +- Userland/Libraries/LibCards/Card.h | 2 +- Userland/Libraries/LibCards/CardStack.cpp | 4 +- Userland/Libraries/LibCards/CardStack.h | 4 +- .../LibGUI/AbstractScrollableWidget.cpp | 6 +-- .../LibGUI/AbstractScrollableWidget.h | 6 +-- .../Libraries/LibGUI/AbstractTableView.cpp | 8 +-- Userland/Libraries/LibGUI/AbstractTableView.h | 8 +-- Userland/Libraries/LibGUI/AbstractView.h | 2 +- .../LibGUI/AbstractZoomPanWidget.cpp | 10 ++-- .../Libraries/LibGUI/AbstractZoomPanWidget.h | 10 ++-- Userland/Libraries/LibGUI/Application.cpp | 2 +- Userland/Libraries/LibGUI/Application.h | 4 +- Userland/Libraries/LibGUI/ColumnsView.cpp | 6 +-- Userland/Libraries/LibGUI/ColumnsView.h | 6 +-- .../LibGUI/ConnectionToWindowServer.cpp | 14 ++--- .../LibGUI/ConnectionToWindowServer.h | 14 ++--- Userland/Libraries/LibGUI/Event.cpp | 2 +- Userland/Libraries/LibGUI/Event.h | 22 ++++---- Userland/Libraries/LibGUI/IconView.cpp | 6 +-- Userland/Libraries/LibGUI/IconView.h | 10 ++-- Userland/Libraries/LibGUI/ListView.cpp | 4 +- Userland/Libraries/LibGUI/ListView.h | 4 +- Userland/Libraries/LibGUI/Menu.cpp | 2 +- Userland/Libraries/LibGUI/Menu.h | 2 +- Userland/Libraries/LibGUI/MouseTracker.cpp | 2 +- Userland/Libraries/LibGUI/MouseTracker.h | 4 +- Userland/Libraries/LibGUI/OpacitySlider.cpp | 2 +- Userland/Libraries/LibGUI/OpacitySlider.h | 2 +- Userland/Libraries/LibGUI/Scrollbar.cpp | 6 +-- Userland/Libraries/LibGUI/Scrollbar.h | 6 +-- Userland/Libraries/LibGUI/Splitter.cpp | 2 +- Userland/Libraries/LibGUI/Splitter.h | 2 +- Userland/Libraries/LibGUI/TextEditor.cpp | 4 +- Userland/Libraries/LibGUI/TextEditor.h | 4 +- Userland/Libraries/LibGUI/Tray.cpp | 2 +- Userland/Libraries/LibGUI/Tray.h | 2 +- Userland/Libraries/LibGUI/TreeView.cpp | 2 +- Userland/Libraries/LibGUI/TreeView.h | 2 +- Userland/Libraries/LibGUI/ValueSlider.cpp | 2 +- Userland/Libraries/LibGUI/ValueSlider.h | 2 +- Userland/Libraries/LibGUI/Widget.cpp | 4 +- Userland/Libraries/LibGUI/Widget.h | 8 +-- Userland/Libraries/LibGUI/Window.h | 2 +- Userland/Libraries/LibGfx/AffineTransform.cpp | 4 +- Userland/Libraries/LibGfx/AffineTransform.h | 2 +- .../Libraries/LibGfx/AntiAliasingPainter.cpp | 2 +- .../Libraries/LibGfx/AntiAliasingPainter.h | 2 +- Userland/Libraries/LibGfx/Bitmap.cpp | 2 +- Userland/Libraries/LibGfx/Bitmap.h | 6 +-- Userland/Libraries/LibGfx/CursorParams.cpp | 2 +- Userland/Libraries/LibGfx/CursorParams.h | 6 +-- Userland/Libraries/LibGfx/Painter.cpp | 50 ++++++++--------- Userland/Libraries/LibGfx/Painter.h | 54 +++++++++---------- Userland/Libraries/LibPDF/Fonts/PDFFont.h | 2 +- .../Libraries/LibPDF/Fonts/TrueTypeFont.cpp | 2 +- .../Libraries/LibPDF/Fonts/TrueTypeFont.h | 2 +- Userland/Libraries/LibPDF/Fonts/Type0Font.h | 3 +- Userland/Libraries/LibPDF/Fonts/Type1Font.cpp | 2 +- Userland/Libraries/LibPDF/Fonts/Type1Font.h | 2 +- Userland/Libraries/LibVT/TerminalWidget.cpp | 2 +- Userland/Libraries/LibVT/TerminalWidget.h | 2 +- .../Libraries/LibWeb/HTML/BrowsingContext.cpp | 4 +- .../Libraries/LibWeb/HTML/BrowsingContext.h | 6 +-- Userland/Libraries/LibWeb/Layout/Label.cpp | 8 +-- Userland/Libraries/LibWeb/Layout/Label.h | 8 +-- .../Libraries/LibWeb/Page/EventHandler.cpp | 12 ++--- Userland/Libraries/LibWeb/Page/EventHandler.h | 10 ++-- Userland/Libraries/LibWeb/Page/Page.cpp | 10 ++-- Userland/Libraries/LibWeb/Page/Page.h | 26 ++++----- .../LibWeb/Painting/BorderPainting.cpp | 2 +- .../LibWeb/Painting/LabelablePaintable.cpp | 6 +-- .../LibWeb/Painting/LabelablePaintable.h | 6 +-- .../LibWeb/Painting/PaintContext.cpp | 2 +- .../Libraries/LibWeb/Painting/PaintContext.h | 2 +- .../Libraries/LibWeb/Painting/Paintable.cpp | 8 +-- .../Libraries/LibWeb/Painting/Paintable.h | 8 +-- .../LibWeb/Painting/PaintableBox.cpp | 2 +- .../Libraries/LibWeb/Painting/PaintableBox.h | 2 +- .../LibWeb/Painting/TextPaintable.cpp | 6 +-- .../Libraries/LibWeb/Painting/TextPaintable.h | 6 +-- .../LibWebView/OutOfProcessWebView.cpp | 14 ++--- .../LibWebView/OutOfProcessWebView.h | 22 ++++---- .../Libraries/LibWebView/ViewImplementation.h | 12 ++--- .../Libraries/LibWebView/WebContentClient.cpp | 12 ++--- .../Libraries/LibWebView/WebContentClient.h | 12 ++--- .../WebContent/ConnectionFromClient.cpp | 12 ++--- .../WebContent/ConnectionFromClient.h | 12 ++--- Userland/Services/WebContent/PageHost.cpp | 14 ++--- Userland/Services/WebContent/PageHost.h | 14 ++--- .../Services/WindowServer/AppletManager.cpp | 2 +- .../Services/WindowServer/AppletManager.h | 2 +- Userland/Services/WindowServer/Compositor.cpp | 2 +- Userland/Services/WindowServer/Compositor.h | 2 +- .../WindowServer/ConnectionFromClient.cpp | 4 +- .../WindowServer/ConnectionFromClient.h | 4 +- Userland/Services/WindowServer/Event.h | 6 +-- Userland/Services/WindowServer/Menu.cpp | 10 ++-- Userland/Services/WindowServer/Menu.h | 12 ++--- Userland/Services/WindowServer/Screen.cpp | 2 +- Userland/Services/WindowServer/Screen.h | 4 +- .../WindowServer/WMConnectionFromClient.cpp | 4 +- .../WindowServer/WMConnectionFromClient.h | 4 +- Userland/Services/WindowServer/Window.cpp | 4 +- Userland/Services/WindowServer/Window.h | 12 ++--- .../Services/WindowServer/WindowFrame.cpp | 4 +- Userland/Services/WindowServer/WindowFrame.h | 4 +- .../Services/WindowServer/WindowManager.cpp | 8 +-- .../Services/WindowServer/WindowManager.h | 8 +-- .../Services/WindowServer/WindowStack.cpp | 4 +- Userland/Services/WindowServer/WindowStack.h | 8 +-- Userland/Utilities/headless-browser.cpp | 8 +-- 161 files changed, 442 insertions(+), 441 deletions(-) diff --git a/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp b/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp index c7efff37f9f..27b94ff15e3 100644 --- a/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp @@ -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) diff --git a/Userland/Applications/Browser/BrowserWindow.cpp b/Userland/Applications/Browser/BrowserWindow.cpp index d8e1852d9a2..68d1bc938d1 100644 --- a/Userland/Applications/Browser/BrowserWindow.cpp +++ b/Userland/Applications/Browser/BrowserWindow.cpp @@ -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([&](auto& tab) { tab.window_position_changed(position); diff --git a/Userland/Applications/Browser/BrowserWindow.h b/Userland/Applications/Browser/BrowserWindow.h index 6728c0dabec..19b4c4e6df1 100644 --- a/Userland/Applications/Browser/BrowserWindow.h +++ b/Userland/Applications/Browser/BrowserWindow.h @@ -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: diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp index 7033e4955b7..38203900df3 100644 --- a/Userland/Applications/Browser/Tab.cpp +++ b/Userland/Applications/Browser/Tab.cpp @@ -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); } diff --git a/Userland/Applications/Browser/Tab.h b/Userland/Applications/Browser/Tab.h index f65eb6ff83f..61308248cbe 100644 --- a/Userland/Applications/Browser/Tab.h +++ b/Userland/Applications/Browser/Tab.h @@ -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 on_title_change; diff --git a/Userland/Applications/Help/MainWidget.cpp b/Userland/Applications/Help/MainWidget.cpp index 655b2026a3b..796ff972655 100644 --- a/Userland/Applications/Help/MainWidget.cpp +++ b/Userland/Applications/Help/MainWidget.cpp @@ -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); }; diff --git a/Userland/Applications/Mail/MailWidget.cpp b/Userland/Applications/Mail/MailWidget.cpp index cecfbfe9dbb..16a3eb85a06 100644 --- a/Userland/Applications/Mail/MailWidget.cpp +++ b/Userland/Applications/Mail/MailWidget.cpp @@ -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); diff --git a/Userland/Applications/Piano/KeysWidget.cpp b/Userland/Applications/Piano/KeysWidget.cpp index 624ccd59900..e063e449d7c 100644 --- a/Userland/Applications/Piano/KeysWidget.cpp +++ b/Userland/Applications/Piano/KeysWidget.cpp @@ -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; diff --git a/Userland/Applications/Piano/KeysWidget.h b/Userland/Applications/Piano/KeysWidget.h index a90796f2f58..e6e256644b6 100644 --- a/Userland/Applications/Piano/KeysWidget.h +++ b/Userland/Applications/Piano/KeysWidget.h @@ -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); diff --git a/Userland/Applications/PixelPaint/Image.cpp b/Userland/Applications/PixelPaint/Image.cpp index 213217fdd7b..a77dd6a36c5 100644 --- a/Userland/Applications/PixelPaint/Image.cpp +++ b/Userland/Applications/PixelPaint/Image.cpp @@ -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) { diff --git a/Userland/Applications/PixelPaint/Image.h b/Userland/Applications/PixelPaint/Image.h index 00d252db93a..6a8b2a26d69 100644 --- a/Userland/Applications/PixelPaint/Image.h +++ b/Userland/Applications/PixelPaint/Image.h @@ -104,7 +104,7 @@ public: Optional 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&); diff --git a/Userland/Applications/PixelPaint/ImageEditor.cpp b/Userland/Applications/PixelPaint/ImageEditor.cpp index a98ce207c3e..ee05fcc299e 100644 --- a/Userland/Applications/PixelPaint/ImageEditor.cpp +++ b/Userland/Applications/PixelPaint/ImageEditor.cpp @@ -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) { diff --git a/Userland/Applications/PixelPaint/ImageEditor.h b/Userland/Applications/PixelPaint/ImageEditor.h index 5fdfedc8fda..2db91de3365 100644 --- a/Userland/Applications/PixelPaint/ImageEditor.h +++ b/Userland/Applications/PixelPaint/ImageEditor.h @@ -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 on_title_change; - Function on_image_mouse_position_change; + Function on_image_mouse_position_change; Function on_leave; Function on_modified_change; diff --git a/Userland/Applications/PixelPaint/Layer.cpp b/Userland/Applications/PixelPaint/Layer.cpp index 11df1ba0e15..a2358181688 100644 --- a/Userland/Applications/PixelPaint/Layer.cpp +++ b/Userland/Applications/PixelPaint/Layer.cpp @@ -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); diff --git a/Userland/Applications/PixelPaint/Layer.h b/Userland/Applications/PixelPaint/Layer.h index f635ef17429..22ccfb2d849 100644 --- a/Userland/Applications/PixelPaint/Layer.h +++ b/Userland/Applications/PixelPaint/Layer.h @@ -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 nonempty_content_bounding_rect() const; diff --git a/Userland/Applications/PixelPaint/LayerListWidget.cpp b/Userland/Applications/PixelPaint/LayerListWidget.cpp index 49fbde1e603..e4228fdfd21 100644 --- a/Userland/Applications/PixelPaint/LayerListWidget.cpp +++ b/Userland/Applications/PixelPaint/LayerListWidget.cpp @@ -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 LayerListWidget::gadget_at(Gfx::IntPoint const& position) +Optional LayerListWidget::gadget_at(Gfx::IntPoint position) { for (size_t i = 0; i < m_gadgets.size(); ++i) { if (m_gadgets[i].rect.contains(position)) diff --git a/Userland/Applications/PixelPaint/LayerListWidget.h b/Userland/Applications/PixelPaint/LayerListWidget.h index 15132f6e38e..9966dd3e4ff 100644 --- a/Userland/Applications/PixelPaint/LayerListWidget.h +++ b/Userland/Applications/PixelPaint/LayerListWidget.h @@ -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 gadget_at(Gfx::IntPoint const&); + Optional gadget_at(Gfx::IntPoint); size_t to_layer_index(size_t gadget_index) const; size_t to_gadget_index(size_t layer_index) const; diff --git a/Userland/Applications/PixelPaint/Selection.h b/Userland/Applications/PixelPaint/Selection.h index 5d7d9669af4..bd17bc21209 100644 --- a/Userland/Applications/PixelPaint/Selection.h +++ b/Userland/Applications/PixelPaint/Selection.h @@ -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); diff --git a/Userland/Applications/PixelPaint/Tools/BrushTool.cpp b/Userland/Applications/PixelPaint/Tools/BrushTool.cpp index 47499fa5e68..d1c28712f9f 100644 --- a/Userland/Applications/PixelPaint/Tools/BrushTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/BrushTool.cpp @@ -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(); diff --git a/Userland/Applications/PixelPaint/Tools/BrushTool.h b/Userland/Applications/PixelPaint/Tools/BrushTool.h index 90ad4550aca..5baab83850c 100644 --- a/Userland/Applications/PixelPaint/Tools/BrushTool.h +++ b/Userland/Applications/PixelPaint/Tools/BrushTool.h @@ -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 build_cursor(); void refresh_editor_cursor(); float m_scale_last_created_cursor = 0; diff --git a/Userland/Applications/PixelPaint/Tools/BucketTool.cpp b/Userland/Applications/PixelPaint/Tools/BucketTool.cpp index 80228d5fc78..857239c5d6d 100644 --- a/Userland/Applications/PixelPaint/Tools/BucketTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/BucketTool.cpp @@ -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); diff --git a/Userland/Applications/PixelPaint/Tools/CloneTool.cpp b/Userland/Applications/PixelPaint/Tools/CloneTool.cpp index 3926915cb80..907c7ebb37f 100644 --- a/Userland/Applications/PixelPaint/Tools/CloneTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/CloneTool.cpp @@ -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; diff --git a/Userland/Applications/PixelPaint/Tools/CloneTool.h b/Userland/Applications/PixelPaint/Tools/CloneTool.h index 973a37069c7..53fafd2c90c 100644 --- a/Userland/Applications/PixelPaint/Tools/CloneTool.h +++ b/Userland/Applications/PixelPaint/Tools/CloneTool.h @@ -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; diff --git a/Userland/Applications/PixelPaint/Tools/EllipseTool.cpp b/Userland/Applications/PixelPaint/Tools/EllipseTool.cpp index db68b49923f..166e9330ae5 100644 --- a/Userland/Applications/PixelPaint/Tools/EllipseTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/EllipseTool.cpp @@ -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) { diff --git a/Userland/Applications/PixelPaint/Tools/EllipseTool.h b/Userland/Applications/PixelPaint/Tools/EllipseTool.h index 671c3ac6602..f986dae1366 100644 --- a/Userland/Applications/PixelPaint/Tools/EllipseTool.h +++ b/Userland/Applications/PixelPaint/Tools/EllipseTool.h @@ -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 m_properties_widget; RefPtr m_aspect_w_textbox; diff --git a/Userland/Applications/PixelPaint/Tools/EraseTool.cpp b/Userland/Applications/PixelPaint/Tools/EraseTool.cpp index f449a0b3a4a..6f3ad00a75c 100644 --- a/Userland/Applications/PixelPaint/Tools/EraseTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/EraseTool.cpp @@ -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; diff --git a/Userland/Applications/PixelPaint/Tools/EraseTool.h b/Userland/Applications/PixelPaint/Tools/EraseTool.h index bee0ad308d4..3d1889e0bcb 100644 --- a/Userland/Applications/PixelPaint/Tools/EraseTool.h +++ b/Userland/Applications/PixelPaint/Tools/EraseTool.h @@ -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 build_cursor() override; private: diff --git a/Userland/Applications/PixelPaint/Tools/GuideTool.cpp b/Userland/Applications/PixelPaint/Tools/GuideTool.cpp index de08da55707..526284cd06a 100644 --- a/Userland/Applications/PixelPaint/Tools/GuideTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/GuideTool.cpp @@ -16,7 +16,7 @@ namespace PixelPaint { -RefPtr GuideTool::closest_guide(Gfx::IntPoint const& point) +RefPtr GuideTool::closest_guide(Gfx::IntPoint point) { auto guides = editor()->guides(); Guide* closest_guide = nullptr; diff --git a/Userland/Applications/PixelPaint/Tools/GuideTool.h b/Userland/Applications/PixelPaint/Tools/GuideTool.h index 00d173143eb..2de370c2ddb 100644 --- a/Userland/Applications/PixelPaint/Tools/GuideTool.h +++ b/Userland/Applications/PixelPaint/Tools/GuideTool.h @@ -33,7 +33,7 @@ public: private: virtual StringView tool_name() const override { return "Guide Tool"sv; } - RefPtr closest_guide(Gfx::IntPoint const&); + RefPtr closest_guide(Gfx::IntPoint); RefPtr m_properties_widget; diff --git a/Userland/Applications/PixelPaint/Tools/LineTool.cpp b/Userland/Applications/PixelPaint/Tools/LineTool.cpp index a1d31367be5..9a696295561 100644 --- a/Userland/Applications/PixelPaint/Tools/LineTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/LineTool.cpp @@ -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(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 }; diff --git a/Userland/Applications/PixelPaint/Tools/LineTool.h b/Userland/Applications/PixelPaint/Tools/LineTool.h index e9af5a87dfb..3f5ae114673 100644 --- a/Userland/Applications/PixelPaint/Tools/LineTool.h +++ b/Userland/Applications/PixelPaint/Tools/LineTool.h @@ -26,7 +26,7 @@ public: virtual GUI::Widget* get_properties_widget() override; virtual Variant> 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; } diff --git a/Userland/Applications/PixelPaint/Tools/MoveTool.cpp b/Userland/Applications/PixelPaint/Tools/MoveTool.cpp index ae88f888424..4da4f02f61c 100644 --- a/Userland/Applications/PixelPaint/Tools/MoveTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/MoveTool.cpp @@ -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) { diff --git a/Userland/Applications/PixelPaint/Tools/PenTool.cpp b/Userland/Applications/PixelPaint/Tools/PenTool.cpp index de44ff6b285..ff1f7ce1618 100644 --- a/Userland/Applications/PixelPaint/Tools/PenTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/PenTool.cpp @@ -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()); diff --git a/Userland/Applications/PixelPaint/Tools/PenTool.h b/Userland/Applications/PixelPaint/Tools/PenTool.h index 486184e8d93..ae3234a9b4f 100644 --- a/Userland/Applications/PixelPaint/Tools/PenTool.h +++ b/Userland/Applications/PixelPaint/Tools/PenTool.h @@ -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; } diff --git a/Userland/Applications/PixelPaint/Tools/RectangleTool.cpp b/Userland/Applications/PixelPaint/Tools/RectangleTool.cpp index 293b8ba8560..1327b97e42b 100644 --- a/Userland/Applications/PixelPaint/Tools/RectangleTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/RectangleTool.cpp @@ -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) { diff --git a/Userland/Applications/PixelPaint/Tools/RectangleTool.h b/Userland/Applications/PixelPaint/Tools/RectangleTool.h index 41a5b1ef2cc..e9c30d988f8 100644 --- a/Userland/Applications/PixelPaint/Tools/RectangleTool.h +++ b/Userland/Applications/PixelPaint/Tools/RectangleTool.h @@ -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 m_properties_widget; RefPtr m_aspect_w_textbox; diff --git a/Userland/Applications/PixelPaint/Tools/Tool.cpp b/Userland/Applications/PixelPaint/Tools/Tool.cpp index 57fc44b6aee..ea48b7e07be 100644 --- a/Userland/Applications/PixelPaint/Tools/Tool.cpp +++ b/Userland/Applications/PixelPaint/Tools/Tool.cpp @@ -62,7 +62,7 @@ Gfx::IntPoint Tool::editor_layer_location(Layer const& layer) const return (Gfx::FloatPoint { layer.location() } * m_editor->scale()).to_rounded(); } -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; diff --git a/Userland/Applications/PixelPaint/Tools/Tool.h b/Userland/Applications/PixelPaint/Tools/Tool.h index aeb446b66f3..e243c41eeb5 100644 --- a/Userland/Applications/PixelPaint/Tools/Tool.h +++ b/Userland/Applications/PixelPaint/Tools/Tool.h @@ -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; } diff --git a/Userland/Applications/PixelPaint/Tools/WandSelectTool.cpp b/Userland/Applications/PixelPaint/Tools/WandSelectTool.cpp index f308754ef77..cc4d32907dd 100644 --- a/Userland/Applications/PixelPaint/Tools/WandSelectTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/WandSelectTool.cpp @@ -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); diff --git a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp index f30a2882606..90dfeffc90d 100644 --- a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp +++ b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp @@ -258,7 +258,7 @@ void TreeMapWidget::paint_event(GUI::PaintEvent& event) } } -Vector TreeMapWidget::path_to_position(Gfx::IntPoint const& position) +Vector TreeMapWidget::path_to_position(Gfx::IntPoint position) { TreeMapNode const* node = path_node(m_viewpoint); if (!node) { diff --git a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.h b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.h index e35e1356947..f833e01dc0d 100644 --- a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.h +++ b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.h @@ -64,7 +64,7 @@ private: template 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 path_to_position(Gfx::IntPoint const&); + Vector path_to_position(Gfx::IntPoint); RefPtr m_tree; Vector m_path; diff --git a/Userland/Demos/CatDog/CatDog.cpp b/Userland/Demos/CatDog/CatDog.cpp index b4121c344bb..66d6e16e31d 100644 --- a/Userland/Demos/CatDog/CatDog.cpp +++ b/Userland/Demos/CatDog/CatDog.cpp @@ -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; diff --git a/Userland/Demos/CatDog/CatDog.h b/Userland/Demos/CatDog/CatDog.h index e67504169a3..8857b6e4c62 100644 --- a/Userland/Demos/CatDog/CatDog.h +++ b/Userland/Demos/CatDog/CatDog.h @@ -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; diff --git a/Userland/Demos/Eyes/EyesWidget.cpp b/Userland/Demos/Eyes/EyesWidget.cpp index bef64e38be7..cf4e97eeb78 100644 --- a/Userland/Demos/Eyes/EyesWidget.cpp +++ b/Userland/Demos/Eyes/EyesWidget.cpp @@ -11,7 +11,7 @@ #include #include -void EyesWidget::track_mouse_move(Gfx::IntPoint const& point) +void EyesWidget::track_mouse_move(Gfx::IntPoint point) { m_mouse_position = point - window()->position(); update(); diff --git a/Userland/Demos/Eyes/EyesWidget.h b/Userland/Demos/Eyes/EyesWidget.h index 62792298eba..6e03adeae00 100644 --- a/Userland/Demos/Eyes/EyesWidget.h +++ b/Userland/Demos/Eyes/EyesWidget.h @@ -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; diff --git a/Userland/Demos/Mandelbrot/Mandelbrot.cpp b/Userland/Demos/Mandelbrot/Mandelbrot.cpp index 08a80707b18..fe7581cf92d 100644 --- a/Userland/Demos/Mandelbrot/Mandelbrot.cpp +++ b/Userland/Demos/Mandelbrot/Mandelbrot.cpp @@ -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; diff --git a/Userland/DevTools/HackStudio/Editor.cpp b/Userland/DevTools/HackStudio/Editor.cpp index 0fb35f4936f..3c9b012b92e 100644 --- a/Userland/DevTools/HackStudio/Editor.cpp +++ b/Userland/DevTools/HackStudio/Editor.cpp @@ -214,7 +214,7 @@ static HashMap& 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()) { diff --git a/Userland/DevTools/HackStudio/Editor.h b/Userland/DevTools/HackStudio/Editor.h index acd3f00f963..2495439133c 100644 --- a/Userland/DevTools/HackStudio/Editor.h +++ b/Userland/DevTools/HackStudio/Editor.h @@ -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&); diff --git a/Userland/Games/Hearts/Game.cpp b/Userland/Games/Hearts/Game.cpp index 451c982cb5d..84043a5304e 100644 --- a/Userland/Games/Hearts/Game.cpp +++ b/Userland/Games/Hearts/Game.cpp @@ -222,7 +222,7 @@ void Game::setup(DeprecatedString player_name, int hand_number) continue_game_after_delay(); } -void Game::start_animation(NonnullRefPtrVector cards, Gfx::IntPoint const& end, Function did_finish_callback, int initial_delay_ms, int steps) +void Game::start_animation(NonnullRefPtrVector cards, Gfx::IntPoint end, Function did_finish_callback, int initial_delay_ms, int steps) { stop_animation(); diff --git a/Userland/Games/Hearts/Game.h b/Userland/Games/Hearts/Game.h index 823a53b5b33..506d50917a0 100644 --- a/Userland/Games/Hearts/Game.h +++ b/Userland/Games/Hearts/Game.h @@ -64,7 +64,7 @@ private: void pass_cards(); PassingDirection passing_direction() const; - void start_animation(NonnullRefPtrVector cards, Gfx::IntPoint const& end, Function did_finish_callback, int initial_delay_ms, int steps = 30); + void start_animation(NonnullRefPtrVector cards, Gfx::IntPoint end, Function did_finish_callback, int initial_delay_ms, int steps = 30); void stop_animation(); virtual void paint_event(GUI::PaintEvent&) override; diff --git a/Userland/Libraries/LibCards/Card.h b/Userland/Libraries/LibCards/Card.h index ca50bb24791..72251ecdf86 100644 --- a/Userland/Libraries/LibCards/Card.h +++ b/Userland/Libraries/LibCards/Card.h @@ -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; } diff --git a/Userland/Libraries/LibCards/CardStack.cpp b/Userland/Libraries/LibCards/CardStack.cpp index b90e1e0b448..1e0e65b4fc9 100644 --- a/Userland/Libraries/LibCards/CardStack.cpp +++ b/Userland/Libraries/LibCards/CardStack.cpp @@ -15,7 +15,7 @@ CardStack::CardStack() { } -CardStack::CardStack(Gfx::IntPoint const& position, Type type, RefPtr covered_stack) +CardStack::CardStack(Gfx::IntPoint position, Type type, RefPtr 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& grabbed, MovementRule movement_rule) +void CardStack::add_all_grabbed_cards(Gfx::IntPoint click_location, NonnullRefPtrVector& grabbed, MovementRule movement_rule) { VERIFY(grabbed.is_empty()); diff --git a/Userland/Libraries/LibCards/CardStack.h b/Userland/Libraries/LibCards/CardStack.h index e2b946108f4..b558c18a19c 100644 --- a/Userland/Libraries/LibCards/CardStack.h +++ b/Userland/Libraries/LibCards/CardStack.h @@ -31,7 +31,7 @@ public: }; CardStack(); - CardStack(Gfx::IntPoint const& position, Type type, RefPtr covered_stack = nullptr); + CardStack(Gfx::IntPoint position, Type type, RefPtr 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& grabbed, MovementRule movement_rule = MovementRule::Alternating); + void add_all_grabbed_cards(Gfx::IntPoint click_location, NonnullRefPtrVector& grabbed, MovementRule movement_rule = MovementRule::Alternating); void paint(GUI::Painter&, Gfx::Color background_color); void clear(); diff --git a/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp b/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp index 627fdad6c1d..28b78847df1 100644 --- a/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp +++ b/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp @@ -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()); diff --git a/Userland/Libraries/LibGUI/AbstractScrollableWidget.h b/Userland/Libraries/LibGUI/AbstractScrollableWidget.h index 6e33e2ceb49..492e197f66c 100644 --- a/Userland/Libraries/LibGUI/AbstractScrollableWidget.h +++ b/Userland/Libraries/LibGUI/AbstractScrollableWidget.h @@ -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() }; } diff --git a/Userland/Libraries/LibGUI/AbstractTableView.cpp b/Userland/Libraries/LibGUI/AbstractTableView.cpp index 9fd946c3bd9..edc54fe20d2 100644 --- a/Userland/Libraries/LibGUI/AbstractTableView.cpp +++ b/Userland/Libraries/LibGUI/AbstractTableView.cpp @@ -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); diff --git a/Userland/Libraries/LibGUI/AbstractTableView.h b/Userland/Libraries/LibGUI/AbstractTableView.h index de1cec378be..50393041483 100644 --- a/Userland/Libraries/LibGUI/AbstractTableView.h +++ b/Userland/Libraries/LibGUI/AbstractTableView.h @@ -52,7 +52,7 @@ public: void set_column_painting_delegate(int column, OwnPtr); - 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(); diff --git a/Userland/Libraries/LibGUI/AbstractView.h b/Userland/Libraries/LibGUI/AbstractView.h index 41b9f3a6f45..d8554565823 100644 --- a/Userland/Libraries/LibGUI/AbstractView.h +++ b/Userland/Libraries/LibGUI/AbstractView.h @@ -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(); diff --git a/Userland/Libraries/LibGUI/AbstractZoomPanWidget.cpp b/Userland/Libraries/LibGUI/AbstractZoomPanWidget.cpp index 0957ad587d3..e228c536dfa 100644 --- a/Userland/Libraries/LibGUI/AbstractZoomPanWidget.cpp +++ b/Userland/Libraries/LibGUI/AbstractZoomPanWidget.cpp @@ -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(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, diff --git a/Userland/Libraries/LibGUI/AbstractZoomPanWidget.h b/Userland/Libraries/LibGUI/AbstractZoomPanWidget.h index 612438981a5..c2d53cb89ed 100644 --- a/Userland/Libraries/LibGUI/AbstractZoomPanWidget.h +++ b/Userland/Libraries/LibGUI/AbstractZoomPanWidget.h @@ -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; diff --git a/Userland/Libraries/LibGUI/Application.cpp b/Userland/Libraries/LibGUI/Application.cpp index 1633d5253df..1d789291079 100644 --- a/Userland/Libraries/LibGUI/Application.cpp +++ b/Userland/Libraries/LibGUI/Application.cpp @@ -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 mime_types) +void Application::set_drag_hovered_widget_impl(Widget* widget, Gfx::IntPoint position, Vector mime_types) { if (widget == m_drag_hovered_widget) return; diff --git a/Userland/Libraries/LibGUI/Application.h b/Userland/Libraries/LibGUI/Application.h index 28c35e24707..b538f14f1e6 100644 --- a/Userland/Libraries/LibGUI/Application.h +++ b/Userland/Libraries/LibGUI/Application.h @@ -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, Widget* widget, Gfx::IntPoint const& position = {}, Vector mime_types = {}) + void set_drag_hovered_widget(Badge, Widget* widget, Gfx::IntPoint position = {}, Vector 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 = {}); + void set_drag_hovered_widget_impl(Widget*, Gfx::IntPoint = {}, Vector = {}); void set_pending_drop_widget(Widget*); OwnPtr m_event_loop; diff --git a/Userland/Libraries/LibGUI/ColumnsView.cpp b/Userland/Libraries/LibGUI/ColumnsView.cpp index 4bd374f5c55..f02f1fe0b2e 100644 --- a/Userland/Libraries/LibGUI/ColumnsView.cpp +++ b/Userland/Libraries/LibGUI/ColumnsView.cpp @@ -238,7 +238,7 @@ void ColumnsView::update_column_sizes() set_content_size({ total_width, total_height }); } -Optional ColumnsView::column_at_event_position(Gfx::IntPoint const& a_position) const +Optional 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()) diff --git a/Userland/Libraries/LibGUI/ColumnsView.h b/Userland/Libraries/LibGUI/ColumnsView.h index ce941c9fa40..ea61c4c2ebd 100644 --- a/Userland/Libraries/LibGUI/ColumnsView.h +++ b/Userland/Libraries/LibGUI/ColumnsView.h @@ -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_at_event_position(Gfx::IntPoint const&) const; - ModelIndex index_at_event_position_in_column(Gfx::IntPoint const&, Column const&) const; + Optional 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 }; diff --git a/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp b/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp index 89a08fc0fa4..83b7acd3b31 100644 --- a/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp +++ b/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp @@ -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(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 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 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(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(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 const& mime_data) +void ConnectionToWindowServer::drag_dropped(i32 window_id, Gfx::IntPoint mouse_position, DeprecatedString const& text, HashMap 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); } diff --git a/Userland/Libraries/LibGUI/ConnectionToWindowServer.h b/Userland/Libraries/LibGUI/ConnectionToWindowServer.h index 70088950afb..98f5b7500d4 100644 --- a/Userland/Libraries/LibGUI/ConnectionToWindowServer.h +++ b/Userland/Libraries/LibGUI/ConnectionToWindowServer.h @@ -26,11 +26,11 @@ private: virtual void fast_greet(Vector const&, u32, u32, u32, Core::AnonymousBuffer const&, DeprecatedString const&, DeprecatedString const&, DeprecatedString const&, Vector const&, i32) override; virtual void paint(i32, Gfx::IntSize const&, Vector const&) override; - virtual void mouse_move(i32, Gfx::IntPoint const&, u32, u32, u32, i32, i32, i32, i32, bool, Vector 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 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 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 const&) override; + virtual void drag_dropped(i32, Gfx::IntPoint, DeprecatedString const&, HashMap 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 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 }; diff --git a/Userland/Libraries/LibGUI/Event.cpp b/Userland/Libraries/LibGUI/Event.cpp index b24b6986609..c109b09519d 100644 --- a/Userland/Libraries/LibGUI/Event.cpp +++ b/Userland/Libraries/LibGUI/Event.cpp @@ -12,7 +12,7 @@ namespace GUI { -DropEvent::DropEvent(Gfx::IntPoint const& position, DeprecatedString const& text, NonnullRefPtr mime_data) +DropEvent::DropEvent(Gfx::IntPoint position, DeprecatedString const& text, NonnullRefPtr mime_data) : Event(Event::Drop) , m_position(position) , m_text(text) diff --git a/Userland/Libraries/LibGUI/Event.h b/Userland/Libraries/LibGUI/Event.h index 0f4c6f56201..cdce3a944a5 100644 --- a/Userland/Libraries/LibGUI/Event.h +++ b/Userland/Libraries/LibGUI/Event.h @@ -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 mime_types) + DragEvent(Type type, Gfx::IntPoint position, Vector 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 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 mime_data); + DropEvent(Gfx::IntPoint, DeprecatedString const& text, NonnullRefPtr 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; } diff --git a/Userland/Libraries/LibGUI/IconView.cpp b/Userland/Libraries/LibGUI/IconView.cpp index 493cf4a7369..ad19bafc2c7 100644 --- a/Userland/Libraries/LibGUI/IconView.cpp +++ b/Userland/Libraries/LibGUI/IconView.cpp @@ -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) { diff --git a/Userland/Libraries/LibGUI/IconView.h b/Userland/Libraries/LibGUI/IconView.h index a7d01149737..8a729d12a1d 100644 --- a/Userland/Libraries/LibGUI/IconView.h +++ b/Userland/Libraries/LibGUI/IconView.h @@ -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 IterationDecision for_each_item_intersecting_rects(Vector 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&); diff --git a/Userland/Libraries/LibGUI/ListView.cpp b/Userland/Libraries/LibGUI/ListView.cpp index d20f8ef5d46..1cc110de0e3 100644 --- a/Userland/Libraries/LibGUI/ListView.cpp +++ b/Userland/Libraries/LibGUI/ListView.cpp @@ -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()); } diff --git a/Userland/Libraries/LibGUI/ListView.h b/Userland/Libraries/LibGUI/ListView.h index 4c0304cffa6..9b16e556cc7 100644 --- a/Userland/Libraries/LibGUI/ListView.h +++ b/Userland/Libraries/LibGUI/ListView.h @@ -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; } diff --git a/Userland/Libraries/LibGUI/Menu.cpp b/Userland/Libraries/LibGUI/Menu.cpp index 87a88481746..74dcf7a73ec 100644 --- a/Userland/Libraries/LibGUI/Menu.cpp +++ b/Userland/Libraries/LibGUI/Menu.cpp @@ -116,7 +116,7 @@ void Menu::realize_if_needed(RefPtr const& default_action) realize_menu(default_action); } -void Menu::popup(Gfx::IntPoint const& screen_position, RefPtr const& default_action, Gfx::IntRect const& button_rect) +void Menu::popup(Gfx::IntPoint screen_position, RefPtr 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); diff --git a/Userland/Libraries/LibGUI/Menu.h b/Userland/Libraries/LibGUI/Menu.h index 66fa3e528a7..7f0da099378 100644 --- a/Userland/Libraries/LibGUI/Menu.h +++ b/Userland/Libraries/LibGUI/Menu.h @@ -48,7 +48,7 @@ public: Menu& add_submenu(DeprecatedString name); void remove_all_actions(); - void popup(Gfx::IntPoint const& screen_position, RefPtr const& default_action = nullptr, Gfx::IntRect const& button_rect = {}); + void popup(Gfx::IntPoint screen_position, RefPtr const& default_action = nullptr, Gfx::IntRect const& button_rect = {}); void dismiss(); void visibility_did_change(Badge, bool visible); diff --git a/Userland/Libraries/LibGUI/MouseTracker.cpp b/Userland/Libraries/LibGUI/MouseTracker.cpp index 7b1d162a44e..4e4129dc27d 100644 --- a/Userland/Libraries/LibGUI/MouseTracker.cpp +++ b/Userland/Libraries/LibGUI/MouseTracker.cpp @@ -26,7 +26,7 @@ MouseTracker::~MouseTracker() } } -void MouseTracker::track_mouse_move(Badge, Gfx::IntPoint const& point) +void MouseTracker::track_mouse_move(Badge, Gfx::IntPoint point) { for (auto& tracker : s_trackers) { tracker.track_mouse_move(point); diff --git a/Userland/Libraries/LibGUI/MouseTracker.h b/Userland/Libraries/LibGUI/MouseTracker.h index ca26bcd795d..dbf8b6a848a 100644 --- a/Userland/Libraries/LibGUI/MouseTracker.h +++ b/Userland/Libraries/LibGUI/MouseTracker.h @@ -19,10 +19,10 @@ public: MouseTracker(); virtual ~MouseTracker(); - static void track_mouse_move(Badge, Gfx::IntPoint const&); + static void track_mouse_move(Badge, Gfx::IntPoint); protected: - virtual void track_mouse_move(Gfx::IntPoint const&) = 0; + virtual void track_mouse_move(Gfx::IntPoint) = 0; private: IntrusiveListNode m_list_node; diff --git a/Userland/Libraries/LibGUI/OpacitySlider.cpp b/Userland/Libraries/LibGUI/OpacitySlider.cpp index 2bc1fbc3dce..a2cceaf0614 100644 --- a/Userland/Libraries/LibGUI/OpacitySlider.cpp +++ b/Userland/Libraries/LibGUI/OpacitySlider.cpp @@ -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()) diff --git a/Userland/Libraries/LibGUI/OpacitySlider.h b/Userland/Libraries/LibGUI/OpacitySlider.h index 3c09c95c895..92b37090915 100644 --- a/Userland/Libraries/LibGUI/OpacitySlider.h +++ b/Userland/Libraries/LibGUI/OpacitySlider.h @@ -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 }; }; diff --git a/Userland/Libraries/LibGUI/Scrollbar.cpp b/Userland/Libraries/LibGUI/Scrollbar.cpp index 7659f857bfd..195f9bff038 100644 --- a/Userland/Libraries/LibGUI/Scrollbar.cpp +++ b/Userland/Libraries/LibGUI/Scrollbar.cpp @@ -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; diff --git a/Userland/Libraries/LibGUI/Scrollbar.h b/Userland/Libraries/LibGUI/Scrollbar.h index 841eab7117b..2169d0dcde4 100644 --- a/Userland/Libraries/LibGUI/Scrollbar.h +++ b/Userland/Libraries/LibGUI/Scrollbar.h @@ -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(); diff --git a/Userland/Libraries/LibGUI/Splitter.cpp b/Userland/Libraries/LibGUI/Splitter.cpp index 9efa14a6685..81936549ccc 100644 --- a/Userland/Libraries/LibGUI/Splitter.cpp +++ b/Userland/Libraries/LibGUI/Splitter.cpp @@ -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)) diff --git a/Userland/Libraries/LibGUI/Splitter.h b/Userland/Libraries/LibGUI/Splitter.h index d297180b9b8..368000c0a70 100644 --- a/Userland/Libraries/LibGUI/Splitter.h +++ b/Userland/Libraries/LibGUI/Splitter.h @@ -70,7 +70,7 @@ private: WeakPtr second_widget; }; - Grabbable* grabbable_at(Gfx::IntPoint const&); + Grabbable* grabbable_at(Gfx::IntPoint); void set_hovered_grabbable(Grabbable*); Vector m_grabbables; diff --git a/Userland/Libraries/LibGUI/TextEditor.cpp b/Userland/Libraries/LibGUI/TextEditor.cpp index c447c8245d9..4723dc9ffc6 100644 --- a/Userland/Libraries/LibGUI/TextEditor.cpp +++ b/Userland/Libraries/LibGUI/TextEditor.cpp @@ -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()); diff --git a/Userland/Libraries/LibGUI/TextEditor.h b/Userland/Libraries/LibGUI/TextEditor.h index 4feb9a3ab84..bff0749e771 100644 --- a/Userland/Libraries/LibGUI/TextEditor.h +++ b/Userland/Libraries/LibGUI/TextEditor.h @@ -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; diff --git a/Userland/Libraries/LibGUI/Tray.cpp b/Userland/Libraries/LibGUI/Tray.cpp index 8c82213cc6b..9b9ab1d8b15 100644 --- a/Userland/Libraries/LibGUI/Tray.cpp +++ b/Userland/Libraries/LibGUI/Tray.cpp @@ -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)) diff --git a/Userland/Libraries/LibGUI/Tray.h b/Userland/Libraries/LibGUI/Tray.h index b02ebca16c6..239fd4bd2cb 100644 --- a/Userland/Libraries/LibGUI/Tray.h +++ b/Userland/Libraries/LibGUI/Tray.h @@ -45,7 +45,7 @@ private: Gfx::IntRect rect(Tray const&) const; }; - Item* item_at(Gfx::IntPoint const&); + Item* item_at(Gfx::IntPoint); Vector m_items; diff --git a/Userland/Libraries/LibGUI/TreeView.cpp b/Userland/Libraries/LibGUI/TreeView.cpp index 5108dfc37cb..02ae4359a7a 100644 --- a/Userland/Libraries/LibGUI/TreeView.cpp +++ b/Userland/Libraries/LibGUI/TreeView.cpp @@ -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; diff --git a/Userland/Libraries/LibGUI/TreeView.h b/Userland/Libraries/LibGUI/TreeView.h index 4d1df1dbb59..803fa27bb8a 100644 --- a/Userland/Libraries/LibGUI/TreeView.h +++ b/Userland/Libraries/LibGUI/TreeView.h @@ -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(); } diff --git a/Userland/Libraries/LibGUI/ValueSlider.cpp b/Userland/Libraries/LibGUI/ValueSlider.cpp index 75108dc1969..9bed7349f39 100644 --- a/Userland/Libraries/LibGUI/ValueSlider.cpp +++ b/Userland/Libraries/LibGUI/ValueSlider.cpp @@ -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(); diff --git a/Userland/Libraries/LibGUI/ValueSlider.h b/Userland/Libraries/LibGUI/ValueSlider.h index 46340d723ca..52043b441fe 100644 --- a/Userland/Libraries/LibGUI/ValueSlider.h +++ b/Userland/Libraries/LibGUI/ValueSlider.h @@ -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; diff --git a/Userland/Libraries/LibGUI/Widget.cpp b/Userland/Libraries/LibGUI/Widget.cpp index 0d84ce25d32..063f629ae9a 100644 --- a/Userland/Libraries/LibGUI/Widget.cpp +++ b/Userland/Libraries/LibGUI/Widget.cpp @@ -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(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 }; diff --git a/Userland/Libraries/LibGUI/Widget.h b/Userland/Libraries/LibGUI/Widget.h index d0a94584d32..0c374f877b9 100644 --- a/Userland/Libraries/LibGUI/Widget.h +++ b/Userland/Libraries/LibGUI/Widget.h @@ -240,8 +240,8 @@ public: WeakPtr 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); diff --git a/Userland/Libraries/LibGUI/Window.h b/Userland/Libraries/LibGUI/Window.h index 5ee920540f6..48ba6de9d25 100644 --- a/Userland/Libraries/LibGUI/Window.h +++ b/Userland/Libraries/LibGUI/Window.h @@ -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 }); } diff --git a/Userland/Libraries/LibGfx/AffineTransform.cpp b/Userland/Libraries/LibGfx/AffineTransform.cpp index 96cf0ec52b8..65ef067329d 100644 --- a/Userland/Libraries/LibGfx/AffineTransform.cpp +++ b/Userland/Libraries/LibGfx/AffineTransform.cpp @@ -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; diff --git a/Userland/Libraries/LibGfx/AffineTransform.h b/Userland/Libraries/LibGfx/AffineTransform.h index 9cdb9312198..d60b19b10cf 100644 --- a/Userland/Libraries/LibGfx/AffineTransform.h +++ b/Userland/Libraries/LibGfx/AffineTransform.h @@ -31,7 +31,7 @@ public: void map(float unmapped_x, float unmapped_y, float& mapped_x, float& mapped_y) const; template - Point map(Point const&) const; + Point map(Point) const; template Size map(Size const&) const; diff --git a/Userland/Libraries/LibGfx/AntiAliasingPainter.cpp b/Userland/Libraries/LibGfx/AntiAliasingPainter.cpp index 2994f12455a..3bf87d0cac3 100644 --- a/Userland/Libraries/LibGfx/AntiAliasingPainter.cpp +++ b/Userland/Libraries/LibGfx/AntiAliasingPainter.cpp @@ -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; diff --git a/Userland/Libraries/LibGfx/AntiAliasingPainter.h b/Userland/Libraries/LibGfx/AntiAliasingPainter.h index 2ba0bdb2113..35e05133474 100644 --- a/Userland/Libraries/LibGfx/AntiAliasingPainter.h +++ b/Userland/Libraries/LibGfx/AntiAliasingPainter.h @@ -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); diff --git a/Userland/Libraries/LibGfx/Bitmap.cpp b/Userland/Libraries/LibGfx/Bitmap.cpp index 299e3948595..9c4896ff2a6 100644 --- a/Userland/Libraries/LibGfx/Bitmap.cpp +++ b/Userland/Libraries/LibGfx/Bitmap.cpp @@ -636,7 +636,7 @@ Optional 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 pixel_reached) { diff --git a/Userland/Libraries/LibGfx/Bitmap.h b/Userland/Libraries/LibGfx/Bitmap.h index a80dba66bbe..e7ec12c857e 100644 --- a/Userland/Libraries/LibGfx/Bitmap.h +++ b/Userland/Libraries/LibGfx/Bitmap.h @@ -217,7 +217,7 @@ public: template [[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 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 solid_color(u8 alpha_threshold = 0) const; - void flood_visit_from_point(Gfx::IntPoint const& start_point, int threshold, Function pixel_reached); + void flood_visit_from_point(Gfx::IntPoint start_point, int threshold, Function pixel_reached); private: Bitmap(BitmapFormat, IntSize const&, int, BackingStore const&); diff --git a/Userland/Libraries/LibGfx/CursorParams.cpp b/Userland/Libraries/LibGfx/CursorParams.cpp index 8c2b2e43f2f..5f5c0726bd6 100644 --- a/Userland/Libraries/LibGfx/CursorParams.cpp +++ b/Userland/Libraries/LibGfx/CursorParams.cpp @@ -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(); diff --git a/Userland/Libraries/LibGfx/CursorParams.h b/Userland/Libraries/LibGfx/CursorParams.h index 7a69aa2f642..d0ba4d888bd 100644 --- a/Userland/Libraries/LibGfx/CursorParams.h +++ b/Userland/Libraries/LibGfx/CursorParams.h @@ -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; } diff --git a/Userland/Libraries/LibGfx/Painter.cpp b/Userland/Libraries/LibGfx/Painter.cpp index f24f87750da..e7353c372db 100644 --- a/Userland/Libraries/LibGfx/Painter.cpp +++ b/Userland/Libraries/LibGfx/Painter.cpp @@ -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 control_points, Color color) +void Painter::draw_triangle(IntPoint offset, Span 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 filter) +void Painter::blit_filtered(IntPoint position, Gfx::Bitmap const& source, IntRect const& src_rect, Function 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 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 Painter::get_pixel(IntPoint const& p) +Optional 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(*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(); diff --git a/Userland/Libraries/LibGfx/Painter.h b/Userland/Libraries/LibGfx/Painter.h index c9c65fb474f..863a5c55104 100644 --- a/Userland/Libraries/LibGfx/Painter.h +++ b/Userland/Libraries/LibGfx/Painter.h @@ -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, Color); + void draw_triangle(IntPoint, IntPoint, IntPoint, Color); + void draw_triangle(IntPoint offset, Span, 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 get_pixel(IntPoint const&); + Optional get_pixel(IntPoint); ErrorOr> get_region_bitmap(IntRect const&, BitmapFormat format, Optional 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); + 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); 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, IntRect const&, Utf8View const&, Font const&, TextAlignment = TextAlignment::TopLeft, TextElision = TextElision::None, TextWrapping = TextWrapping::DontWrap); void draw_text(Function, 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; diff --git a/Userland/Libraries/LibPDF/Fonts/PDFFont.h b/Userland/Libraries/LibPDF/Fonts/PDFFont.h index 555c81a9298..ffa49a6da29 100644 --- a/Userland/Libraries/LibPDF/Fonts/PDFFont.h +++ b/Userland/Libraries/LibPDF/Fonts/PDFFont.h @@ -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; diff --git a/Userland/Libraries/LibPDF/Fonts/TrueTypeFont.cpp b/Userland/Libraries/LibPDF/Fonts/TrueTypeFont.cpp index 89b7cfc6239..f6b07249d83 100644 --- a/Userland/Libraries/LibPDF/Fonts/TrueTypeFont.cpp +++ b/Userland/Libraries/LibPDF/Fonts/TrueTypeFont.cpp @@ -65,7 +65,7 @@ float TrueTypeFont::get_char_width(u16 char_code) const return static_cast(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; diff --git a/Userland/Libraries/LibPDF/Fonts/TrueTypeFont.h b/Userland/Libraries/LibPDF/Fonts/TrueTypeFont.h index 68c3df28d40..a96c857ad93 100644 --- a/Userland/Libraries/LibPDF/Fonts/TrueTypeFont.h +++ b/Userland/Libraries/LibPDF/Fonts/TrueTypeFont.h @@ -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; } diff --git a/Userland/Libraries/LibPDF/Fonts/Type0Font.h b/Userland/Libraries/LibPDF/Fonts/Type0Font.h index f58492c275a..15a943dad3d 100644 --- a/Userland/Libraries/LibPDF/Fonts/Type0Font.h +++ b/Userland/Libraries/LibPDF/Fonts/Type0Font.h @@ -6,6 +6,7 @@ #pragma once +#include #include 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; } diff --git a/Userland/Libraries/LibPDF/Fonts/Type1Font.cpp b/Userland/Libraries/LibPDF/Fonts/Type1Font.cpp index a49fac75e35..392dad2f905 100644 --- a/Userland/Libraries/LibPDF/Fonts/Type1Font.cpp +++ b/Userland/Libraries/LibPDF/Fonts/Type1Font.cpp @@ -73,7 +73,7 @@ float Type1Font::get_char_width(u16 char_code) const return static_cast(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; diff --git a/Userland/Libraries/LibPDF/Fonts/Type1Font.h b/Userland/Libraries/LibPDF/Fonts/Type1Font.h index a9b07048f13..bd99befdd10 100644 --- a/Userland/Libraries/LibPDF/Fonts/Type1Font.h +++ b/Userland/Libraries/LibPDF/Fonts/Type1Font.h @@ -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; } diff --git a/Userland/Libraries/LibVT/TerminalWidget.cpp b/Userland/Libraries/LibVT/TerminalWidget.cpp index a53d5a6b9a3..901be6533ad 100644 --- a/Userland/Libraries/LibVT/TerminalWidget.cpp +++ b/Userland/Libraries/LibVT/TerminalWidget.cpp @@ -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; diff --git a/Userland/Libraries/LibVT/TerminalWidget.h b/Userland/Libraries/LibVT/TerminalWidget.h index b6bcbe915ef..6a88b509363 100644 --- a/Userland/Libraries/LibVT/TerminalWidget.h +++ b/Userland/Libraries/LibVT/TerminalWidget.h @@ -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); diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp index 07cda36dae3..4cfcea595c1 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp @@ -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()) { diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.h b/Userland/Libraries/LibWeb/HTML/BrowsingContext.h index 9af4d676591..441aedc9be3 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.h +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.h @@ -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; } diff --git a/Userland/Libraries/LibWeb/Layout/Label.cpp b/Userland/Libraries/LibWeb/Layout/Label.cpp index 7cffc25ae45..8c484c09e05 100644 --- a/Userland/Libraries/LibWeb/Layout/Label.cpp +++ b/Userland/Libraries/LibWeb/Layout/Label.cpp @@ -22,7 +22,7 @@ Label::Label(DOM::Document& document, HTML::HTMLLabelElement* element, NonnullRe Label::~Label() = default; -void Label::handle_mousedown_on_label(Badge, Gfx::IntPoint const&, unsigned button) +void Label::handle_mousedown_on_label(Badge, Gfx::IntPoint, unsigned button) { if (button != GUI::MouseButton::Primary) return; @@ -33,7 +33,7 @@ void Label::handle_mousedown_on_label(Badge, Gfx::IntPo m_tracking_mouse = true; } -void Label::handle_mouseup_on_label(Badge, Gfx::IntPoint const& position, unsigned button) +void Label::handle_mouseup_on_label(Badge, 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, Gfx::IntPoin m_tracking_mouse = false; } -void Label::handle_mousemove_on_label(Badge, Gfx::IntPoint const& position, unsigned) +void Label::handle_mousemove_on_label(Badge, Gfx::IntPoint position, unsigned) { if (!m_tracking_mouse) return; @@ -62,7 +62,7 @@ void Label::handle_mousemove_on_label(Badge, 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); diff --git a/Userland/Libraries/LibWeb/Layout/Label.h b/Userland/Libraries/LibWeb/Layout/Label.h index 37237190469..89806c00c29 100644 --- a/Userland/Libraries/LibWeb/Layout/Label.h +++ b/Userland/Libraries/LibWeb/Layout/Label.h @@ -18,15 +18,15 @@ public: Label(DOM::Document&, HTML::HTMLLabelElement*, NonnullRefPtr); 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(*BlockContainer::dom_node()); } HTML::HTMLLabelElement& dom_node() { return static_cast(*BlockContainer::dom_node()); } - void handle_mousedown_on_label(Badge, Gfx::IntPoint const&, unsigned button); - void handle_mouseup_on_label(Badge, Gfx::IntPoint const&, unsigned button); - void handle_mousemove_on_label(Badge, Gfx::IntPoint const&, unsigned button); + void handle_mousedown_on_label(Badge, Gfx::IntPoint, unsigned button); + void handle_mouseup_on_label(Badge, Gfx::IntPoint, unsigned button); + void handle_mousemove_on_label(Badge, Gfx::IntPoint, unsigned button); LabelableNode* labeled_control(); diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.cpp b/Userland/Libraries/LibWeb/Page/EventHandler.cpp index 880aa7e62c1..329c5b2409f 100644 --- a/Userland/Libraries/LibWeb/Page/EventHandler.cpp +++ b/Userland/Libraries/LibWeb/Page/EventHandler.cpp @@ -102,7 +102,7 @@ static Gfx::StandardCursor cursor_css_to_gfx(Optional 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(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(); diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.h b/Userland/Libraries/LibWeb/Page/EventHandler.h index e5ef43c7e69..71832e5ea39 100644 --- a/Userland/Libraries/LibWeb/Page/EventHandler.h +++ b/Userland/Libraries/LibWeb/Page/EventHandler.h @@ -22,11 +22,11 @@ public: explicit EventHandler(Badge, 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); diff --git a/Userland/Libraries/LibWeb/Page/Page.cpp b/Userland/Libraries/LibWeb/Page/Page.cpp index 55af1eec747..0377bb58ee4 100644 --- a/Userland/Libraries/LibWeb/Page/Page.cpp +++ b/Userland/Libraries/LibWeb/Page/Page.cpp @@ -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); } diff --git a/Userland/Libraries/LibWeb/Page/Page.h b/Userland/Libraries/LibWeb/Page/Page.h index dca9f57b199..0f73fc66d4f 100644 --- a/Userland/Libraries/LibWeb/Page/Page.h +++ b/Userland/Libraries/LibWeb/Page/Page.h @@ -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&) { } diff --git a/Userland/Libraries/LibWeb/Painting/BorderPainting.cpp b/Userland/Libraries/LibWeb/Painting/BorderPainting.cpp index d4a7ff1ffa0..93c8bfdfe7b 100644 --- a/Userland/Libraries/LibWeb/Painting/BorderPainting.cpp +++ b/Userland/Libraries/LibWeb/Painting/BorderPainting.cpp @@ -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); }); diff --git a/Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp b/Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp index 66f469215fd..358956e780d 100644 --- a/Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp @@ -35,7 +35,7 @@ Layout::FormAssociatedLabelableNode& LabelablePaintable::layout_box() return static_cast(PaintableBox::layout_box()); } -LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousedown(Badge, Gfx::IntPoint const&, unsigned button, unsigned) +LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousedown(Badge, 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, Gfx::IntPoint const& position, unsigned button, unsigned) +LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mouseup(Badge, 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, Gfx::IntPoint const& position, unsigned, unsigned) +LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousemove(Badge, Gfx::IntPoint position, unsigned, unsigned) { if (!m_tracking_mouse || !layout_box().dom_node().enabled()) return DispatchEventOfSameName::No; diff --git a/Userland/Libraries/LibWeb/Painting/LabelablePaintable.h b/Userland/Libraries/LibWeb/Painting/LabelablePaintable.h index 520753826cc..7f256f628f0 100644 --- a/Userland/Libraries/LibWeb/Painting/LabelablePaintable.h +++ b/Userland/Libraries/LibWeb/Painting/LabelablePaintable.h @@ -21,9 +21,9 @@ public: Layout::FormAssociatedLabelableNode& layout_box(); virtual bool wants_mouse_events() const override { return true; } - virtual DispatchEventOfSameName handle_mousedown(Badge, Gfx::IntPoint const&, unsigned button, unsigned modifiers) override; - virtual DispatchEventOfSameName handle_mouseup(Badge, Gfx::IntPoint const&, unsigned button, unsigned modifiers) override; - virtual DispatchEventOfSameName handle_mousemove(Badge, Gfx::IntPoint const&, unsigned buttons, unsigned modifiers) override; + virtual DispatchEventOfSameName handle_mousedown(Badge, Gfx::IntPoint, unsigned button, unsigned modifiers) override; + virtual DispatchEventOfSameName handle_mouseup(Badge, Gfx::IntPoint, unsigned button, unsigned modifiers) override; + virtual DispatchEventOfSameName handle_mousemove(Badge, Gfx::IntPoint, unsigned buttons, unsigned modifiers) override; void handle_associated_label_mousedown(Badge); void handle_associated_label_mouseup(Badge); diff --git a/Userland/Libraries/LibWeb/Painting/PaintContext.cpp b/Userland/Libraries/LibWeb/Painting/PaintContext.cpp index de287bf3941..014c56e8440 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintContext.cpp +++ b/Userland/Libraries/LibWeb/Painting/PaintContext.cpp @@ -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) diff --git a/Userland/Libraries/LibWeb/Painting/PaintContext.h b/Userland/Libraries/LibWeb/Painting/PaintContext.h index 457b544ad7c..d8bea98414c 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintContext.h +++ b/Userland/Libraries/LibWeb/Painting/PaintContext.h @@ -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; } diff --git a/Userland/Libraries/LibWeb/Painting/Paintable.cpp b/Userland/Libraries/LibWeb/Painting/Paintable.cpp index ca931544bcf..82307810b37 100644 --- a/Userland/Libraries/LibWeb/Painting/Paintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/Paintable.cpp @@ -10,22 +10,22 @@ namespace Web::Painting { -Paintable::DispatchEventOfSameName Paintable::handle_mousedown(Badge, Gfx::IntPoint const&, unsigned, unsigned) +Paintable::DispatchEventOfSameName Paintable::handle_mousedown(Badge, Gfx::IntPoint, unsigned, unsigned) { return DispatchEventOfSameName::Yes; } -Paintable::DispatchEventOfSameName Paintable::handle_mouseup(Badge, Gfx::IntPoint const&, unsigned, unsigned) +Paintable::DispatchEventOfSameName Paintable::handle_mouseup(Badge, Gfx::IntPoint, unsigned, unsigned) { return DispatchEventOfSameName::Yes; } -Paintable::DispatchEventOfSameName Paintable::handle_mousemove(Badge, Gfx::IntPoint const&, unsigned, unsigned) +Paintable::DispatchEventOfSameName Paintable::handle_mousemove(Badge, Gfx::IntPoint, unsigned, unsigned) { return DispatchEventOfSameName::Yes; } -bool Paintable::handle_mousewheel(Badge, Gfx::IntPoint const&, unsigned, unsigned, int wheel_delta_x, int wheel_delta_y) +bool Paintable::handle_mousewheel(Badge, Gfx::IntPoint, unsigned, unsigned, int wheel_delta_x, int wheel_delta_y) { if (auto* containing_block = this->containing_block()) { if (!containing_block->is_scrollable()) diff --git a/Userland/Libraries/LibWeb/Painting/Paintable.h b/Userland/Libraries/LibWeb/Painting/Paintable.h index 5bdb06e0dd0..c0b335f4cc2 100644 --- a/Userland/Libraries/LibWeb/Painting/Paintable.h +++ b/Userland/Libraries/LibWeb/Painting/Paintable.h @@ -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, Gfx::IntPoint const&, unsigned button, unsigned modifiers); - virtual DispatchEventOfSameName handle_mouseup(Badge, Gfx::IntPoint const&, unsigned button, unsigned modifiers); - virtual DispatchEventOfSameName handle_mousemove(Badge, Gfx::IntPoint const&, unsigned buttons, unsigned modifiers); + virtual DispatchEventOfSameName handle_mousedown(Badge, Gfx::IntPoint, unsigned button, unsigned modifiers); + virtual DispatchEventOfSameName handle_mouseup(Badge, Gfx::IntPoint, unsigned button, unsigned modifiers); + virtual DispatchEventOfSameName handle_mousemove(Badge, Gfx::IntPoint, unsigned buttons, unsigned modifiers); virtual DOM::Node* mouse_event_target() const { return nullptr; } - virtual bool handle_mousewheel(Badge, Gfx::IntPoint const&, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y); + virtual bool handle_mousewheel(Badge, 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(m_layout_node); } diff --git a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp index c54f758d5fb..6bc37f41f6b 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp +++ b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp @@ -630,7 +630,7 @@ void PaintableWithLines::paint(PaintContext& context, PaintPhase phase) const } } -bool PaintableWithLines::handle_mousewheel(Badge, Gfx::IntPoint const&, unsigned, unsigned, int wheel_delta_x, int wheel_delta_y) +bool PaintableWithLines::handle_mousewheel(Badge, Gfx::IntPoint, unsigned, unsigned, int wheel_delta_x, int wheel_delta_y) { if (!layout_box().is_scrollable()) return false; diff --git a/Userland/Libraries/LibWeb/Painting/PaintableBox.h b/Userland/Libraries/LibWeb/Painting/PaintableBox.h index 345c0d6c9d1..fe453aa6b08 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintableBox.h +++ b/Userland/Libraries/LibWeb/Painting/PaintableBox.h @@ -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, Gfx::IntPoint const&, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y) override; + virtual bool handle_mousewheel(Badge, Gfx::IntPoint, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y) override; virtual Optional hit_test(Gfx::FloatPoint const&, HitTestType) const override; diff --git a/Userland/Libraries/LibWeb/Painting/TextPaintable.cpp b/Userland/Libraries/LibWeb/Painting/TextPaintable.cpp index a209e8e4812..726382f6da4 100644 --- a/Userland/Libraries/LibWeb/Painting/TextPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/TextPaintable.cpp @@ -36,7 +36,7 @@ DOM::Node* TextPaintable::mouse_event_target() const return nullptr; } -TextPaintable::DispatchEventOfSameName TextPaintable::handle_mousedown(Badge, Gfx::IntPoint const& position, unsigned button, unsigned) +TextPaintable::DispatchEventOfSameName TextPaintable::handle_mousedown(Badge, Gfx::IntPoint position, unsigned button, unsigned) { auto* label = layout_node().first_ancestor_of_type(); if (!label) @@ -46,7 +46,7 @@ TextPaintable::DispatchEventOfSameName TextPaintable::handle_mousedown(Badge, Gfx::IntPoint const& position, unsigned button, unsigned) +TextPaintable::DispatchEventOfSameName TextPaintable::handle_mouseup(Badge, Gfx::IntPoint position, unsigned button, unsigned) { auto* label = layout_node().first_ancestor_of_type(); if (!label) @@ -57,7 +57,7 @@ TextPaintable::DispatchEventOfSameName TextPaintable::handle_mouseup(Badge, Gfx::IntPoint const& position, unsigned button, unsigned) +TextPaintable::DispatchEventOfSameName TextPaintable::handle_mousemove(Badge, Gfx::IntPoint position, unsigned button, unsigned) { auto* label = layout_node().first_ancestor_of_type(); if (!label) diff --git a/Userland/Libraries/LibWeb/Painting/TextPaintable.h b/Userland/Libraries/LibWeb/Painting/TextPaintable.h index 5c029062bb9..fb0cd302d7c 100644 --- a/Userland/Libraries/LibWeb/Painting/TextPaintable.h +++ b/Userland/Libraries/LibWeb/Painting/TextPaintable.h @@ -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, Gfx::IntPoint const&, unsigned button, unsigned modifiers) override; - virtual DispatchEventOfSameName handle_mouseup(Badge, Gfx::IntPoint const&, unsigned button, unsigned modifiers) override; - virtual DispatchEventOfSameName handle_mousemove(Badge, Gfx::IntPoint const&, unsigned button, unsigned modifiers) override; + virtual DispatchEventOfSameName handle_mousedown(Badge, Gfx::IntPoint, unsigned button, unsigned modifiers) override; + virtual DispatchEventOfSameName handle_mouseup(Badge, Gfx::IntPoint, unsigned button, unsigned modifiers) override; + virtual DispatchEventOfSameName handle_mousemove(Badge, Gfx::IntPoint, unsigned button, unsigned modifiers) override; private: explicit TextPaintable(Layout::TextNode const&); diff --git a/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp b/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp index a9e7953f8d0..e66604135ff 100644 --- a/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp +++ b/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp @@ -252,7 +252,7 @@ void OutOfProcessWebView::notify_server_did_request_scroll(Badge, Gfx::IntPoint const& scroll_position) +void OutOfProcessWebView::notify_server_did_request_scroll_to(Badge, 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, Gfx::IntPoint const&, DeprecatedString const& title) +void OutOfProcessWebView::notify_server_did_enter_tooltip_area(Badge, Gfx::IntPoint, DeprecatedString const& title) { GUI::Application::the()->show_tooltip(title, nullptr); } @@ -330,19 +330,19 @@ void OutOfProcessWebView::notify_server_did_request_refresh(Badge, Gfx::IntPoint const& content_position) +void OutOfProcessWebView::notify_server_did_request_context_menu(Badge, 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, Gfx::IntPoint const& content_position, const AK::URL& url, DeprecatedString const&, unsigned) +void OutOfProcessWebView::notify_server_did_request_link_context_menu(Badge, 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, 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, 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); } diff --git a/Userland/Libraries/LibWebView/OutOfProcessWebView.h b/Userland/Libraries/LibWebView/OutOfProcessWebView.h index f572e6aea59..542a7dedfc0 100644 --- a/Userland/Libraries/LibWebView/OutOfProcessWebView.h +++ b/Userland/Libraries/LibWebView/OutOfProcessWebView.h @@ -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 on_context_menu_request; + Function on_context_menu_request; Function on_link_click; - Function on_link_context_menu_request; - Function on_image_context_menu_request; + Function on_link_context_menu_request; + Function on_image_context_menu_request; Function on_link_middle_click; Function on_link_hover; Function on_title_change; @@ -106,7 +106,7 @@ public: Function on_update_cookie; Function on_resource_status_change; Function on_restore_window; - Function on_reposition_window; + Function on_reposition_window; Function on_resize_window; Function on_maximize_window; Function on_minimize_window; @@ -143,9 +143,9 @@ private: virtual void notify_server_did_request_cursor_change(Badge, Gfx::StandardCursor cursor) override; virtual void notify_server_did_change_title(Badge, DeprecatedString const&) override; virtual void notify_server_did_request_scroll(Badge, i32, i32) override; - virtual void notify_server_did_request_scroll_to(Badge, Gfx::IntPoint const&) override; + virtual void notify_server_did_request_scroll_to(Badge, Gfx::IntPoint) override; virtual void notify_server_did_request_scroll_into_view(Badge, Gfx::IntRect const&) override; - virtual void notify_server_did_enter_tooltip_area(Badge, Gfx::IntPoint const&, DeprecatedString const&) override; + virtual void notify_server_did_enter_tooltip_area(Badge, Gfx::IntPoint, DeprecatedString const&) override; virtual void notify_server_did_leave_tooltip_area(Badge) override; virtual void notify_server_did_hover_link(Badge, const AK::URL&) override; virtual void notify_server_did_unhover_link(Badge) override; @@ -156,9 +156,9 @@ private: virtual void notify_server_did_request_navigate_back(Badge) override; virtual void notify_server_did_request_navigate_forward(Badge) override; virtual void notify_server_did_request_refresh(Badge) override; - virtual void notify_server_did_request_context_menu(Badge, Gfx::IntPoint const&) override; - virtual void notify_server_did_request_link_context_menu(Badge, Gfx::IntPoint const&, const AK::URL&, DeprecatedString const& target, unsigned modifiers) override; - virtual void notify_server_did_request_image_context_menu(Badge, Gfx::IntPoint const&, const AK::URL&, DeprecatedString const& target, unsigned modifiers, Gfx::ShareableBitmap const&) override; + virtual void notify_server_did_request_context_menu(Badge, Gfx::IntPoint) override; + virtual void notify_server_did_request_link_context_menu(Badge, Gfx::IntPoint, const AK::URL&, DeprecatedString const& target, unsigned modifiers) override; + virtual void notify_server_did_request_image_context_menu(Badge, Gfx::IntPoint, const AK::URL&, DeprecatedString const& target, unsigned modifiers, Gfx::ShareableBitmap const&) override; virtual void notify_server_did_request_alert(Badge, DeprecatedString const& message) override; virtual void notify_server_did_request_confirm(Badge, DeprecatedString const& message) override; virtual void notify_server_did_request_prompt(Badge, DeprecatedString const& message, DeprecatedString const& default_) override; @@ -178,7 +178,7 @@ private: virtual void notify_server_did_update_cookie(Badge, 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; diff --git a/Userland/Libraries/LibWebView/ViewImplementation.h b/Userland/Libraries/LibWebView/ViewImplementation.h index 9daac990722..89c0dd9a3a0 100644 --- a/Userland/Libraries/LibWebView/ViewImplementation.h +++ b/Userland/Libraries/LibWebView/ViewImplementation.h @@ -25,9 +25,9 @@ public: virtual void notify_server_did_request_cursor_change(Badge, Gfx::StandardCursor cursor) = 0; virtual void notify_server_did_change_title(Badge, DeprecatedString const&) = 0; virtual void notify_server_did_request_scroll(Badge, i32, i32) = 0; - virtual void notify_server_did_request_scroll_to(Badge, Gfx::IntPoint const&) = 0; + virtual void notify_server_did_request_scroll_to(Badge, Gfx::IntPoint) = 0; virtual void notify_server_did_request_scroll_into_view(Badge, Gfx::IntRect const&) = 0; - virtual void notify_server_did_enter_tooltip_area(Badge, Gfx::IntPoint const&, DeprecatedString const&) = 0; + virtual void notify_server_did_enter_tooltip_area(Badge, Gfx::IntPoint, DeprecatedString const&) = 0; virtual void notify_server_did_leave_tooltip_area(Badge) = 0; virtual void notify_server_did_hover_link(Badge, const AK::URL&) = 0; virtual void notify_server_did_unhover_link(Badge) = 0; @@ -38,9 +38,9 @@ public: virtual void notify_server_did_request_navigate_back(Badge) = 0; virtual void notify_server_did_request_navigate_forward(Badge) = 0; virtual void notify_server_did_request_refresh(Badge) = 0; - virtual void notify_server_did_request_context_menu(Badge, Gfx::IntPoint const&) = 0; - virtual void notify_server_did_request_link_context_menu(Badge, Gfx::IntPoint const&, const AK::URL&, DeprecatedString const& target, unsigned modifiers) = 0; - virtual void notify_server_did_request_image_context_menu(Badge, Gfx::IntPoint const&, const AK::URL&, DeprecatedString const& target, unsigned modifiers, Gfx::ShareableBitmap const&) = 0; + virtual void notify_server_did_request_context_menu(Badge, Gfx::IntPoint) = 0; + virtual void notify_server_did_request_link_context_menu(Badge, Gfx::IntPoint, const AK::URL&, DeprecatedString const& target, unsigned modifiers) = 0; + virtual void notify_server_did_request_image_context_menu(Badge, Gfx::IntPoint, const AK::URL&, DeprecatedString const& target, unsigned modifiers, Gfx::ShareableBitmap const&) = 0; virtual void notify_server_did_request_alert(Badge, DeprecatedString const& message) = 0; virtual void notify_server_did_request_confirm(Badge, DeprecatedString const& message) = 0; virtual void notify_server_did_request_prompt(Badge, DeprecatedString const& message, DeprecatedString const& default_) = 0; @@ -60,7 +60,7 @@ public: virtual void notify_server_did_update_cookie(Badge, 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; diff --git a/Userland/Libraries/LibWebView/WebContentClient.cpp b/Userland/Libraries/LibWebView/WebContentClient.cpp index 1f26921b147..fe055fa2d09 100644 --- a/Userland/Libraries/LibWebView/WebContentClient.cpp +++ b/Userland/Libraries/LibWebView/WebContentClient.cpp @@ -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); } diff --git a/Userland/Libraries/LibWebView/WebContentClient.h b/Userland/Libraries/LibWebView/WebContentClient.h index a2e5ccdacbc..79d0b245bd1 100644 --- a/Userland/Libraries/LibWebView/WebContentClient.h +++ b/Userland/Libraries/LibWebView/WebContentClient.h @@ -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; diff --git a/Userland/Services/WebContent/ConnectionFromClient.cpp b/Userland/Services/WebContent/ConnectionFromClient.cpp index eb65517bd6b..f0c14c16680 100644 --- a/Userland/Services/WebContent/ConnectionFromClient.cpp +++ b/Userland/Services/WebContent/ConnectionFromClient.cpp @@ -155,27 +155,27 @@ void ConnectionFromClient::flush_pending_paint_requests() m_pending_paint_requests.clear(); } -void ConnectionFromClient::mouse_down(Gfx::IntPoint const& position, unsigned int button, unsigned int buttons, unsigned int modifiers) +void ConnectionFromClient::mouse_down(Gfx::IntPoint position, unsigned int button, unsigned int buttons, unsigned int modifiers) { report_finished_handling_input_event(page().handle_mousedown(position, button, buttons, modifiers)); } -void ConnectionFromClient::mouse_move(Gfx::IntPoint const& position, [[maybe_unused]] unsigned int button, unsigned int buttons, unsigned int modifiers) +void ConnectionFromClient::mouse_move(Gfx::IntPoint position, [[maybe_unused]] unsigned int button, unsigned int buttons, unsigned int modifiers) { report_finished_handling_input_event(page().handle_mousemove(position, buttons, modifiers)); } -void ConnectionFromClient::mouse_up(Gfx::IntPoint const& position, unsigned int button, unsigned int buttons, unsigned int modifiers) +void ConnectionFromClient::mouse_up(Gfx::IntPoint position, unsigned int button, unsigned int buttons, unsigned int modifiers) { report_finished_handling_input_event(page().handle_mouseup(position, button, buttons, modifiers)); } -void ConnectionFromClient::mouse_wheel(Gfx::IntPoint const& position, unsigned int button, unsigned int buttons, unsigned int modifiers, i32 wheel_delta_x, i32 wheel_delta_y) +void ConnectionFromClient::mouse_wheel(Gfx::IntPoint position, unsigned int button, unsigned int buttons, unsigned int modifiers, i32 wheel_delta_x, i32 wheel_delta_y) { report_finished_handling_input_event(page().handle_mousewheel(position, button, buttons, modifiers, wheel_delta_x, wheel_delta_y)); } -void ConnectionFromClient::doubleclick(Gfx::IntPoint const& position, unsigned int button, unsigned int buttons, unsigned int modifiers) +void ConnectionFromClient::doubleclick(Gfx::IntPoint position, unsigned int button, unsigned int buttons, unsigned int modifiers) { report_finished_handling_input_event(page().handle_doubleclick(position, button, buttons, modifiers)); } @@ -530,7 +530,7 @@ void ConnectionFromClient::set_is_scripting_enabled(bool is_scripting_enabled) m_page_host->set_is_scripting_enabled(is_scripting_enabled); } -void ConnectionFromClient::set_window_position(Gfx::IntPoint const& position) +void ConnectionFromClient::set_window_position(Gfx::IntPoint position) { m_page_host->set_window_position(position); } diff --git a/Userland/Services/WebContent/ConnectionFromClient.h b/Userland/Services/WebContent/ConnectionFromClient.h index 5ee19931db9..4b832fa8674 100644 --- a/Userland/Services/WebContent/ConnectionFromClient.h +++ b/Userland/Services/WebContent/ConnectionFromClient.h @@ -55,11 +55,11 @@ private: virtual void load_html(DeprecatedString const&, URL const&) override; virtual void paint(Gfx::IntRect const&, i32) override; virtual void set_viewport_rect(Gfx::IntRect const&) override; - virtual void mouse_down(Gfx::IntPoint const&, unsigned, unsigned, unsigned) override; - virtual void mouse_move(Gfx::IntPoint const&, unsigned, unsigned, unsigned) override; - virtual void mouse_up(Gfx::IntPoint const&, unsigned, unsigned, unsigned) override; - virtual void mouse_wheel(Gfx::IntPoint const&, unsigned, unsigned, unsigned, i32, i32) override; - virtual void doubleclick(Gfx::IntPoint const&, unsigned, unsigned, unsigned) override; + virtual void mouse_down(Gfx::IntPoint, unsigned, unsigned, unsigned) override; + virtual void mouse_move(Gfx::IntPoint, unsigned, unsigned, unsigned) override; + virtual void mouse_up(Gfx::IntPoint, unsigned, unsigned, unsigned) override; + virtual void mouse_wheel(Gfx::IntPoint, unsigned, unsigned, unsigned, i32, i32) override; + virtual void doubleclick(Gfx::IntPoint, unsigned, unsigned, unsigned) override; virtual void key_down(i32, unsigned, u32) override; virtual void key_up(i32, unsigned, u32) override; virtual void add_backing_store(i32, Gfx::ShareableBitmap const&) override; @@ -75,7 +75,7 @@ private: virtual void set_preferred_color_scheme(Web::CSS::PreferredColorScheme const&) override; virtual void set_has_focus(bool) override; virtual void set_is_scripting_enabled(bool) override; - virtual void set_window_position(Gfx::IntPoint const&) override; + virtual void set_window_position(Gfx::IntPoint) override; virtual void set_window_size(Gfx::IntSize const&) override; virtual void handle_file_return(i32 error, Optional const& file, i32 request_id) override; virtual void set_system_visibility_state(bool visible) override; diff --git a/Userland/Services/WebContent/PageHost.cpp b/Userland/Services/WebContent/PageHost.cpp index d57f1443a58..bdf76251ff1 100644 --- a/Userland/Services/WebContent/PageHost.cpp +++ b/Userland/Services/WebContent/PageHost.cpp @@ -79,7 +79,7 @@ void PageHost::set_is_scripting_enabled(bool is_scripting_enabled) page().set_is_scripting_enabled(is_scripting_enabled); } -void PageHost::set_window_position(Gfx::IntPoint const& position) +void PageHost::set_window_position(Gfx::IntPoint position) { page().set_window_position(position); } @@ -183,7 +183,7 @@ Gfx::IntSize PageHost::page_did_request_resize_window(Gfx::IntSize const& size) return m_client.did_request_resize_window(size); } -Gfx::IntPoint PageHost::page_did_request_reposition_window(Gfx::IntPoint const& position) +Gfx::IntPoint PageHost::page_did_request_reposition_window(Gfx::IntPoint position) { return m_client.did_request_reposition_window(position); } @@ -213,7 +213,7 @@ void PageHost::page_did_request_scroll(i32 x_delta, i32 y_delta) m_client.async_did_request_scroll(x_delta, y_delta); } -void PageHost::page_did_request_scroll_to(Gfx::IntPoint const& scroll_position) +void PageHost::page_did_request_scroll_to(Gfx::IntPoint scroll_position) { m_client.async_did_request_scroll_to(scroll_position); } @@ -223,7 +223,7 @@ void PageHost::page_did_request_scroll_into_view(Gfx::IntRect const& rect) m_client.async_did_request_scroll_into_view(rect); } -void PageHost::page_did_enter_tooltip_area(Gfx::IntPoint const& content_position, DeprecatedString const& title) +void PageHost::page_did_enter_tooltip_area(Gfx::IntPoint content_position, DeprecatedString const& title) { m_client.async_did_enter_tooltip_area(content_position, title); } @@ -268,12 +268,12 @@ void PageHost::page_did_finish_loading(const URL& url) m_client.async_did_finish_loading(url); } -void PageHost::page_did_request_context_menu(Gfx::IntPoint const& content_position) +void PageHost::page_did_request_context_menu(Gfx::IntPoint content_position) { m_client.async_did_request_context_menu(content_position); } -void PageHost::page_did_request_link_context_menu(Gfx::IntPoint const& content_position, const URL& url, DeprecatedString const& target, unsigned modifiers) +void PageHost::page_did_request_link_context_menu(Gfx::IntPoint content_position, const URL& url, DeprecatedString const& target, unsigned modifiers) { m_client.async_did_request_link_context_menu(content_position, url, target, modifiers); } @@ -328,7 +328,7 @@ void PageHost::page_did_change_favicon(Gfx::Bitmap const& favicon) m_client.async_did_change_favicon(favicon.to_shareable_bitmap()); } -void PageHost::page_did_request_image_context_menu(Gfx::IntPoint const& content_position, const URL& url, DeprecatedString const& target, unsigned modifiers, Gfx::Bitmap const* bitmap_pointer) +void PageHost::page_did_request_image_context_menu(Gfx::IntPoint content_position, const URL& url, DeprecatedString const& target, unsigned modifiers, Gfx::Bitmap const* bitmap_pointer) { auto bitmap = bitmap_pointer ? bitmap_pointer->to_shareable_bitmap() : Gfx::ShareableBitmap(); m_client.async_did_request_image_context_menu(content_position, url, target, modifiers, bitmap); diff --git a/Userland/Services/WebContent/PageHost.h b/Userland/Services/WebContent/PageHost.h index 510eb8524c8..ac1f5cd31a4 100644 --- a/Userland/Services/WebContent/PageHost.h +++ b/Userland/Services/WebContent/PageHost.h @@ -35,7 +35,7 @@ public: void set_should_show_line_box_borders(bool b) { m_should_show_line_box_borders = b; } void set_has_focus(bool); void set_is_scripting_enabled(bool); - void set_window_position(Gfx::IntPoint const&); + void set_window_position(Gfx::IntPoint); void set_window_size(Gfx::IntSize const&); Gfx::IntSize const& content_size() const { return m_content_size; } @@ -61,22 +61,22 @@ private: virtual void page_did_request_navigate_forward() override; virtual void page_did_request_refresh() override; virtual Gfx::IntSize page_did_request_resize_window(Gfx::IntSize const&) override; - virtual Gfx::IntPoint page_did_request_reposition_window(Gfx::IntPoint const&) override; + virtual Gfx::IntPoint page_did_request_reposition_window(Gfx::IntPoint) override; virtual void page_did_request_restore_window() override; virtual Gfx::IntRect page_did_request_maximize_window() override; virtual Gfx::IntRect page_did_request_minimize_window() override; virtual Gfx::IntRect page_did_request_fullscreen_window() override; virtual void page_did_request_scroll(i32, i32) override; - virtual void page_did_request_scroll_to(Gfx::IntPoint const&) override; + virtual void page_did_request_scroll_to(Gfx::IntPoint) override; virtual void page_did_request_scroll_into_view(Gfx::IntRect const&) override; - virtual void page_did_enter_tooltip_area(Gfx::IntPoint const&, DeprecatedString const&) override; + virtual void page_did_enter_tooltip_area(Gfx::IntPoint, DeprecatedString const&) override; virtual void page_did_leave_tooltip_area() override; virtual void page_did_hover_link(const URL&) override; virtual void page_did_unhover_link() override; virtual void page_did_click_link(const URL&, DeprecatedString const& target, unsigned modifiers) override; virtual void page_did_middle_click_link(const URL&, DeprecatedString const& target, unsigned modifiers) override; - virtual void page_did_request_context_menu(Gfx::IntPoint const&) override; - virtual void page_did_request_link_context_menu(Gfx::IntPoint const&, const URL&, DeprecatedString const& target, unsigned modifiers) override; + virtual void page_did_request_context_menu(Gfx::IntPoint) override; + virtual void page_did_request_link_context_menu(Gfx::IntPoint, const URL&, DeprecatedString const& target, unsigned modifiers) override; virtual void page_did_start_loading(const URL&, bool) override; virtual void page_did_create_main_document() override; virtual void page_did_finish_loading(const URL&) override; @@ -87,7 +87,7 @@ private: virtual void page_did_request_accept_dialog() override; virtual void page_did_request_dismiss_dialog() override; virtual void page_did_change_favicon(Gfx::Bitmap const&) override; - virtual void page_did_request_image_context_menu(Gfx::IntPoint const&, const URL&, DeprecatedString const& target, unsigned modifiers, Gfx::Bitmap const*) override; + virtual void page_did_request_image_context_menu(Gfx::IntPoint, const URL&, DeprecatedString const& target, unsigned modifiers, Gfx::Bitmap const*) override; virtual Vector page_did_request_all_cookies(URL const&) override; virtual Optional page_did_request_named_cookie(URL const&, DeprecatedString const&) override; virtual DeprecatedString page_did_request_cookie(const URL&, Web::Cookie::Source) override; diff --git a/Userland/Services/WindowServer/AppletManager.cpp b/Userland/Services/WindowServer/AppletManager.cpp index 76bccae8e42..14dc4c5513c 100644 --- a/Userland/Services/WindowServer/AppletManager.cpp +++ b/Userland/Services/WindowServer/AppletManager.cpp @@ -31,7 +31,7 @@ AppletManager& AppletManager::the() return *s_the; } -void AppletManager::set_position(Gfx::IntPoint const& position) +void AppletManager::set_position(Gfx::IntPoint position) { m_window->move_to(position); m_window->set_visible(true); diff --git a/Userland/Services/WindowServer/AppletManager.h b/Userland/Services/WindowServer/AppletManager.h index 6bdfb6eadd9..0b1eaae4106 100644 --- a/Userland/Services/WindowServer/AppletManager.h +++ b/Userland/Services/WindowServer/AppletManager.h @@ -26,7 +26,7 @@ public: void invalidate_applet(Window const& applet, Gfx::IntRect const& rect); void relayout(); - void set_position(Gfx::IntPoint const&); + void set_position(Gfx::IntPoint); Window* window() { return m_window; } Window const* window() const { return m_window; } diff --git a/Userland/Services/WindowServer/Compositor.cpp b/Userland/Services/WindowServer/Compositor.cpp index 5ea6e49f0a4..e3997d8b3a7 100644 --- a/Userland/Services/WindowServer/Compositor.cpp +++ b/Userland/Services/WindowServer/Compositor.cpp @@ -79,7 +79,7 @@ Gfx::Bitmap const& Compositor::front_bitmap_for_screenshot(Badge, Screen& screen, Gfx::IntPoint const& position) const +Gfx::Color Compositor::color_at_position(Badge, Screen& screen, Gfx::IntPoint position) const { return screen.compositor_screen_data().m_front_bitmap->get_pixel(position); } diff --git a/Userland/Services/WindowServer/Compositor.h b/Userland/Services/WindowServer/Compositor.h index 83367c78321..6862f1270ec 100644 --- a/Userland/Services/WindowServer/Compositor.h +++ b/Userland/Services/WindowServer/Compositor.h @@ -180,7 +180,7 @@ public: Gfx::Bitmap const* cursor_bitmap_for_screenshot(Badge, Screen&) const; Gfx::Bitmap const& front_bitmap_for_screenshot(Badge, Screen&) const; - Gfx::Color color_at_position(Badge, Screen&, Gfx::IntPoint const&) const; + Gfx::Color color_at_position(Badge, Screen&, Gfx::IntPoint) const; void register_animation(Badge, Animation&); void unregister_animation(Badge, Animation&); diff --git a/Userland/Services/WindowServer/ConnectionFromClient.cpp b/Userland/Services/WindowServer/ConnectionFromClient.cpp index 1025c2e101b..8d980efc6b4 100644 --- a/Userland/Services/WindowServer/ConnectionFromClient.cpp +++ b/Userland/Services/WindowServer/ConnectionFromClient.cpp @@ -145,7 +145,7 @@ void ConnectionFromClient::add_menu_item(i32 menu_id, i32 identifier, i32 submen menu.add_item(move(menu_item)); } -void ConnectionFromClient::popup_menu(i32 menu_id, Gfx::IntPoint const& screen_position, Gfx::IntRect const& button_rect) +void ConnectionFromClient::popup_menu(i32 menu_id, Gfx::IntPoint screen_position, Gfx::IntRect const& button_rect) { auto position = screen_position; auto it = m_menus.find(menu_id); @@ -1040,7 +1040,7 @@ void ConnectionFromClient::pong() set_unresponsive(false); } -void ConnectionFromClient::set_global_cursor_position(Gfx::IntPoint const& position) +void ConnectionFromClient::set_global_cursor_position(Gfx::IntPoint position) { if (!Screen::main().rect().contains(position)) { did_misbehave("SetGlobalCursorPosition with bad position"); diff --git a/Userland/Services/WindowServer/ConnectionFromClient.h b/Userland/Services/WindowServer/ConnectionFromClient.h index 019dfabb3e9..3b2dff76bea 100644 --- a/Userland/Services/WindowServer/ConnectionFromClient.h +++ b/Userland/Services/WindowServer/ConnectionFromClient.h @@ -140,7 +140,7 @@ private: virtual void show_screen_numbers(bool) override; virtual void set_window_cursor(i32, i32) override; virtual void set_window_custom_cursor(i32, Gfx::ShareableBitmap const&) override; - virtual void popup_menu(i32, Gfx::IntPoint const&, Gfx::IntRect const&) override; + virtual void popup_menu(i32, Gfx::IntPoint, Gfx::IntRect const&) override; virtual void dismiss_menu(i32) override; virtual void set_window_icon_bitmap(i32, Gfx::ShareableBitmap const&) override; virtual Messages::WindowServer::StartDragResponse start_drag(DeprecatedString const&, HashMap const&, Gfx::ShareableBitmap const&) override; @@ -166,7 +166,7 @@ private: virtual void set_window_progress(i32, Optional const&) override; virtual void refresh_system_theme() override; virtual void pong() override; - virtual void set_global_cursor_position(Gfx::IntPoint const&) override; + virtual void set_global_cursor_position(Gfx::IntPoint) override; virtual Messages::WindowServer::GetGlobalCursorPositionResponse get_global_cursor_position() override; virtual void set_mouse_acceleration(float) override; virtual Messages::WindowServer::GetMouseAccelerationResponse get_mouse_acceleration() override; diff --git a/Userland/Services/WindowServer/Event.h b/Userland/Services/WindowServer/Event.h index 89419534417..add41600768 100644 --- a/Userland/Services/WindowServer/Event.h +++ b/Userland/Services/WindowServer/Event.h @@ -89,7 +89,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 = 0, int wheel_delta_y = 0, int wheel_raw_delta_x = 0, int wheel_raw_delta_y = 0) + MouseEvent(Type type, Gfx::IntPoint position, unsigned buttons, MouseButton button, unsigned modifiers, int wheel_delta_x = 0, int wheel_delta_y = 0, int wheel_raw_delta_x = 0, int wheel_raw_delta_y = 0) : Event(type) , m_position(position) , m_buttons(buttons) @@ -102,7 +102,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; } @@ -124,7 +124,7 @@ public: void set_drag(bool b) { m_drag = b; } void set_mime_data(Core::MimeData const& mime_data) { m_mime_data = mime_data; } - MouseEvent translated(Gfx::IntPoint const& delta) const + MouseEvent translated(Gfx::IntPoint delta) const { MouseEvent event = *this; event.m_position = m_position.translated(delta); diff --git a/Userland/Services/WindowServer/Menu.cpp b/Userland/Services/WindowServer/Menu.cpp index 2d5ecad4d99..1f0183f5a60 100644 --- a/Userland/Services/WindowServer/Menu.cpp +++ b/Userland/Services/WindowServer/Menu.cpp @@ -112,7 +112,7 @@ void Menu::redraw(MenuItem const& menu_item) menu_window()->invalidate(menu_item.rect()); } -Window& Menu::ensure_menu_window(Gfx::IntPoint const& position) +Window& Menu::ensure_menu_window(Gfx::IntPoint position) { auto& screen = Screen::closest_to_location(position); int width = this->content_width(); @@ -575,7 +575,7 @@ bool Menu::remove_item_with_identifier(unsigned identifier) return m_items.remove_first_matching([&](auto& item) { return item->identifier() == identifier; }); } -int Menu::item_index_at(Gfx::IntPoint const& position) +int Menu::item_index_at(Gfx::IntPoint position) { int i = 0; for (auto& item : m_items) { @@ -597,7 +597,7 @@ void Menu::redraw_if_theme_changed() redraw(); } -void Menu::open_button_menu(Gfx::IntPoint const& position, Gfx::IntRect const& button_rect) +void Menu::open_button_menu(Gfx::IntPoint position, Gfx::IntRect const& button_rect) { if (is_empty()) return; @@ -618,12 +618,12 @@ void Menu::open_button_menu(Gfx::IntPoint const& position, Gfx::IntRect const& b WindowManager::the().did_popup_a_menu({}); } -void Menu::popup(Gfx::IntPoint const& position) +void Menu::popup(Gfx::IntPoint position) { do_popup(position, true); } -void Menu::do_popup(Gfx::IntPoint const& position, bool make_input, bool as_submenu) +void Menu::do_popup(Gfx::IntPoint position, bool make_input, bool as_submenu) { if (is_empty()) { dbgln("Menu: Empty menu popup"); diff --git a/Userland/Services/WindowServer/Menu.h b/Userland/Services/WindowServer/Menu.h index 78f888c0f04..3bec0dceadb 100644 --- a/Userland/Services/WindowServer/Menu.h +++ b/Userland/Services/WindowServer/Menu.h @@ -76,10 +76,10 @@ public: void set_rect_in_window_menubar(Gfx::IntRect const& rect) { m_rect_in_window_menubar = rect; } Gfx::IntPoint unadjusted_position() const { return m_unadjusted_position; } - void set_unadjusted_position(Gfx::IntPoint const& position) { m_unadjusted_position = position; } + void set_unadjusted_position(Gfx::IntPoint position) { m_unadjusted_position = position; } Window* menu_window() { return m_menu_window.ptr(); } - Window& ensure_menu_window(Gfx::IntPoint const&); + Window& ensure_menu_window(Gfx::IntPoint); Window* window_menu_of() { return m_window_menu_of; } void set_window_menu_of(Window& window) { m_window_menu_of = window; } @@ -118,9 +118,9 @@ public: void set_visible(bool); - void popup(Gfx::IntPoint const&); - void do_popup(Gfx::IntPoint const&, bool make_input, bool as_submenu = false); - void open_button_menu(Gfx::IntPoint const& position, Gfx::IntRect const& button_rect); + void popup(Gfx::IntPoint); + void do_popup(Gfx::IntPoint, bool make_input, bool as_submenu = false); + void open_button_menu(Gfx::IntPoint position, Gfx::IntRect const& button_rect); bool is_menu_ancestor_of(Menu const&) const; @@ -143,7 +143,7 @@ private: size_t visible_item_count() const; Gfx::IntRect stripe_rect(); - int item_index_at(Gfx::IntPoint const&); + int item_index_at(Gfx::IntPoint); static constexpr int padding_between_text_and_shortcut() { return 50; } void did_activate(MenuItem&, bool leave_menu_open); void update_for_new_hovered_item(bool make_input = false); diff --git a/Userland/Services/WindowServer/Screen.cpp b/Userland/Services/WindowServer/Screen.cpp index 7737fe288ba..6b7f0ed2928 100644 --- a/Userland/Services/WindowServer/Screen.cpp +++ b/Userland/Services/WindowServer/Screen.cpp @@ -293,7 +293,7 @@ Screen& Screen::closest_to_rect(Gfx::IntRect const& rect) return *best_screen; } -Screen& Screen::closest_to_location(Gfx::IntPoint const& point) +Screen& Screen::closest_to_location(Gfx::IntPoint point) { for (auto& screen : s_screens) { if (screen.rect().contains(point)) diff --git a/Userland/Services/WindowServer/Screen.h b/Userland/Services/WindowServer/Screen.h index 717c34d3b38..5af406280e0 100644 --- a/Userland/Services/WindowServer/Screen.h +++ b/Userland/Services/WindowServer/Screen.h @@ -92,7 +92,7 @@ public: } static Screen& closest_to_rect(Gfx::IntRect const&); - static Screen& closest_to_location(Gfx::IntPoint const&); + static Screen& closest_to_location(Gfx::IntPoint); static Screen* find_by_index(size_t index) { @@ -109,7 +109,7 @@ public: return rects; } - static Screen* find_by_location(Gfx::IntPoint const& point) + static Screen* find_by_location(Gfx::IntPoint point) { for (auto& screen : s_screens) { if (screen.rect().contains(point)) diff --git a/Userland/Services/WindowServer/WMConnectionFromClient.cpp b/Userland/Services/WindowServer/WMConnectionFromClient.cpp index 34ec29a5b10..90fac011bba 100644 --- a/Userland/Services/WindowServer/WMConnectionFromClient.cpp +++ b/Userland/Services/WindowServer/WMConnectionFromClient.cpp @@ -33,7 +33,7 @@ void WMConnectionFromClient::die() }); } -void WMConnectionFromClient::set_applet_area_position(Gfx::IntPoint const& position) +void WMConnectionFromClient::set_applet_area_position(Gfx::IntPoint position) { if (m_window_id < 0) { did_misbehave("SetAppletAreaPosition: WM didn't assign window as manager yet"); @@ -66,7 +66,7 @@ void WMConnectionFromClient::set_active_window(i32 client_id, i32 window_id) WindowManager::the().move_to_front_and_make_active(window); } -void WMConnectionFromClient::popup_window_menu(i32 client_id, i32 window_id, Gfx::IntPoint const& screen_position) +void WMConnectionFromClient::popup_window_menu(i32 client_id, i32 window_id, Gfx::IntPoint screen_position) { auto* client = WindowServer::ConnectionFromClient::from_client_id(client_id); if (!client) { diff --git a/Userland/Services/WindowServer/WMConnectionFromClient.h b/Userland/Services/WindowServer/WMConnectionFromClient.h index 55173dc7f98..731f1f52797 100644 --- a/Userland/Services/WindowServer/WMConnectionFromClient.h +++ b/Userland/Services/WindowServer/WMConnectionFromClient.h @@ -25,9 +25,9 @@ public: virtual void set_window_minimized(i32, i32, bool) override; virtual void toggle_show_desktop() override; virtual void start_window_resize(i32, i32, i32) override; - virtual void popup_window_menu(i32, i32, Gfx::IntPoint const&) override; + virtual void popup_window_menu(i32, i32, Gfx::IntPoint) override; virtual void set_window_taskbar_rect(i32, i32, Gfx::IntRect const&) override; - virtual void set_applet_area_position(Gfx::IntPoint const&) override; + virtual void set_applet_area_position(Gfx::IntPoint) override; virtual void set_event_mask(u32) override; virtual void set_manager_window(i32) override; virtual void set_workspace(u32, u32) override; diff --git a/Userland/Services/WindowServer/Window.cpp b/Userland/Services/WindowServer/Window.cpp index 57ec4825144..378c738cbe8 100644 --- a/Userland/Services/WindowServer/Window.cpp +++ b/Userland/Services/WindowServer/Window.cpp @@ -787,7 +787,7 @@ void Window::handle_window_menu_action(WindowMenuAction action) } } -void Window::popup_window_menu(Gfx::IntPoint const& position, WindowMenuDefaultAction default_action) +void Window::popup_window_menu(Gfx::IntPoint position, WindowMenuDefaultAction default_action) { ensure_window_menu(); if (default_action == WindowMenuDefaultAction::BasedOnWindowState) { @@ -999,7 +999,7 @@ bool Window::is_descendant_of(Window& window) const return false; } -Optional Window::hit_test(Gfx::IntPoint const& position, bool include_frame) +Optional Window::hit_test(Gfx::IntPoint position, bool include_frame) { if (!m_hit_testing_enabled) return {}; diff --git a/Userland/Services/WindowServer/Window.h b/Userland/Services/WindowServer/Window.h index 100411e9477..43d0816e22f 100644 --- a/Userland/Services/WindowServer/Window.h +++ b/Userland/Services/WindowServer/Window.h @@ -89,7 +89,7 @@ public: bool is_modified() const { return m_modified; } void set_modified(bool); - void popup_window_menu(Gfx::IntPoint const&, WindowMenuDefaultAction); + void popup_window_menu(Gfx::IntPoint, WindowMenuDefaultAction); void handle_window_menu_action(WindowMenuAction); void window_menu_activate_default(); void request_close(); @@ -166,7 +166,7 @@ public: m_alpha_hit_threshold = threshold; } - Optional hit_test(Gfx::IntPoint const&, bool include_frame = true); + Optional hit_test(Gfx::IntPoint, bool include_frame = true); int x() const { return m_rect.x(); } int y() const { return m_rect.y(); } @@ -201,14 +201,14 @@ public: void set_taskbar_rect(Gfx::IntRect const&); Gfx::IntRect const& taskbar_rect() const { return m_taskbar_rect; } - void move_to(Gfx::IntPoint const& position) { set_rect({ position, size() }); } + void move_to(Gfx::IntPoint position) { set_rect({ position, size() }); } void move_to(int x, int y) { move_to({ x, y }); } - void move_by(Gfx::IntPoint const& delta) { set_position_without_repaint(position().translated(delta)); } + void move_by(Gfx::IntPoint delta) { set_position_without_repaint(position().translated(delta)); } Gfx::IntPoint position() const { return m_rect.location(); } - void set_position(Gfx::IntPoint const& position) { set_rect({ position.x(), position.y(), width(), height() }); } - void set_position_without_repaint(Gfx::IntPoint const& position) { set_rect_without_repaint({ position.x(), position.y(), width(), height() }); } + void set_position(Gfx::IntPoint position) { set_rect({ position.x(), position.y(), width(), height() }); } + void set_position_without_repaint(Gfx::IntPoint position) { set_rect_without_repaint({ position.x(), position.y(), width(), height() }); } Gfx::IntSize size() const { return m_rect.size(); } diff --git a/Userland/Services/WindowServer/WindowFrame.cpp b/Userland/Services/WindowServer/WindowFrame.cpp index 0dfb480949b..4bea34055a9 100644 --- a/Userland/Services/WindowServer/WindowFrame.cpp +++ b/Userland/Services/WindowServer/WindowFrame.cpp @@ -680,7 +680,7 @@ void WindowFrame::layout_buttons() m_buttons[i].set_relative_rect(button_rects[i]); } -Optional WindowFrame::hit_test(Gfx::IntPoint const& position) +Optional WindowFrame::hit_test(Gfx::IntPoint position) { if (m_window.is_frameless() || m_window.is_fullscreen()) return {}; @@ -706,7 +706,7 @@ Optional WindowFrame::hit_test(Gfx::IntPoint const& position) return cached->hit_test(*this, position, window_relative_position); } -Optional WindowFrame::PerScaleRenderedCache::hit_test(WindowFrame& frame, Gfx::IntPoint const& position, Gfx::IntPoint const& window_relative_position) +Optional WindowFrame::PerScaleRenderedCache::hit_test(WindowFrame& frame, Gfx::IntPoint position, Gfx::IntPoint window_relative_position) { HitTestResult result { .window = frame.window(), diff --git a/Userland/Services/WindowServer/WindowFrame.h b/Userland/Services/WindowServer/WindowFrame.h index f83a01c58f5..3aee699f237 100644 --- a/Userland/Services/WindowServer/WindowFrame.h +++ b/Userland/Services/WindowServer/WindowFrame.h @@ -31,7 +31,7 @@ public: public: void paint(WindowFrame&, Gfx::Painter&, Gfx::IntRect const&); void render(WindowFrame&, Screen&); - Optional hit_test(WindowFrame&, Gfx::IntPoint const&, Gfx::IntPoint const&); + Optional hit_test(WindowFrame&, Gfx::IntPoint, Gfx::IntPoint); private: RefPtr m_top_bottom; @@ -115,7 +115,7 @@ public: void theme_changed(); - Optional hit_test(Gfx::IntPoint const&); + Optional hit_test(Gfx::IntPoint); void open_menubar_menu(Menu&); diff --git a/Userland/Services/WindowServer/WindowManager.cpp b/Userland/Services/WindowServer/WindowManager.cpp index 1d5c21b17aa..92ada0a8e86 100644 --- a/Userland/Services/WindowServer/WindowManager.cpp +++ b/Userland/Services/WindowServer/WindowManager.cpp @@ -684,7 +684,7 @@ void WindowManager::check_hide_geometry_overlay(Window& window) m_geometry_overlay = nullptr; } -void WindowManager::start_window_move(Window& window, Gfx::IntPoint const& origin) +void WindowManager::start_window_move(Window& window, Gfx::IntPoint origin) { MenuManager::the().close_everyone(); @@ -708,7 +708,7 @@ void WindowManager::start_window_move(Window& window, MouseEvent const& event) start_window_move(window, event.position()); } -void WindowManager::start_window_resize(Window& window, Gfx::IntPoint const& position, MouseButton button, ResizeDirection resize_direction) +void WindowManager::start_window_resize(Window& window, Gfx::IntPoint position, MouseButton button, ResizeDirection resize_direction) { MenuManager::the().close_everyone(); @@ -830,7 +830,7 @@ bool WindowManager::process_ongoing_window_move(MouseEvent& event) return true; } -Gfx::IntPoint WindowManager::to_floating_cursor_position(Gfx::IntPoint const& origin) const +Gfx::IntPoint WindowManager::to_floating_cursor_position(Gfx::IntPoint origin) const { VERIFY(m_move_window); @@ -2157,7 +2157,7 @@ void WindowManager::set_always_on_top(Window& window, bool always_on_top) }); } -Gfx::IntPoint WindowManager::get_recommended_window_position(Gfx::IntPoint const& desired) +Gfx::IntPoint WindowManager::get_recommended_window_position(Gfx::IntPoint desired) { // FIXME: Find a better source for the width and height to shift by. Gfx::IntPoint shift(8, Gfx::WindowTheme::current().titlebar_height(Gfx::WindowTheme::WindowType::Normal, Gfx::WindowTheme::WindowMode::Other, palette()) + 10); diff --git a/Userland/Services/WindowServer/WindowManager.h b/Userland/Services/WindowServer/WindowManager.h index 4731bb952e6..26378a8d145 100644 --- a/Userland/Services/WindowServer/WindowManager.h +++ b/Userland/Services/WindowServer/WindowManager.h @@ -180,10 +180,10 @@ public: void check_hide_geometry_overlay(Window&); - void start_window_resize(Window&, Gfx::IntPoint const&, MouseButton, ResizeDirection); + void start_window_resize(Window&, Gfx::IntPoint, MouseButton, ResizeDirection); void start_window_resize(Window&, MouseEvent const&, ResizeDirection); void start_window_move(Window&, MouseEvent const&); - void start_window_move(Window&, Gfx::IntPoint const&); + void start_window_move(Window&, Gfx::IntPoint); Window const* active_fullscreen_window() const { @@ -246,7 +246,7 @@ public: } bool is_window_in_modal_chain(Window& chain_window, Window& other_window); - Gfx::IntPoint get_recommended_window_position(Gfx::IntPoint const& desired); + Gfx::IntPoint get_recommended_window_position(Gfx::IntPoint desired); void reload_icon_bitmaps_after_scale_change(); @@ -428,7 +428,7 @@ private: bool is_considered_doubleclick(MouseEvent const&, DoubleClickInfo::ClickMetadata const&) const; - Gfx::IntPoint to_floating_cursor_position(Gfx::IntPoint const&) const; + Gfx::IntPoint to_floating_cursor_position(Gfx::IntPoint) const; DoubleClickInfo m_double_click_info; int m_double_click_speed { 0 }; diff --git a/Userland/Services/WindowServer/WindowStack.cpp b/Userland/Services/WindowServer/WindowStack.cpp index f4c2de6cbb9..c665742cd93 100644 --- a/Userland/Services/WindowServer/WindowStack.cpp +++ b/Userland/Services/WindowServer/WindowStack.cpp @@ -99,7 +99,7 @@ void WindowStack::move_all_windows(WindowStack& new_window_stack, Vector WindowStack::hit_test(Gfx::IntPoint const& position) const +Optional WindowStack::hit_test(Gfx::IntPoint position) const { Optional result; WindowManager::the().for_each_visible_window_from_front_to_back([&](Window& window) { diff --git a/Userland/Services/WindowServer/WindowStack.h b/Userland/Services/WindowServer/WindowStack.h index d0e4e6eab65..0050690dd99 100644 --- a/Userland/Services/WindowServer/WindowStack.h +++ b/Userland/Services/WindowServer/WindowStack.h @@ -35,7 +35,7 @@ public: Yes, No, }; - Window* window_at(Gfx::IntPoint const&, IncludeWindowFrame = IncludeWindowFrame::Yes) const; + Window* window_at(Gfx::IntPoint, IncludeWindowFrame = IncludeWindowFrame::Yes) const; Window* highlight_window() const; template @@ -56,13 +56,13 @@ public: Window const* active_window() const { return m_active_window; } void set_active_window(Window*); - Optional hit_test(Gfx::IntPoint const&) const; + Optional hit_test(Gfx::IntPoint) const; unsigned row() const { return m_row; } unsigned column() const { return m_column; } - void set_transition_offset(Badge, Gfx::IntPoint const& transition_offset) { m_transition_offset = transition_offset; } - Gfx::IntPoint const& transition_offset() const { return m_transition_offset; } + void set_transition_offset(Badge, Gfx::IntPoint transition_offset) { m_transition_offset = transition_offset; } + Gfx::IntPoint transition_offset() const { return m_transition_offset; } void set_stationary_window_stack(WindowStack& window_stack) { m_stationary_window_stack = &window_stack; } WindowStack& stationary_window_stack() diff --git a/Userland/Utilities/headless-browser.cpp b/Userland/Utilities/headless-browser.cpp index ca9c4c3a02c..b13d87e5d77 100644 --- a/Userland/Utilities/headless-browser.cpp +++ b/Userland/Utilities/headless-browser.cpp @@ -171,15 +171,15 @@ public: { } - virtual void page_did_request_context_menu(Gfx::IntPoint const&) override + virtual void page_did_request_context_menu(Gfx::IntPoint) override { } - virtual void page_did_request_link_context_menu(Gfx::IntPoint const&, AK::URL const&, DeprecatedString const&, unsigned) override + virtual void page_did_request_link_context_menu(Gfx::IntPoint, AK::URL const&, DeprecatedString const&, unsigned) override { } - virtual void page_did_request_image_context_menu(Gfx::IntPoint const&, AK::URL const&, DeprecatedString const&, unsigned, Gfx::Bitmap const*) override + virtual void page_did_request_image_context_menu(Gfx::IntPoint, AK::URL const&, DeprecatedString const&, unsigned, Gfx::Bitmap const*) override { } @@ -191,7 +191,7 @@ public: { } - virtual void page_did_enter_tooltip_area(Gfx::IntPoint const&, DeprecatedString const&) override + virtual void page_did_enter_tooltip_area(Gfx::IntPoint, DeprecatedString const&) override { }