diff options
author | Andreas Kling <kling@serenityos.org> | 2020-02-06 13:32:14 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-02-06 13:32:14 +0100 |
commit | f8b00aa29010cc3a99b285d0afd88314c40be079 (patch) | |
tree | 578b042c504966843609d9c6260093d859e67306 /Libraries | |
parent | 9b87843af169b08f1b852da96f696004866783fe (diff) | |
download | serenity-f8b00aa29010cc3a99b285d0afd88314c40be079.zip |
LibGfx: Unpublish Gfx::Size from the global namespace
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibELF/exec_elf.h | 4 | ||||
-rw-r--r-- | Libraries/LibGUI/GBoxLayout.cpp | 4 | ||||
-rw-r--r-- | Libraries/LibGUI/GComboBox.cpp | 2 | ||||
-rw-r--r-- | Libraries/LibGUI/GDragOperation.cpp | 2 | ||||
-rw-r--r-- | Libraries/LibGUI/GEvent.h | 6 | ||||
-rw-r--r-- | Libraries/LibGUI/GItemView.h | 2 | ||||
-rw-r--r-- | Libraries/LibGUI/GMenu.cpp | 2 | ||||
-rw-r--r-- | Libraries/LibGUI/GRadioButton.cpp | 2 | ||||
-rw-r--r-- | Libraries/LibGUI/GRadioButton.h | 2 | ||||
-rw-r--r-- | Libraries/LibGUI/GScrollableWidget.cpp | 2 | ||||
-rw-r--r-- | Libraries/LibGUI/GScrollableWidget.h | 4 | ||||
-rw-r--r-- | Libraries/LibGUI/GVariant.h | 2 | ||||
-rw-r--r-- | Libraries/LibGUI/GWidget.h | 4 | ||||
-rw-r--r-- | Libraries/LibGUI/GWindow.h | 6 | ||||
-rw-r--r-- | Libraries/LibGfx/Size.h | 2 | ||||
-rw-r--r-- | Libraries/LibVT/TerminalWidget.cpp | 2 | ||||
-rw-r--r-- | Libraries/LibVT/TerminalWidget.h | 2 |
17 files changed, 24 insertions, 26 deletions
diff --git a/Libraries/LibELF/exec_elf.h b/Libraries/LibELF/exec_elf.h index 9d39ef4005..a091cce13c 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 c8c2986c3b..b22f185484 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 a8985ee684..30a14b295b 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 2524d202c4..7f6a8317c5 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<Gfx::Bitmap> 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 a0b3650ef2..dc23159bf3 100644 --- a/Libraries/LibGUI/GEvent.h +++ b/Libraries/LibGUI/GEvent.h @@ -173,7 +173,7 @@ public: } const Vector<Gfx::Rect, 32>& rects() const { return m_rects; } - Size window_size() const { return m_window_size; } + Gfx::Size window_size() const { return m_window_size; } private: Vector<Gfx::Rect, 32> m_rects; @@ -182,7 +182,7 @@ private: 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 @@ public: } 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 76c929e92d..61a024dce9 100644 --- a/Libraries/LibGUI/GItemView.h +++ b/Libraries/LibGUI/GItemView.h @@ -45,7 +45,7 @@ public: 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 3768da2098..b3afc566b0 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 369a6f2a65..5cb02f5333 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 101d10028e..8e9b8ccc19 100644 --- a/Libraries/LibGUI/GRadioButton.h +++ b/Libraries/LibGUI/GRadioButton.h @@ -51,7 +51,7 @@ private: template<typename Callback> 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 91df270035..daf6fe2b5b 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 670a4be00f..2b8888e014 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 @@ public: 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 40a17eaaf4..557709ea10 100644 --- a/Libraries/LibGUI/GVariant.h +++ b/Libraries/LibGUI/GVariant.h @@ -189,7 +189,7 @@ public: 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 48c19a7744..353424465f 100644 --- a/Libraries/LibGUI/GWidget.h +++ b/Libraries/LibGUI/GWidget.h @@ -124,7 +124,7 @@ public: 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 @@ public: 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 b57a22f2fa..3772e7f79c 100644 --- a/Libraries/LibGUI/GWindow.h +++ b/Libraries/LibGUI/GWindow.h @@ -102,7 +102,7 @@ public: 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 @@ public: 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 1430bfb903..fbb9cc0a2a 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 c2fc9afab7..d5bddf33b9 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 e83b0da679..e107f6334c 100644 --- a/Libraries/LibVT/TerminalWidget.h +++ b/Libraries/LibVT/TerminalWidget.h @@ -122,7 +122,7 @@ private: 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; |