diff options
author | Shannon Booth <shannon.ml.booth@gmail.com> | 2020-03-07 12:02:21 +1300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-07 01:33:53 +0100 |
commit | 6a3b12664a7ce85bef93497df70c0b96cfc509d0 (patch) | |
tree | 0af568a218003c41a86d2c8ba5bc1a35bc77cb89 | |
parent | 57f1c919df4d755790f6ac1e4797ab514d436f9a (diff) | |
download | serenity-6a3b12664a7ce85bef93497df70c0b96cfc509d0.zip |
LibGUI: Move Icon and FontDatabase into the GUI namespace
We also clean up some old references to the old G prefixed GUI classes
This also fixes a potential bug with using: C_OBJECT_ABSTRACT(GAbstractButton)
instead of C_OBJECT_ABSTRACT(AbstractButton)
24 files changed, 120 insertions, 104 deletions
diff --git a/Applications/FileManager/DirectoryView.cpp b/Applications/FileManager/DirectoryView.cpp index fb2c6b998e..150f806be4 100644 --- a/Applications/FileManager/DirectoryView.cpp +++ b/Applications/FileManager/DirectoryView.cpp @@ -144,8 +144,8 @@ DirectoryView::DirectoryView() }; // NOTE: We're using the on_update hook on the GSortingProxyModel here instead of - // the GFileSystemModel's hook. This is because GSortingProxyModel has already - // installed an on_update hook on the GFileSystemModel internally. + // the GUI::FileSystemModel's hook. This is because GSortingProxyModel has already + // installed an on_update hook on the GUI::FileSystemModel internally. // FIXME: This is an unfortunate design. We should come up with something better. m_table_view->model()->on_update = [this] { for_each_view_implementation([](auto& view) { diff --git a/Applications/FileManager/PropertiesDialog.cpp b/Applications/FileManager/PropertiesDialog.cpp index f614c9107e..3421b71c66 100644 --- a/Applications/FileManager/PropertiesDialog.cpp +++ b/Applications/FileManager/PropertiesDialog.cpp @@ -79,7 +79,7 @@ PropertiesDialog::PropertiesDialog(GUI::FileSystemModel& model, String path, boo m_name_box->set_text(m_name); m_name_box->on_change = [&, disable_rename]() { if (disable_rename) { - m_name_box->set_text(m_name); //FIXME: GTextBox does not support set_enabled yet... + m_name_box->set_text(m_name); //FIXME: GUI::TextBox does not support set_enabled yet... } else { m_name_dirty = m_name != m_name_box->text(); m_apply_button->set_enabled(true); diff --git a/Applications/Help/ManualModel.h b/Applications/Help/ManualModel.h index 3be13de25d..2a23f5d4a1 100644 --- a/Applications/Help/ManualModel.h +++ b/Applications/Help/ManualModel.h @@ -52,6 +52,6 @@ public: private: ManualModel(); - GIcon m_section_icon; - GIcon m_page_icon; + GUI::Icon m_section_icon; + GUI::Icon m_page_icon; }; diff --git a/Applications/HexEditor/HexEditor.cpp b/Applications/HexEditor/HexEditor.cpp index 269d73cb26..31ac165966 100644 --- a/Applications/HexEditor/HexEditor.cpp +++ b/Applications/HexEditor/HexEditor.cpp @@ -44,7 +44,7 @@ HexEditor::HexEditor() { set_scrollbars_enabled(true); - set_font(GFontDatabase::the().get_by_name("Csilla Thin")); + set_font(GUI::FontDatabase::the().get_by_name("Csilla Thin")); set_background_role(ColorRole::Base); set_foreground_role(ColorRole::BaseText); vertical_scrollbar().set_step(line_height()); diff --git a/Applications/Terminal/main.cpp b/Applications/Terminal/main.cpp index d29f374fff..2093f23fd7 100644 --- a/Applications/Terminal/main.cpp +++ b/Applications/Terminal/main.cpp @@ -281,11 +281,11 @@ int main(int argc, char** argv) GUI::ActionGroup font_action_group; font_action_group.set_exclusive(true); auto font_menu = GUI::Menu::construct("Font"); - GFontDatabase::the().for_each_fixed_width_font([&](const StringView& font_name) { + GUI::FontDatabase::the().for_each_fixed_width_font([&](const StringView& font_name) { auto action = GUI::Action::create(font_name, [&](GUI::Action& action) { action.set_checked(true); - terminal.set_font(GFontDatabase::the().get_by_name(action.text())); - auto metadata = GFontDatabase::the().get_metadata_by_name(action.text()); + terminal.set_font(GUI::FontDatabase::the().get_by_name(action.text())); + auto metadata = GUI::FontDatabase::the().get_metadata_by_name(action.text()); ASSERT(metadata.has_value()); config->write_entry("Text", "Font", metadata.value().path); config->sync(); diff --git a/Applications/TextEditor/TextEditorWidget.cpp b/Applications/TextEditor/TextEditorWidget.cpp index 9af30acef3..4da323de9c 100644 --- a/Applications/TextEditor/TextEditorWidget.cpp +++ b/Applications/TextEditor/TextEditorWidget.cpp @@ -370,9 +370,9 @@ TextEditorWidget::TextEditorWidget() menubar->add_menu(move(edit_menu)); auto font_menu = GUI::Menu::construct("Font"); - GFontDatabase::the().for_each_fixed_width_font([&](const StringView& font_name) { + GUI::FontDatabase::the().for_each_fixed_width_font([&](const StringView& font_name) { font_menu->add_action(GUI::Action::create(font_name, [this](const GUI::Action& action) { - m_editor->set_font(GFontDatabase::the().get_by_name(action.text())); + m_editor->set_font(GUI::FontDatabase::the().get_by_name(action.text())); m_editor->update(); })); }); diff --git a/DevTools/HackStudio/Project.cpp b/DevTools/HackStudio/Project.cpp index 7fb9ba8881..4678d43acf 100644 --- a/DevTools/HackStudio/Project.cpp +++ b/DevTools/HackStudio/Project.cpp @@ -169,11 +169,11 @@ Project::Project(const String& path, Vector<String>&& filenames) { m_name = FileSystemPath(m_path).basename(); - m_file_icon = GIcon(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-unknown.png")); - m_cplusplus_icon = GIcon(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-cplusplus.png")); - m_header_icon = GIcon(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-header.png")); - m_directory_icon = GIcon(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-folder.png")); - m_project_icon = GIcon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-hack-studio.png")); + m_file_icon = GUI::Icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-unknown.png")); + m_cplusplus_icon = GUI::Icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-cplusplus.png")); + m_header_icon = GUI::Icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-header.png")); + m_directory_icon = GUI::Icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-folder.png")); + m_project_icon = GUI::Icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-hack-studio.png")); for (auto& filename : filenames) { m_files.append(ProjectFile::construct_with_name(filename)); diff --git a/DevTools/HackStudio/Project.h b/DevTools/HackStudio/Project.h index 0598ff2e5b..2077c36d2d 100644 --- a/DevTools/HackStudio/Project.h +++ b/DevTools/HackStudio/Project.h @@ -71,9 +71,9 @@ private: NonnullRefPtrVector<ProjectFile> m_files; RefPtr<ProjectTreeNode> m_root_node; - GIcon m_directory_icon; - GIcon m_file_icon; - GIcon m_cplusplus_icon; - GIcon m_header_icon; - GIcon m_project_icon; + GUI::Icon m_directory_icon; + GUI::Icon m_file_icon; + GUI::Icon m_cplusplus_icon; + GUI::Icon m_header_icon; + GUI::Icon m_project_icon; }; diff --git a/DevTools/HackStudio/WidgetTreeModel.h b/DevTools/HackStudio/WidgetTreeModel.h index 7af2359363..8f9b0b0393 100644 --- a/DevTools/HackStudio/WidgetTreeModel.h +++ b/DevTools/HackStudio/WidgetTreeModel.h @@ -47,5 +47,5 @@ private: explicit WidgetTreeModel(GUI::Widget&); NonnullRefPtr<GUI::Widget> m_root; - GIcon m_widget_icon; + GUI::Icon m_widget_icon; }; diff --git a/DevTools/Inspector/RemoteObjectGraphModel.h b/DevTools/Inspector/RemoteObjectGraphModel.h index a35c8286d3..bd89842924 100644 --- a/DevTools/Inspector/RemoteObjectGraphModel.h +++ b/DevTools/Inspector/RemoteObjectGraphModel.h @@ -55,8 +55,8 @@ private: RemoteProcess& m_process; - GIcon m_object_icon; - GIcon m_window_icon; - GIcon m_layout_icon; - GIcon m_timer_icon; + GUI::Icon m_object_icon; + GUI::Icon m_window_icon; + GUI::Icon m_layout_icon; + GUI::Icon m_timer_icon; }; diff --git a/DevTools/ProfileViewer/ProfileModel.h b/DevTools/ProfileViewer/ProfileModel.h index ee72911c32..8ab3934b31 100644 --- a/DevTools/ProfileViewer/ProfileModel.h +++ b/DevTools/ProfileViewer/ProfileModel.h @@ -61,6 +61,6 @@ private: Profile& m_profile; - GIcon m_user_frame_icon; - GIcon m_kernel_frame_icon; + GUI::Icon m_user_frame_icon; + GUI::Icon m_kernel_frame_icon; }; diff --git a/Games/Snake/SnakeGame.cpp b/Games/Snake/SnakeGame.cpp index 371ab5d91d..58ca54c708 100644 --- a/Games/Snake/SnakeGame.cpp +++ b/Games/Snake/SnakeGame.cpp @@ -35,7 +35,7 @@ SnakeGame::SnakeGame() { - set_font(GFontDatabase::the().get_by_name("Liza Regular")); + set_font(GUI::FontDatabase::the().get_by_name("Liza Regular")); m_fruit_bitmaps.append(*Gfx::Bitmap::load_from_file("/res/icons/snake/paprika.png")); m_fruit_bitmaps.append(*Gfx::Bitmap::load_from_file("/res/icons/snake/eggplant.png")); m_fruit_bitmaps.append(*Gfx::Bitmap::load_from_file("/res/icons/snake/cauliflower.png")); diff --git a/Libraries/LibGUI/AbstractButton.h b/Libraries/LibGUI/AbstractButton.h index cbdbbb74c2..b896a26a2a 100644 --- a/Libraries/LibGUI/AbstractButton.h +++ b/Libraries/LibGUI/AbstractButton.h @@ -31,7 +31,7 @@ namespace GUI { class AbstractButton : public Widget { - C_OBJECT_ABSTRACT(GAbstractButton) + C_OBJECT_ABSTRACT(AbstractButton) public: virtual ~AbstractButton() override; diff --git a/Libraries/LibGUI/FileSystemModel.cpp b/Libraries/LibGUI/FileSystemModel.cpp index 4ac9b20323..6b2745e37e 100644 --- a/Libraries/LibGUI/FileSystemModel.cpp +++ b/Libraries/LibGUI/FileSystemModel.cpp @@ -199,14 +199,14 @@ FileSystemModel::FileSystemModel(const StringView& root_path, Mode mode) : m_root_path(canonicalized_path(root_path)) , m_mode(mode) { - m_directory_icon = GIcon::default_icon("filetype-folder"); - m_file_icon = GIcon::default_icon("filetype-unknown"); - m_symlink_icon = GIcon::default_icon("filetype-symlink"); - m_socket_icon = GIcon::default_icon("filetype-socket"); - m_executable_icon = GIcon::default_icon("filetype-executable"); - m_filetype_image_icon = GIcon::default_icon("filetype-image"); - m_filetype_sound_icon = GIcon::default_icon("filetype-sound"); - m_filetype_html_icon = GIcon::default_icon("filetype-html"); + m_directory_icon = Icon::default_icon("filetype-folder"); + m_file_icon = Icon::default_icon("filetype-unknown"); + m_symlink_icon = Icon::default_icon("filetype-symlink"); + m_socket_icon = Icon::default_icon("filetype-socket"); + m_executable_icon = Icon::default_icon("filetype-executable"); + m_filetype_image_icon = Icon::default_icon("filetype-image"); + m_filetype_sound_icon = Icon::default_icon("filetype-sound"); + m_filetype_html_icon = Icon::default_icon("filetype-html"); setpwent(); while (auto* passwd = getpwent()) @@ -341,7 +341,7 @@ Variant FileSystemModel::data(const ModelIndex& index, Role role) const auto& node = this->node(index); if (role == Role::Custom) { - // For GFileSystemModel, custom role means the full path. + // For GUI::FileSystemModel, custom role means the full path. ASSERT(index.column() == Column::Name); return node.full_path(*this); } @@ -409,7 +409,7 @@ Variant FileSystemModel::data(const ModelIndex& index, Role role) const return {}; } -GIcon FileSystemModel::icon_for_file(const mode_t mode, const String& name) const +Icon FileSystemModel::icon_for_file(const mode_t mode, const String& name) const { if (S_ISDIR(mode)) return m_directory_icon; @@ -428,14 +428,14 @@ GIcon FileSystemModel::icon_for_file(const mode_t mode, const String& name) cons return m_file_icon; } -GIcon FileSystemModel::icon_for(const Node& node) const +Icon FileSystemModel::icon_for(const Node& node) const { if (node.name.to_lowercase().ends_with(".png")) { if (!node.thumbnail) { if (!const_cast<FileSystemModel*>(this)->fetch_thumbnail_for(node)) return m_filetype_image_icon; } - return GIcon(m_filetype_image_icon.bitmap_for_size(16), *node.thumbnail); + return GUI::Icon(m_filetype_image_icon.bitmap_for_size(16), *node.thumbnail); } return icon_for_file(node.mode, node.name); diff --git a/Libraries/LibGUI/FileSystemModel.h b/Libraries/LibGUI/FileSystemModel.h index 98e7d61680..911e1956b0 100644 --- a/Libraries/LibGUI/FileSystemModel.h +++ b/Libraries/LibGUI/FileSystemModel.h @@ -109,7 +109,7 @@ public: ModelIndex index(const StringView& path, int column) const; const Node& node(const ModelIndex& index) const; - GIcon icon_for_file(const mode_t mode, const String& name) const; + GUI::Icon icon_for_file(const mode_t mode, const String& name) const; Function<void(int done, int total)> on_thumbnail_progress; Function<void()> on_root_path_change; @@ -141,20 +141,20 @@ private: HashMap<gid_t, String> m_group_names; bool fetch_thumbnail_for(const Node& node); - GIcon icon_for(const Node& node) const; + GUI::Icon icon_for(const Node& node) const; String m_root_path; Mode m_mode { Invalid }; OwnPtr<Node> m_root { nullptr }; - GIcon m_directory_icon; - GIcon m_file_icon; - GIcon m_symlink_icon; - GIcon m_socket_icon; - GIcon m_executable_icon; - GIcon m_filetype_image_icon; - GIcon m_filetype_sound_icon; - GIcon m_filetype_html_icon; + GUI::Icon m_directory_icon; + GUI::Icon m_file_icon; + GUI::Icon m_symlink_icon; + GUI::Icon m_socket_icon; + GUI::Icon m_executable_icon; + GUI::Icon m_filetype_image_icon; + GUI::Icon m_filetype_sound_icon; + GUI::Icon m_filetype_html_icon; unsigned m_thumbnail_progress { 0 }; unsigned m_thumbnail_progress_total { 0 }; diff --git a/Libraries/LibGUI/FontDatabase.cpp b/Libraries/LibGUI/FontDatabase.cpp index cd3eda669e..7815cde43f 100644 --- a/Libraries/LibGUI/FontDatabase.cpp +++ b/Libraries/LibGUI/FontDatabase.cpp @@ -32,16 +32,18 @@ #include <stdio.h> #include <stdlib.h> -static GFontDatabase* s_the; +namespace GUI { -GFontDatabase& GFontDatabase::the() +static FontDatabase* s_the; + +FontDatabase& FontDatabase::the() { if (!s_the) - s_the = new GFontDatabase; + s_the = new FontDatabase; return *s_the; } -GFontDatabase::GFontDatabase() +FontDatabase::FontDatabase() { Core::DirIterator di("/res/fonts", Core::DirIterator::SkipDots); if (di.has_error()) { @@ -61,11 +63,11 @@ GFontDatabase::GFontDatabase() } } -GFontDatabase::~GFontDatabase() +FontDatabase::~FontDatabase() { } -void GFontDatabase::for_each_font(Function<void(const StringView&)> callback) +void FontDatabase::for_each_font(Function<void(const StringView&)> callback) { Vector<String> names; names.ensure_capacity(m_name_to_metadata.size()); @@ -76,7 +78,7 @@ void GFontDatabase::for_each_font(Function<void(const StringView&)> callback) callback(name); } -void GFontDatabase::for_each_fixed_width_font(Function<void(const StringView&)> callback) +void FontDatabase::for_each_fixed_width_font(Function<void(const StringView&)> callback) { Vector<String> names; names.ensure_capacity(m_name_to_metadata.size()); @@ -89,10 +91,12 @@ void GFontDatabase::for_each_fixed_width_font(Function<void(const StringView&)> callback(name); } -RefPtr<Gfx::Font> GFontDatabase::get_by_name(const StringView& name) +RefPtr<Gfx::Font> FontDatabase::get_by_name(const StringView& name) { auto it = m_name_to_metadata.find(name); if (it == m_name_to_metadata.end()) return nullptr; return Gfx::Font::load_from_file((*it).value.path); } + +} diff --git a/Libraries/LibGUI/FontDatabase.h b/Libraries/LibGUI/FontDatabase.h index be1a95e950..c9c20e61d0 100644 --- a/Libraries/LibGUI/FontDatabase.h +++ b/Libraries/LibGUI/FontDatabase.h @@ -31,15 +31,17 @@ #include <AK/String.h> #include <LibGfx/Forward.h> +namespace GUI { + struct Metadata { String path; bool is_fixed_width; int glyph_height; }; -class GFontDatabase { +class FontDatabase { public: - static GFontDatabase& the(); + static FontDatabase& the(); RefPtr<Gfx::Font> get_by_name(const StringView&); void for_each_font(Function<void(const StringView&)>); @@ -51,8 +53,10 @@ public: } private: - GFontDatabase(); - ~GFontDatabase(); + FontDatabase(); + ~FontDatabase(); HashMap<String, Metadata> m_name_to_metadata; }; + +} diff --git a/Libraries/LibGUI/Icon.cpp b/Libraries/LibGUI/Icon.cpp index cd60552155..a6f1254a17 100644 --- a/Libraries/LibGUI/Icon.cpp +++ b/Libraries/LibGUI/Icon.cpp @@ -28,23 +28,25 @@ #include <LibGUI/Icon.h> #include <LibGfx/Bitmap.h> -GIcon::GIcon() - : m_impl(GIconImpl::create()) +namespace GUI { + +Icon::Icon() + : m_impl(IconImpl::create()) { } -GIcon::GIcon(const GIconImpl& impl) - : m_impl(const_cast<GIconImpl&>(impl)) +Icon::Icon(const IconImpl& impl) + : m_impl(const_cast<IconImpl&>(impl)) { } -GIcon::GIcon(const GIcon& other) +Icon::Icon(const Icon& other) : m_impl(other.m_impl) { } -GIcon::GIcon(RefPtr<Gfx::Bitmap>&& bitmap) - : GIcon() +Icon::Icon(RefPtr<Gfx::Bitmap>&& bitmap) + : Icon() { if (bitmap) { ASSERT(bitmap->width() == bitmap->height()); @@ -53,8 +55,8 @@ GIcon::GIcon(RefPtr<Gfx::Bitmap>&& bitmap) } } -GIcon::GIcon(RefPtr<Gfx::Bitmap>&& bitmap1, RefPtr<Gfx::Bitmap>&& bitmap2) - : GIcon(move(bitmap1)) +Icon::Icon(RefPtr<Gfx::Bitmap>&& bitmap1, RefPtr<Gfx::Bitmap>&& bitmap2) + : Icon(move(bitmap1)) { if (bitmap2) { ASSERT(bitmap2->width() == bitmap2->height()); @@ -63,7 +65,7 @@ GIcon::GIcon(RefPtr<Gfx::Bitmap>&& bitmap1, RefPtr<Gfx::Bitmap>&& bitmap2) } } -const Gfx::Bitmap* GIconImpl::bitmap_for_size(int size) const +const Gfx::Bitmap* IconImpl::bitmap_for_size(int size) const { auto it = m_bitmaps.find(size); if (it != m_bitmaps.end()) @@ -81,7 +83,7 @@ const Gfx::Bitmap* GIconImpl::bitmap_for_size(int size) const return best_fit; } -void GIconImpl::set_bitmap_for_size(int size, RefPtr<Gfx::Bitmap>&& bitmap) +void IconImpl::set_bitmap_for_size(int size, RefPtr<Gfx::Bitmap>&& bitmap) { if (!bitmap) { m_bitmaps.remove(size); @@ -90,9 +92,11 @@ void GIconImpl::set_bitmap_for_size(int size, RefPtr<Gfx::Bitmap>&& bitmap) m_bitmaps.set(size, move(bitmap)); } -GIcon GIcon::default_icon(const StringView& name) +Icon Icon::default_icon(const StringView& name) { auto bitmap16 = Gfx::Bitmap::load_from_file(String::format("/res/icons/16x16/%s.png", String(name).characters())); auto bitmap32 = Gfx::Bitmap::load_from_file(String::format("/res/icons/32x32/%s.png", String(name).characters())); - return GIcon(move(bitmap16), move(bitmap32)); + return Icon(move(bitmap16), move(bitmap32)); +} + } diff --git a/Libraries/LibGUI/Icon.h b/Libraries/LibGUI/Icon.h index ac188cfd0f..9c150b18cd 100644 --- a/Libraries/LibGUI/Icon.h +++ b/Libraries/LibGUI/Icon.h @@ -31,31 +31,33 @@ #include <AK/RefCounted.h> #include <LibGfx/Forward.h> -class GIconImpl : public RefCounted<GIconImpl> { +namespace GUI { + +class IconImpl : public RefCounted<IconImpl> { public: - static NonnullRefPtr<GIconImpl> create() { return adopt(*new GIconImpl); } - ~GIconImpl() {} + static NonnullRefPtr<IconImpl> create() { return adopt(*new IconImpl); } + ~IconImpl() {} const Gfx::Bitmap* bitmap_for_size(int) const; void set_bitmap_for_size(int, RefPtr<Gfx::Bitmap>&&); private: - GIconImpl() {} + IconImpl() {} HashMap<int, RefPtr<Gfx::Bitmap>> m_bitmaps; }; -class GIcon { +class Icon { public: - GIcon(); - explicit GIcon(RefPtr<Gfx::Bitmap>&&); - explicit GIcon(RefPtr<Gfx::Bitmap>&&, RefPtr<Gfx::Bitmap>&&); - explicit GIcon(const GIconImpl&); - GIcon(const GIcon&); - ~GIcon() {} + Icon(); + explicit Icon(RefPtr<Gfx::Bitmap>&&); + explicit Icon(RefPtr<Gfx::Bitmap>&&, RefPtr<Gfx::Bitmap>&&); + explicit Icon(const IconImpl&); + Icon(const Icon&); + ~Icon() {} - static GIcon default_icon(const StringView&); + static Icon default_icon(const StringView&); - GIcon& operator=(const GIcon& other) + Icon& operator=(const Icon& other) { if (this != &other) m_impl = other.m_impl; @@ -65,8 +67,10 @@ public: const Gfx::Bitmap* bitmap_for_size(int size) const { return m_impl->bitmap_for_size(size); } void set_bitmap_for_size(int size, RefPtr<Gfx::Bitmap>&& bitmap) { m_impl->set_bitmap_for_size(size, move(bitmap)); } - const GIconImpl& impl() const { return *m_impl; } + const IconImpl& impl() const { return *m_impl; } private: - NonnullRefPtr<GIconImpl> m_impl; + NonnullRefPtr<IconImpl> m_impl; }; + +} diff --git a/Libraries/LibGUI/TextEditor.cpp b/Libraries/LibGUI/TextEditor.cpp index 7558917bbd..06fe61aebc 100644 --- a/Libraries/LibGUI/TextEditor.cpp +++ b/Libraries/LibGUI/TextEditor.cpp @@ -56,7 +56,7 @@ TextEditor::TextEditor(Type type) set_foreground_role(ColorRole::BaseText); set_document(TextDocument::create()); set_scrollbars_enabled(is_multi_line()); - set_font(GFontDatabase::the().get_by_name("Csilla Thin")); + set_font(FontDatabase::the().get_by_name("Csilla Thin")); // FIXME: Recompute vertical scrollbar step size on font change. vertical_scrollbar().set_step(line_height()); m_cursor = { 0, 0 }; diff --git a/Libraries/LibGUI/Variant.cpp b/Libraries/LibGUI/Variant.cpp index 4ee6bf3f2c..2c58657c76 100644 --- a/Libraries/LibGUI/Variant.cpp +++ b/Libraries/LibGUI/Variant.cpp @@ -190,10 +190,10 @@ Variant::Variant(const Gfx::Bitmap& value) AK::ref_if_not_null(m_value.as_bitmap); } -Variant::Variant(const GIcon& value) +Variant::Variant(const GUI::Icon& value) : m_type(Type::Icon) { - m_value.as_icon = &const_cast<GIconImpl&>(value.impl()); + m_value.as_icon = &const_cast<GUI::IconImpl&>(value.impl()); AK::ref_if_not_null(m_value.as_icon); } @@ -398,7 +398,7 @@ String Variant::to_string() const case Type::Bitmap: return "[Gfx::Bitmap]"; case Type::Icon: - return "[GIcon]"; + return "[GUI::Icon]"; case Type::Color: return as_color().to_string(); case Type::Point: diff --git a/Libraries/LibGUI/Variant.h b/Libraries/LibGUI/Variant.h index 25a01e9eb3..f19e04f126 100644 --- a/Libraries/LibGUI/Variant.h +++ b/Libraries/LibGUI/Variant.h @@ -44,7 +44,7 @@ public: Variant(const char*); Variant(const String&); Variant(const Gfx::Bitmap&); - Variant(const GIcon&); + Variant(const GUI::Icon&); Variant(const Gfx::Point&); Variant(const Gfx::Size&); Variant(const Gfx::Rect&); @@ -207,10 +207,10 @@ public: return *m_value.as_bitmap; } - GIcon as_icon() const + GUI::Icon as_icon() const { ASSERT(type() == Type::Icon); - return GIcon(*m_value.as_icon); + return GUI::Icon(*m_value.as_icon); } Color as_color() const @@ -263,7 +263,7 @@ private: union { StringImpl* as_string; Gfx::Bitmap* as_bitmap; - GIconImpl* as_icon; + GUI::IconImpl* as_icon; Gfx::Font* as_font; bool as_bool; i32 as_i32; diff --git a/Libraries/LibHTML/DOMTreeModel.h b/Libraries/LibHTML/DOMTreeModel.h index 96cb6d4a05..c25fce7e43 100644 --- a/Libraries/LibHTML/DOMTreeModel.h +++ b/Libraries/LibHTML/DOMTreeModel.h @@ -51,7 +51,7 @@ private: NonnullRefPtr<Document> m_document; - GIcon m_document_icon; - GIcon m_element_icon; - GIcon m_text_icon; + GUI::Icon m_document_icon; + GUI::Icon m_element_icon; + GUI::Icon m_text_icon; }; diff --git a/Servers/WindowServer/WindowType.h b/Servers/WindowServer/WindowType.h index 4ca662b903..be6a7522a8 100644 --- a/Servers/WindowServer/WindowType.h +++ b/Servers/WindowServer/WindowType.h @@ -26,7 +26,7 @@ #pragma once -// Keep this in sync with GWindowType. +// Keep this in sync with GUI::WindowType. enum class WindowType { Invalid = 0, Normal, |