diff options
author | MacDue <macdue@dueutil.tech> | 2022-12-06 21:35:32 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-12-07 11:48:27 +0100 |
commit | 27fae783359ece05400dcbee66c50fee97cd1b0b (patch) | |
tree | 7918baf077884d287a8dce3ad7ccad9f9d1aaaf0 /Userland/Libraries/LibGUI | |
parent | e011eafd3790ca0375a4678a9cb2debd0ae95ac7 (diff) | |
download | serenity-27fae783359ece05400dcbee66c50fee97cd1b0b.zip |
Meta+Userland: Pass Gfx::IntSize by value
Just two ints like Gfx::IntPoint.
Diffstat (limited to 'Userland/Libraries/LibGUI')
-rw-r--r-- | Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/AbstractScrollableWidget.h | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/ConnectionToWindowManagerServer.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/ConnectionToWindowManagerServer.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/ConnectionToWindowServer.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/Event.h | 16 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/Frame.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/TabWidget.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/TabWidget.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/Widget.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/Window.cpp | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/Window.h | 10 |
13 files changed, 31 insertions, 31 deletions
diff --git a/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp b/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp index 28b78847df..340136a31e 100644 --- a/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp +++ b/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp @@ -196,7 +196,7 @@ void AbstractScrollableWidget::update_scrollbar_visibility() } } -void AbstractScrollableWidget::set_content_size(Gfx::IntSize const& size) +void AbstractScrollableWidget::set_content_size(Gfx::IntSize size) { if (m_content_size == size) return; @@ -204,7 +204,7 @@ void AbstractScrollableWidget::set_content_size(Gfx::IntSize const& size) update_scrollbar_ranges(); } -void AbstractScrollableWidget::set_min_content_size(Gfx::IntSize const& min_size) +void AbstractScrollableWidget::set_min_content_size(Gfx::IntSize min_size) { if (m_min_content_size == min_size) return; @@ -212,7 +212,7 @@ void AbstractScrollableWidget::set_min_content_size(Gfx::IntSize const& min_size update_scrollbar_ranges(); } -void AbstractScrollableWidget::set_size_occupied_by_fixed_elements(Gfx::IntSize const& size) +void AbstractScrollableWidget::set_size_occupied_by_fixed_elements(Gfx::IntSize size) { if (m_size_occupied_by_fixed_elements == size) return; diff --git a/Userland/Libraries/LibGUI/AbstractScrollableWidget.h b/Userland/Libraries/LibGUI/AbstractScrollableWidget.h index 492e197f66..d35113d9cc 100644 --- a/Userland/Libraries/LibGUI/AbstractScrollableWidget.h +++ b/Userland/Libraries/LibGUI/AbstractScrollableWidget.h @@ -84,9 +84,9 @@ protected: virtual void resize_event(ResizeEvent&) override; virtual void mousewheel_event(MouseEvent&) override; virtual void did_scroll() { } - void set_content_size(Gfx::IntSize const&); - void set_min_content_size(Gfx::IntSize const&); - void set_size_occupied_by_fixed_elements(Gfx::IntSize const&); + void set_content_size(Gfx::IntSize); + void set_min_content_size(Gfx::IntSize); + void set_size_occupied_by_fixed_elements(Gfx::IntSize); virtual void on_automatic_scrolling_timer_fired() {}; int autoscroll_threshold() const { return m_autoscroll_threshold; } void update_scrollbar_visibility(); diff --git a/Userland/Libraries/LibGUI/ConnectionToWindowManagerServer.cpp b/Userland/Libraries/LibGUI/ConnectionToWindowManagerServer.cpp index 5299ddf086..31bde9f50c 100644 --- a/Userland/Libraries/LibGUI/ConnectionToWindowManagerServer.cpp +++ b/Userland/Libraries/LibGUI/ConnectionToWindowManagerServer.cpp @@ -26,7 +26,7 @@ void ConnectionToWindowManagerServer::window_state_changed(i32 wm_id, i32 client Core::EventLoop::current().post_event(*window, make<WMWindowStateChangedEvent>(client_id, window_id, title, rect, workspace_row, workspace_column, is_active, is_blocked, static_cast<WindowType>(window_type), is_minimized, is_frameless, progress)); } -void ConnectionToWindowManagerServer::applet_area_size_changed(i32 wm_id, Gfx::IntSize const& size) +void ConnectionToWindowManagerServer::applet_area_size_changed(i32 wm_id, Gfx::IntSize size) { if (auto* window = Window::from_window_id(wm_id)) Core::EventLoop::current().post_event(*window, make<WMAppletAreaSizeChangedEvent>(size)); diff --git a/Userland/Libraries/LibGUI/ConnectionToWindowManagerServer.h b/Userland/Libraries/LibGUI/ConnectionToWindowManagerServer.h index d569a1a73a..dc9562881e 100644 --- a/Userland/Libraries/LibGUI/ConnectionToWindowManagerServer.h +++ b/Userland/Libraries/LibGUI/ConnectionToWindowManagerServer.h @@ -31,7 +31,7 @@ private: virtual void window_state_changed(i32, i32, i32, u32, u32, bool, bool, bool, bool, i32, DeprecatedString const&, Gfx::IntRect const&, Optional<i32> const&) override; virtual void window_icon_bitmap_changed(i32, i32, i32, Gfx::ShareableBitmap const&) override; virtual void window_rect_changed(i32, i32, i32, Gfx::IntRect const&) override; - virtual void applet_area_size_changed(i32, Gfx::IntSize const&) override; + virtual void applet_area_size_changed(i32, Gfx::IntSize) override; virtual void super_key_pressed(i32) override; virtual void super_space_key_pressed(i32) override; virtual void super_d_key_pressed(i32) override; diff --git a/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp b/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp index 83b7acd3b3..249f10d4ee 100644 --- a/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp +++ b/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp @@ -89,7 +89,7 @@ void ConnectionToWindowServer::update_system_effects(Vector<bool> const& effects Desktop::the().set_system_effects(effects); } -void ConnectionToWindowServer::paint(i32 window_id, Gfx::IntSize const& window_size, Vector<Gfx::IntRect> const& rects) +void ConnectionToWindowServer::paint(i32 window_id, Gfx::IntSize window_size, Vector<Gfx::IntRect> const& rects) { if (auto* window = Window::from_window_id(window_id)) Core::EventLoop::current().post_event(*window, make<MultiPaintEvent>(rects, window_size)); diff --git a/Userland/Libraries/LibGUI/ConnectionToWindowServer.h b/Userland/Libraries/LibGUI/ConnectionToWindowServer.h index 98f5b7500d..339d90b959 100644 --- a/Userland/Libraries/LibGUI/ConnectionToWindowServer.h +++ b/Userland/Libraries/LibGUI/ConnectionToWindowServer.h @@ -25,7 +25,7 @@ private: ConnectionToWindowServer(NonnullOwnPtr<Core::Stream::LocalSocket>); virtual void fast_greet(Vector<Gfx::IntRect> const&, u32, u32, u32, Core::AnonymousBuffer const&, DeprecatedString const&, DeprecatedString const&, DeprecatedString const&, Vector<bool> const&, i32) override; - virtual void paint(i32, Gfx::IntSize const&, Vector<Gfx::IntRect> const&) override; + virtual void paint(i32, Gfx::IntSize, Vector<Gfx::IntRect> const&) override; virtual void mouse_move(i32, Gfx::IntPoint, u32, u32, u32, i32, i32, i32, i32, bool, Vector<DeprecatedString> const&) override; virtual void mouse_down(i32, Gfx::IntPoint, u32, u32, u32, i32, i32, i32, i32) override; virtual void mouse_double_click(i32, Gfx::IntPoint, u32, u32, u32, i32, i32, i32, i32) override; diff --git a/Userland/Libraries/LibGUI/Event.h b/Userland/Libraries/LibGUI/Event.h index cdce3a944a..9b64b72b04 100644 --- a/Userland/Libraries/LibGUI/Event.h +++ b/Userland/Libraries/LibGUI/Event.h @@ -143,13 +143,13 @@ private: class WMAppletAreaSizeChangedEvent : public WMEvent { public: - explicit WMAppletAreaSizeChangedEvent(Gfx::IntSize const& size) + explicit WMAppletAreaSizeChangedEvent(Gfx::IntSize size) : WMEvent(Event::Type::WM_AppletAreaSizeChanged, 0, 0) , m_size(size) { } - Gfx::IntSize const& size() const { return m_size; } + Gfx::IntSize size() const { return m_size; } private: Gfx::IntSize m_size; @@ -265,7 +265,7 @@ private: class MultiPaintEvent final : public Event { public: - explicit MultiPaintEvent(Vector<Gfx::IntRect, 32> rects, Gfx::IntSize const& window_size) + explicit MultiPaintEvent(Vector<Gfx::IntRect, 32> rects, Gfx::IntSize window_size) : Event(Event::MultiPaint) , m_rects(move(rects)) , m_window_size(window_size) @@ -273,7 +273,7 @@ public: } Vector<Gfx::IntRect, 32> const& rects() const { return m_rects; } - Gfx::IntSize const& window_size() const { return m_window_size; } + Gfx::IntSize window_size() const { return m_window_size; } private: Vector<Gfx::IntRect, 32> m_rects; @@ -282,7 +282,7 @@ private: class PaintEvent final : public Event { public: - explicit PaintEvent(Gfx::IntRect const& rect, Gfx::IntSize const& window_size = {}) + explicit PaintEvent(Gfx::IntRect const& rect, Gfx::IntSize window_size = {}) : Event(Event::Paint) , m_rect(rect) , m_window_size(window_size) @@ -290,7 +290,7 @@ public: } Gfx::IntRect const& rect() const { return m_rect; } - Gfx::IntSize const& window_size() const { return m_window_size; } + Gfx::IntSize window_size() const { return m_window_size; } private: Gfx::IntRect m_rect; @@ -299,13 +299,13 @@ private: class ResizeEvent final : public Event { public: - explicit ResizeEvent(Gfx::IntSize const& size) + explicit ResizeEvent(Gfx::IntSize size) : Event(Event::Resize) , m_size(size) { } - Gfx::IntSize const& size() const { return m_size; } + Gfx::IntSize size() const { return m_size; } private: Gfx::IntSize m_size; diff --git a/Userland/Libraries/LibGUI/Frame.h b/Userland/Libraries/LibGUI/Frame.h index 91c1f42241..e1be22501b 100644 --- a/Userland/Libraries/LibGUI/Frame.h +++ b/Userland/Libraries/LibGUI/Frame.h @@ -28,7 +28,7 @@ public: Gfx::FrameShape frame_shape() const { return m_shape; } void set_frame_shape(Gfx::FrameShape shape) { m_shape = shape; } - Gfx::IntRect frame_inner_rect_for_size(Gfx::IntSize const& size) const { return { m_thickness, m_thickness, size.width() - m_thickness * 2, size.height() - m_thickness * 2 }; } + Gfx::IntRect frame_inner_rect_for_size(Gfx::IntSize size) const { return { m_thickness, m_thickness, size.width() - m_thickness * 2, size.height() - m_thickness * 2 }; } Gfx::IntRect frame_inner_rect() const { return frame_inner_rect_for_size(size()); } virtual Gfx::IntRect children_clip_rect() const override; diff --git a/Userland/Libraries/LibGUI/TabWidget.cpp b/Userland/Libraries/LibGUI/TabWidget.cpp index 9daaac68d6..3bb1c336d5 100644 --- a/Userland/Libraries/LibGUI/TabWidget.cpp +++ b/Userland/Libraries/LibGUI/TabWidget.cpp @@ -158,7 +158,7 @@ void TabWidget::resize_event(ResizeEvent& event) m_active_widget->set_relative_rect(child_rect_for_size(event.size())); } -Gfx::IntRect TabWidget::child_rect_for_size(Gfx::IntSize const& size) const +Gfx::IntRect TabWidget::child_rect_for_size(Gfx::IntSize size) const { Gfx::IntRect rect; switch (m_tab_position) { diff --git a/Userland/Libraries/LibGUI/TabWidget.h b/Userland/Libraries/LibGUI/TabWidget.h index 9a9ef42189..68505769f2 100644 --- a/Userland/Libraries/LibGUI/TabWidget.h +++ b/Userland/Libraries/LibGUI/TabWidget.h @@ -121,7 +121,7 @@ protected: virtual void doubleclick_event(MouseEvent&) override; private: - Gfx::IntRect child_rect_for_size(Gfx::IntSize const&) const; + Gfx::IntRect child_rect_for_size(Gfx::IntSize) const; Gfx::IntRect button_rect(size_t index) const; Gfx::IntRect vertical_button_rect(size_t index) const; Gfx::IntRect horizontal_button_rect(size_t index) const; diff --git a/Userland/Libraries/LibGUI/Widget.h b/Userland/Libraries/LibGUI/Widget.h index 0c374f877b..4990306919 100644 --- a/Userland/Libraries/LibGUI/Widget.h +++ b/Userland/Libraries/LibGUI/Widget.h @@ -253,7 +253,7 @@ public: 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(Gfx::IntSize 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 }); } diff --git a/Userland/Libraries/LibGUI/Window.cpp b/Userland/Libraries/LibGUI/Window.cpp index 86f76209bf..da83186297 100644 --- a/Userland/Libraries/LibGUI/Window.cpp +++ b/Userland/Libraries/LibGUI/Window.cpp @@ -292,7 +292,7 @@ Gfx::IntSize Window::minimum_size() const return ConnectionToWindowServer::the().get_window_minimum_size(m_window_id); } -void Window::set_minimum_size(Gfx::IntSize const& size) +void Window::set_minimum_size(Gfx::IntSize size) { VERIFY(size.width() >= 0 && size.height() >= 0); VERIFY(!is_obeying_widget_min_size()); @@ -918,7 +918,7 @@ void Window::flip(Vector<Gfx::IntRect, 32> const& dirty_rects) m_back_store->bitmap().set_volatile(); } -OwnPtr<WindowBackingStore> Window::create_backing_store(Gfx::IntSize const& size) +OwnPtr<WindowBackingStore> Window::create_backing_store(Gfx::IntSize size) { auto format = m_has_alpha_channel ? Gfx::BitmapFormat::BGRA8888 : Gfx::BitmapFormat::BGRx8888; @@ -1171,7 +1171,7 @@ Action* Window::action_for_shortcut(Shortcut const& shortcut) return Action::find_action_for_shortcut(*this, shortcut); } -void Window::set_base_size(Gfx::IntSize const& base_size) +void Window::set_base_size(Gfx::IntSize base_size) { if (m_base_size == base_size) return; @@ -1180,7 +1180,7 @@ void Window::set_base_size(Gfx::IntSize const& base_size) ConnectionToWindowServer::the().async_set_window_base_size_and_size_increment(m_window_id, m_base_size, m_size_increment); } -void Window::set_size_increment(Gfx::IntSize const& size_increment) +void Window::set_size_increment(Gfx::IntSize size_increment) { if (m_size_increment == size_increment) return; diff --git a/Userland/Libraries/LibGUI/Window.h b/Userland/Libraries/LibGUI/Window.h index 48ba6de9d2..03a4bece7c 100644 --- a/Userland/Libraries/LibGUI/Window.h +++ b/Userland/Libraries/LibGUI/Window.h @@ -113,14 +113,14 @@ public: Gfx::IntPoint position() const { return rect().location(); } Gfx::IntSize minimum_size() const; - void set_minimum_size(Gfx::IntSize const&); + void set_minimum_size(Gfx::IntSize); 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 point) { set_rect({ point, size() }); } void resize(int width, int height) { resize({ width, height }); } - void resize(Gfx::IntSize const& size) { set_rect({ position(), size }); } + void resize(Gfx::IntSize size) { set_rect({ position(), size }); } void center_on_screen(); void center_within(Window const&); @@ -180,9 +180,9 @@ public: Gfx::Bitmap* back_bitmap(); Gfx::IntSize size_increment() const { return m_size_increment; } - void set_size_increment(Gfx::IntSize const&); + void set_size_increment(Gfx::IntSize); Gfx::IntSize base_size() const { return m_base_size; } - void set_base_size(Gfx::IntSize const&); + void set_base_size(Gfx::IntSize); Optional<Gfx::IntSize> const& resize_aspect_ratio() const { return m_resize_aspect_ratio; } void set_resize_aspect_ratio(int width, int height) { set_resize_aspect_ratio(Gfx::IntSize(width, height)); } void set_no_resize_aspect_ratio() { set_resize_aspect_ratio({}); } @@ -270,7 +270,7 @@ private: void server_did_destroy(); - OwnPtr<WindowBackingStore> create_backing_store(Gfx::IntSize const&); + OwnPtr<WindowBackingStore> create_backing_store(Gfx::IntSize); void set_current_backing_store(WindowBackingStore&, bool flush_immediately = false); void flip(Vector<Gfx::IntRect, 32> const& dirty_rects); void force_update(); |