diff --git a/Applications/DisplayProperties/DisplayProperties.cpp b/Applications/DisplayProperties/DisplayProperties.cpp index 1a10013a958660..0f66590f49e0ae 100644 --- a/Applications/DisplayProperties/DisplayProperties.cpp +++ b/Applications/DisplayProperties/DisplayProperties.cpp @@ -69,7 +69,7 @@ void DisplayPropertiesWidget::create_resolution_list() m_resolutions.append({ 1920, 1080 }); m_resolutions.append({ 2560, 1080 }); - Size find_size; + Gfx::Size find_size; bool okay = false; // Let's attempt to find the current resolution and select it! @@ -165,7 +165,7 @@ void DisplayPropertiesWidget::create_frame() auto resolution_list = GUI::ListView::construct(settings_content); resolution_list->set_background_color(Color::White); - resolution_list->set_model(*ItemListModel::create(m_resolutions)); + resolution_list->set_model(*ItemListModel::create(m_resolutions)); auto resolution_model = resolution_list->model(); auto find_first_resolution_index = m_resolutions.find_first_index(m_selected_resolution); diff --git a/Applications/DisplayProperties/DisplayProperties.h b/Applications/DisplayProperties/DisplayProperties.h index 3f1d0649a650c3..31ff40fe1c8809 100644 --- a/Applications/DisplayProperties/DisplayProperties.h +++ b/Applications/DisplayProperties/DisplayProperties.h @@ -67,7 +67,7 @@ class DisplayPropertiesWidget final { String m_wallpaper_path; RefPtr m_wm_config; RefPtr m_root_widget; - Vector m_resolutions; + Vector m_resolutions; Vector m_wallpapers; RefPtr m_wallpaper_preview; diff --git a/Applications/QuickShow/QSWidget.cpp b/Applications/QuickShow/QSWidget.cpp index a4161c07d732d9..40e9a86c3f3d5d 100644 --- a/Applications/QuickShow/QSWidget.cpp +++ b/Applications/QuickShow/QSWidget.cpp @@ -53,7 +53,7 @@ void QSWidget::set_bitmap(NonnullRefPtr bitmap) void QSWidget::relayout() { - Size new_size; + Gfx::Size new_size; float scale_factor = (float)m_scale / 100.0f; new_size.set_width(m_bitmap->width() * scale_factor); new_size.set_height(m_bitmap->height() * scale_factor); diff --git a/DevTools/VisualBuilder/VBForm.cpp b/DevTools/VisualBuilder/VBForm.cpp index 56f52f008fb781..d8e3e53294d044 100644 --- a/DevTools/VisualBuilder/VBForm.cpp +++ b/DevTools/VisualBuilder/VBForm.cpp @@ -354,7 +354,7 @@ void VBForm::mousemove_event(GUI::MouseEvent& event) if (widget.is_in_layout()) return; auto new_rect = widget.transform_origin_rect(); - Size minimum_size { 5, 5 }; + Gfx::Size minimum_size { 5, 5 }; new_rect.set_x(new_rect.x() + change_x); new_rect.set_y(new_rect.y() + change_y); new_rect.set_width(max(minimum_size.width(), new_rect.width() + change_w)); diff --git a/Games/Minesweeper/Field.cpp b/Games/Minesweeper/Field.cpp index ddda972f3fe798..f75d697f10d44c 100644 --- a/Games/Minesweeper/Field.cpp +++ b/Games/Minesweeper/Field.cpp @@ -119,7 +119,7 @@ class SquareLabel final : public GUI::Label { bool m_chord { false }; }; -Field::Field(GUI::Label& flag_label, GUI::Label& time_label, GUI::Button& face_button, GUI::Widget* parent, Function on_size_changed) +Field::Field(GUI::Label& flag_label, GUI::Label& time_label, GUI::Button& face_button, GUI::Widget* parent, Function on_size_changed) : GUI::Frame(parent) , m_face_button(face_button) , m_flag_label(flag_label) diff --git a/Games/Minesweeper/Field.h b/Games/Minesweeper/Field.h index 5d99b0e3ec4b5e..305a3c83fa154d 100644 --- a/Games/Minesweeper/Field.h +++ b/Games/Minesweeper/Field.h @@ -65,7 +65,7 @@ class Field final : public GUI::Frame { friend class Square; friend class SquareLabel; public: - Field(GUI::Label& flag_label, GUI::Label& time_label, GUI::Button& face_button, GUI::Widget* parent, Function on_size_changed); + Field(GUI::Label& flag_label, GUI::Label& time_label, GUI::Button& face_button, GUI::Widget* parent, Function on_size_changed); virtual ~Field() override; int rows() const { return m_rows; } @@ -131,5 +131,5 @@ class Field final : public GUI::Frame { bool m_chord_preview { false }; bool m_first_click { true }; bool m_single_chording { true }; - Function m_on_size_changed; + Function m_on_size_changed; }; diff --git a/Games/Minesweeper/main.cpp b/Games/Minesweeper/main.cpp index c159fa9bd198ad..0f50ab8967d07d 100644 --- a/Games/Minesweeper/main.cpp +++ b/Games/Minesweeper/main.cpp @@ -78,7 +78,7 @@ int main(int argc, char** argv) auto time_icon_label = GUI::Label::construct(container); time_icon_label->set_icon(Gfx::Bitmap::load_from_file("/res/icons/minesweeper/timer.png")); auto time_label = GUI::Label::construct(container); - auto field = Field::construct(*flag_label, *time_label, *face_button, widget, [&](Size size) { + auto field = Field::construct(*flag_label, *time_label, *face_button, widget, [&](auto size) { size.set_height(size.height() + container->preferred_size().height()); window->resize(size); }); diff --git a/Games/Snake/SnakeGame.cpp b/Games/Snake/SnakeGame.cpp index 1c312c34850c17..ad32e03a73f2bb 100644 --- a/Games/Snake/SnakeGame.cpp +++ b/Games/Snake/SnakeGame.cpp @@ -196,7 +196,7 @@ void SnakeGame::keydown_event(GUI::KeyEvent& event) Gfx::Rect SnakeGame::cell_rect(const Coordinate& coord) const { auto game_rect = rect(); - auto cell_size = Size(game_rect.width() / m_columns, game_rect.height() / m_rows); + auto cell_size = Gfx::Size(game_rect.width() / m_columns, game_rect.height() / m_rows); return { coord.column * cell_size.width(), coord.row * cell_size.height(), diff --git a/Libraries/LibELF/exec_elf.h b/Libraries/LibELF/exec_elf.h index 9d39ef40052371..a091cce13c77a6 100644 --- a/Libraries/LibELF/exec_elf.h +++ b/Libraries/LibELF/exec_elf.h @@ -77,7 +77,7 @@ typedef uint16_t Elf64_Quarter; #define EI_OSABI 7 /* OS/ABI ID */ #define EI_ABIVERSION 8 /* ABI version */ #define EI_PAD 9 /* start of pad bytes */ -#define EI_NIDENT 16 /* Size of e_ident[] */ +#define EI_NIDENT 16 /* Gfx::Size of e_ident[] */ /* e_ident[] magic number */ #define ELFMAG0 0x7f /* e_ident[EI_MAG0] */ @@ -701,7 +701,7 @@ struct elf_args { u_long arg_entry; /* program entry point */ u_long arg_interp; /* Interpreter load address */ u_long arg_phaddr; /* program header address */ - u_long arg_phentsize; /* Size of program header */ + u_long arg_phentsize; /* Gfx::Size of program header */ u_long arg_phnum; /* Number of program headers */ }; diff --git a/Libraries/LibGUI/GBoxLayout.cpp b/Libraries/LibGUI/GBoxLayout.cpp index c8c2986c3be6cd..b22f1854847c6b 100644 --- a/Libraries/LibGUI/GBoxLayout.cpp +++ b/Libraries/LibGUI/GBoxLayout.cpp @@ -48,7 +48,7 @@ void BoxLayout::run(Widget& widget) if (m_entries.is_empty()) return; - Size available_size = widget.size(); + Gfx::Size available_size = widget.size(); int number_of_entries_with_fixed_size = 0; int number_of_visible_entries = 0; @@ -91,7 +91,7 @@ void BoxLayout::run(Widget& widget) if (should_log) dbgprintf("BoxLayout: available_size=%s, fixed=%d, fill=%d\n", available_size.to_string().characters(), number_of_entries_with_fixed_size, number_of_entries_with_automatic_size); - Size automatic_size; + Gfx::Size automatic_size; if (number_of_entries_with_automatic_size) { if (m_orientation == Orientation::Horizontal) { diff --git a/Libraries/LibGUI/GComboBox.cpp b/Libraries/LibGUI/GComboBox.cpp index a8985ee684a2af..30a14b295bfc9e 100644 --- a/Libraries/LibGUI/GComboBox.cpp +++ b/Libraries/LibGUI/GComboBox.cpp @@ -113,7 +113,7 @@ void ComboBox::open() auto item_text = model()->data(index).to_string(); longest_item_width = max(longest_item_width, m_list_view->font().width(item_text)); } - Size size { + Gfx::Size size { max(width(), longest_item_width + m_list_view->width_occupied_by_vertical_scrollbar() + m_list_view->frame_thickness() * 2 + m_list_view->horizontal_padding()), model()->row_count() * m_list_view->item_height() + m_list_view->frame_thickness() * 2 }; diff --git a/Libraries/LibGUI/GDragOperation.cpp b/Libraries/LibGUI/GDragOperation.cpp index 2524d202c486b2..7f6a8317c55d67 100644 --- a/Libraries/LibGUI/GDragOperation.cpp +++ b/Libraries/LibGUI/GDragOperation.cpp @@ -47,7 +47,7 @@ DragOperation::Outcome DragOperation::exec() ASSERT(!m_event_loop); int bitmap_id = -1; - Size bitmap_size; + Gfx::Size bitmap_size; RefPtr shared_bitmap; if (m_bitmap) { shared_bitmap = m_bitmap->to_shareable_bitmap(); diff --git a/Libraries/LibGUI/GEvent.h b/Libraries/LibGUI/GEvent.h index a0b3650ef2ea2a..dc23159bf35ab8 100644 --- a/Libraries/LibGUI/GEvent.h +++ b/Libraries/LibGUI/GEvent.h @@ -173,7 +173,7 @@ class MultiPaintEvent final : public Event { } const Vector& rects() const { return m_rects; } - Size window_size() const { return m_window_size; } + Gfx::Size window_size() const { return m_window_size; } private: Vector m_rects; @@ -182,7 +182,7 @@ class MultiPaintEvent final : public Event { class PaintEvent final : public Event { public: - explicit PaintEvent(const Gfx::Rect& rect, const Gfx::Size& window_size = Size()) + explicit PaintEvent(const Gfx::Rect& rect, const Gfx::Size& window_size = {}) : Event(Event::Paint) , m_rect(rect) , m_window_size(window_size) @@ -190,7 +190,7 @@ class PaintEvent final : public Event { } Gfx::Rect rect() const { return m_rect; } - Size window_size() const { return m_window_size; } + Gfx::Size window_size() const { return m_window_size; } private: Gfx::Rect m_rect; diff --git a/Libraries/LibGUI/GItemView.h b/Libraries/LibGUI/GItemView.h index 76c929e92d3e55..61a024dce91be8 100644 --- a/Libraries/LibGUI/GItemView.h +++ b/Libraries/LibGUI/GItemView.h @@ -45,7 +45,7 @@ class ItemView : public AbstractView { int horizontal_padding() const { return m_horizontal_padding; } void scroll_into_view(const ModelIndex&, Orientation); - Size effective_item_size() const { return m_effective_item_size; } + Gfx::Size effective_item_size() const { return m_effective_item_size; } int model_column() const { return m_model_column; } void set_model_column(int column) { m_model_column = column; } diff --git a/Libraries/LibGUI/GMenu.cpp b/Libraries/LibGUI/GMenu.cpp index 3768da2098b6a3..b3afc566b0576b 100644 --- a/Libraries/LibGUI/GMenu.cpp +++ b/Libraries/LibGUI/GMenu.cpp @@ -124,7 +124,7 @@ int Menu::realize_menu() int icon_buffer_id = -1; if (action.icon()) { ASSERT(action.icon()->format() == Gfx::Bitmap::Format::RGBA32); - ASSERT(action.icon()->size() == Size(16, 16)); + ASSERT(action.icon()->size() == Gfx::Size(16, 16)); if (action.icon()->shared_buffer_id() == -1) { auto shared_buffer = SharedBuffer::create_with_size(action.icon()->size_in_bytes()); ASSERT(shared_buffer); diff --git a/Libraries/LibGUI/GRadioButton.cpp b/Libraries/LibGUI/GRadioButton.cpp index 369a6f2a652ae5..5cb02f53331872 100644 --- a/Libraries/LibGUI/GRadioButton.cpp +++ b/Libraries/LibGUI/GRadioButton.cpp @@ -45,7 +45,7 @@ RadioButton::~RadioButton() { } -Size RadioButton::circle_size() +Gfx::Size RadioButton::circle_size() { return { 12, 12 }; } diff --git a/Libraries/LibGUI/GRadioButton.h b/Libraries/LibGUI/GRadioButton.h index 101d10028e90c7..8e9b8ccc193cc9 100644 --- a/Libraries/LibGUI/GRadioButton.h +++ b/Libraries/LibGUI/GRadioButton.h @@ -51,7 +51,7 @@ class RadioButton : public AbstractButton { template void for_each_in_group(Callback); - static Size circle_size(); + static Gfx::Size circle_size(); }; } diff --git a/Libraries/LibGUI/GScrollableWidget.cpp b/Libraries/LibGUI/GScrollableWidget.cpp index 91df270035181a..daf6fe2b5bc33e 100644 --- a/Libraries/LibGUI/GScrollableWidget.cpp +++ b/Libraries/LibGUI/GScrollableWidget.cpp @@ -92,7 +92,7 @@ void ScrollableWidget::resize_event(ResizeEvent& event) update_scrollbar_ranges(); } -Size ScrollableWidget::available_size() const +Gfx::Size ScrollableWidget::available_size() const { int available_width = frame_inner_rect().width() - m_size_occupied_by_fixed_elements.width() - width_occupied_by_vertical_scrollbar(); int available_height = frame_inner_rect().height() - m_size_occupied_by_fixed_elements.height() - height_occupied_by_horizontal_scrollbar(); diff --git a/Libraries/LibGUI/GScrollableWidget.h b/Libraries/LibGUI/GScrollableWidget.h index 670a4be00ffa76..2b8888e0142220 100644 --- a/Libraries/LibGUI/GScrollableWidget.h +++ b/Libraries/LibGUI/GScrollableWidget.h @@ -37,7 +37,7 @@ class ScrollableWidget : public Frame { public: virtual ~ScrollableWidget() override; - Size content_size() const { return m_content_size; } + Gfx::Size content_size() const { return m_content_size; } int content_width() const { return m_content_size.width(); } int content_height() const { return m_content_size.height(); } @@ -51,7 +51,7 @@ class ScrollableWidget : public Frame { void set_scrollbars_enabled(bool); bool is_scrollbars_enabled() const { return m_scrollbars_enabled; } - Size available_size() const; + Gfx::Size available_size() const; ScrollBar& vertical_scrollbar() { return *m_vertical_scrollbar; } const ScrollBar& vertical_scrollbar() const { return *m_vertical_scrollbar; } diff --git a/Libraries/LibGUI/GVariant.h b/Libraries/LibGUI/GVariant.h index 40a17eaaf4a511..557709ea1009ac 100644 --- a/Libraries/LibGUI/GVariant.h +++ b/Libraries/LibGUI/GVariant.h @@ -189,7 +189,7 @@ class Variant { return { m_value.as_point.x, m_value.as_point.y }; } - Size as_size() const + Gfx::Size as_size() const { return { m_value.as_size.width, m_value.as_size.height }; } diff --git a/Libraries/LibGUI/GWidget.h b/Libraries/LibGUI/GWidget.h index 48c19a7744a2ab..353424465f361a 100644 --- a/Libraries/LibGUI/GWidget.h +++ b/Libraries/LibGUI/GWidget.h @@ -124,7 +124,7 @@ class Widget : public Core::Object { void set_size_policy(SizePolicy horizontal_policy, SizePolicy vertical_policy); void set_size_policy(Orientation, SizePolicy); - Size preferred_size() const { return m_preferred_size; } + Gfx::Size preferred_size() const { return m_preferred_size; } void set_preferred_size(const Gfx::Size&); void set_preferred_size(int width, int height) { set_preferred_size({ width, height }); } @@ -156,7 +156,7 @@ class Widget : public Core::Object { int length(Orientation orientation) const { return orientation == Orientation::Vertical ? height() : width(); } Gfx::Rect rect() const { return { 0, 0, width(), height() }; } - Size size() const { return m_relative_rect.size(); } + Gfx::Size size() const { return m_relative_rect.size(); } void update(); void update(const Gfx::Rect&); diff --git a/Libraries/LibGUI/GWindow.h b/Libraries/LibGUI/GWindow.h index b57a22f2fa4d23..3772e7f79c8073 100644 --- a/Libraries/LibGUI/GWindow.h +++ b/Libraries/LibGUI/GWindow.h @@ -102,7 +102,7 @@ class Window : public Core::Object { int height() const { return rect().height(); } Gfx::Rect rect() const; - Size size() const { return rect().size(); } + Gfx::Size size() const { return rect().size(); } void set_rect(const Gfx::Rect&); void set_rect(int x, int y, int width, int height) { set_rect({ x, y, width, height }); } @@ -152,9 +152,9 @@ class Window : public Core::Object { Gfx::Bitmap* front_bitmap() { return m_front_bitmap.ptr(); } Gfx::Bitmap* back_bitmap() { return m_back_bitmap.ptr(); } - Size size_increment() const { return m_size_increment; } + Gfx::Size size_increment() const { return m_size_increment; } void set_size_increment(const Gfx::Size& increment) { m_size_increment = increment; } - Size base_size() const { return m_base_size; } + Gfx::Size base_size() const { return m_base_size; } void set_base_size(const Gfx::Size& size) { m_base_size = size; } void set_override_cursor(StandardCursor); diff --git a/Libraries/LibGfx/Size.h b/Libraries/LibGfx/Size.h index 1430bfb903b32a..fbb9cc0a2a084c 100644 --- a/Libraries/LibGfx/Size.h +++ b/Libraries/LibGfx/Size.h @@ -115,5 +115,3 @@ inline const LogStream& operator<<(const LogStream& stream, const Size& value) } } - -using Gfx::Size; diff --git a/Libraries/LibVT/TerminalWidget.cpp b/Libraries/LibVT/TerminalWidget.cpp index c2fc9afab71db1..d5bddf33b90d8d 100644 --- a/Libraries/LibVT/TerminalWidget.cpp +++ b/Libraries/LibVT/TerminalWidget.cpp @@ -439,7 +439,7 @@ void TerminalWidget::relayout(const Gfx::Size& size) m_scrollbar->set_relative_rect(scrollbar_rect); } -Size TerminalWidget::compute_base_size() const +Gfx::Size TerminalWidget::compute_base_size() const { int base_width = frame_thickness() * 2 + m_inset * 2 + m_scrollbar->width(); int base_height = frame_thickness() * 2 + m_inset * 2; diff --git a/Libraries/LibVT/TerminalWidget.h b/Libraries/LibVT/TerminalWidget.h index e83b0da6792109..e107f6334c1ff6 100644 --- a/Libraries/LibVT/TerminalWidget.h +++ b/Libraries/LibVT/TerminalWidget.h @@ -122,7 +122,7 @@ class TerminalWidget final : public GUI::Frame void relayout(const Gfx::Size&); - Size compute_base_size() const; + Gfx::Size compute_base_size() const; int first_selection_column_on_row(int row) const; int last_selection_column_on_row(int row) const; diff --git a/Servers/WindowServer/WSCursor.h b/Servers/WindowServer/WSCursor.h index 4f42de6ffd00ec..881cd8d2824b25 100644 --- a/Servers/WindowServer/WSCursor.h +++ b/Servers/WindowServer/WSCursor.h @@ -51,7 +51,7 @@ class WSCursor : public RefCounted { const Gfx::Bitmap& bitmap() const { return *m_bitmap; } Gfx::Rect rect() const { return m_bitmap->rect(); } - Size size() const { return m_bitmap->size(); } + Gfx::Size size() const { return m_bitmap->size(); } private: WSCursor(NonnullRefPtr&&, const Gfx::Point&); diff --git a/Servers/WindowServer/WSScreen.h b/Servers/WindowServer/WSScreen.h index 28e486e10aeef2..cee4700c66587a 100644 --- a/Servers/WindowServer/WSScreen.h +++ b/Servers/WindowServer/WSScreen.h @@ -49,7 +49,7 @@ class WSScreen { static WSScreen& the(); - Size size() const { return { width(), height() }; } + Gfx::Size size() const { return { width(), height() }; } Gfx::Rect rect() const { return { 0, 0, width(), height() }; } Gfx::Point cursor_location() const { return m_cursor_location; } diff --git a/Servers/WindowServer/WSWindow.h b/Servers/WindowServer/WSWindow.h index 75976f397e3e9b..215cfdc1773fa1 100644 --- a/Servers/WindowServer/WSWindow.h +++ b/Servers/WindowServer/WSWindow.h @@ -159,7 +159,7 @@ class WSWindow final : public Core::Object void set_position(const Gfx::Point& position) { set_rect({ position.x(), position.y(), width(), height() }); } void set_position_without_repaint(const Gfx::Point& position) { set_rect_without_repaint({ position.x(), position.y(), width(), height() }); } - Size size() const { return m_rect.size(); } + Gfx::Size size() const { return m_rect.size(); } void invalidate(); void invalidate(const Gfx::Rect&); @@ -193,10 +193,10 @@ class WSWindow final : public Core::Object bool has_alpha_channel() const { return m_has_alpha_channel; } void set_has_alpha_channel(bool value) { m_has_alpha_channel = value; } - Size size_increment() const { return m_size_increment; } + Gfx::Size size_increment() const { return m_size_increment; } void set_size_increment(const Gfx::Size& increment) { m_size_increment = increment; } - Size base_size() const { return m_base_size; } + Gfx::Size base_size() const { return m_base_size; } void set_base_size(const Gfx::Size& size) { m_base_size = size; } const Gfx::Bitmap& icon() const { return *m_icon; } diff --git a/Servers/WindowServer/WSWindowManager.cpp b/Servers/WindowServer/WSWindowManager.cpp index 24502b4a7d9f1a..3b97e297c990ad 100644 --- a/Servers/WindowServer/WSWindowManager.cpp +++ b/Servers/WindowServer/WSWindowManager.cpp @@ -146,7 +146,7 @@ void WSWindowManager::set_resolution(int width, int height) client.notify_about_new_screen_rect(WSScreen::the().rect()); }); if (m_wm_config) { - dbg() << "Saving resolution: " << Size(width, height) << " to config file at " << m_wm_config->file_name(); + dbg() << "Saving resolution: " << Gfx::Size(width, height) << " to config file at " << m_wm_config->file_name(); m_wm_config->write_num_entry("Screen", "Width", width); m_wm_config->write_num_entry("Screen", "Height", height); m_wm_config->sync(); @@ -542,7 +542,7 @@ bool WSWindowManager::process_ongoing_window_resize(const WSMouseEvent& event, W auto new_rect = m_resize_window_original_rect; // First, size the new rect. - Size minimum_size { 50, 50 }; + Gfx::Size minimum_size { 50, 50 }; new_rect.set_width(max(minimum_size.width(), new_rect.width() + change_w)); new_rect.set_height(max(minimum_size.height(), new_rect.height() + change_h));