diff --git a/Libraries/LibGUI/AppFile.cpp b/Libraries/LibDesktop/AppFile.cpp similarity index 98% rename from Libraries/LibGUI/AppFile.cpp rename to Libraries/LibDesktop/AppFile.cpp index 3e5b779d9e..41958328f5 100644 --- a/Libraries/LibGUI/AppFile.cpp +++ b/Libraries/LibDesktop/AppFile.cpp @@ -28,9 +28,9 @@ #include #include #include -#include +#include -namespace GUI { +namespace Desktop { NonnullRefPtr AppFile::get_for_app(const StringView& app_name) { diff --git a/Libraries/LibGUI/AppFile.h b/Libraries/LibDesktop/AppFile.h similarity index 95% rename from Libraries/LibGUI/AppFile.h rename to Libraries/LibDesktop/AppFile.h index 8c42ddd7ca..7bfeabd3a3 100644 --- a/Libraries/LibGUI/AppFile.h +++ b/Libraries/LibDesktop/AppFile.h @@ -30,7 +30,7 @@ #include #include -namespace GUI { +namespace Desktop { class AppFile : public RefCounted { public: @@ -49,7 +49,7 @@ public: Vector launcher_file_types() const; Vector launcher_protocols() const; - Icon icon() const { return FileIconProvider::icon_for_path(executable()); }; + GUI::Icon icon() const { return GUI::FileIconProvider::icon_for_path(executable()); }; private: explicit AppFile(const StringView& path); diff --git a/Libraries/LibDesktop/CMakeLists.txt b/Libraries/LibDesktop/CMakeLists.txt index 2b01bc2734..598bb952c8 100644 --- a/Libraries/LibDesktop/CMakeLists.txt +++ b/Libraries/LibDesktop/CMakeLists.txt @@ -1,4 +1,5 @@ set(SOURCES + AppFile.cpp Launcher.cpp ) @@ -8,4 +9,4 @@ set(GENERATED_SOURCES ) serenity_lib(LibDesktop desktop) -target_link_libraries(LibDesktop LibIPC) +target_link_libraries(LibDesktop LibCore LibIPC LibGUI) diff --git a/Libraries/LibGUI/CMakeLists.txt b/Libraries/LibGUI/CMakeLists.txt index 08ffc6c96e..9792fbe8a9 100644 --- a/Libraries/LibGUI/CMakeLists.txt +++ b/Libraries/LibGUI/CMakeLists.txt @@ -5,7 +5,6 @@ set(SOURCES AbstractView.cpp Action.cpp ActionGroup.cpp - AppFile.cpp Application.cpp BoxLayout.cpp Button.cpp diff --git a/Libraries/LibVT/TerminalWidget.cpp b/Libraries/LibVT/TerminalWidget.cpp index dc345a1862..fa21af1b64 100644 --- a/Libraries/LibVT/TerminalWidget.cpp +++ b/Libraries/LibVT/TerminalWidget.cpp @@ -34,9 +34,9 @@ #include #include #include +#include #include #include -#include #include #include #include @@ -858,7 +858,7 @@ void TerminalWidget::context_menu_event(GUI::ContextMenuEvent& event) // Then add them to the context menu. // FIXME: Adapt this code when we actually support calling LaunchServer with a specific handler in mind. for (auto& handler : handlers) { - auto af = GUI::AppFile::get_for_app(LexicalPath(handler).basename()); + auto af = Desktop::AppFile::get_for_app(LexicalPath(handler).basename()); if (!af->is_valid()) continue; auto action = GUI::Action::create(String::formatted("Open in {}", af->name()), af->icon().bitmap_for_size(16), [this, handler](auto&) { diff --git a/Services/LaunchServer/CMakeLists.txt b/Services/LaunchServer/CMakeLists.txt index 997a72775e..29308ce7f1 100644 --- a/Services/LaunchServer/CMakeLists.txt +++ b/Services/LaunchServer/CMakeLists.txt @@ -10,4 +10,4 @@ set(SOURCES ) serenity_bin(LaunchServer) -target_link_libraries(LaunchServer LibCore LibIPC LibGUI) +target_link_libraries(LaunchServer LibCore LibIPC LibDesktop) diff --git a/Services/LaunchServer/Launcher.cpp b/Services/LaunchServer/Launcher.cpp index f40b1ff000..ad6d025035 100644 --- a/Services/LaunchServer/Launcher.cpp +++ b/Services/LaunchServer/Launcher.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include @@ -97,7 +97,7 @@ Launcher& Launcher::the() void Launcher::load_handlers(const String& af_dir) { - GUI::AppFile::for_each([&](auto af) { + Desktop::AppFile::for_each([&](auto af) { auto app_name = af->name(); auto app_executable = af->executable(); HashTable file_types; diff --git a/Services/LaunchServer/Launcher.h b/Services/LaunchServer/Launcher.h index 745f72342e..8708cdc258 100644 --- a/Services/LaunchServer/Launcher.h +++ b/Services/LaunchServer/Launcher.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include namespace LaunchServer { @@ -57,7 +57,7 @@ public: Launcher(); static Launcher& the(); - void load_handlers(const String& af_dir = GUI::AppFile::APP_FILES_DIRECTORY); + void load_handlers(const String& af_dir = Desktop::AppFile::APP_FILES_DIRECTORY); void load_config(const Core::ConfigFile&); bool open_url(const URL&, const String& handler_name); Vector handlers_for_url(const URL&); diff --git a/Services/SystemMenu/CMakeLists.txt b/Services/SystemMenu/CMakeLists.txt index d0432a0e47..8d6a6adee8 100644 --- a/Services/SystemMenu/CMakeLists.txt +++ b/Services/SystemMenu/CMakeLists.txt @@ -4,4 +4,4 @@ set(SOURCES ) serenity_bin(SystemMenu) -target_link_libraries(SystemMenu LibGUI) +target_link_libraries(SystemMenu LibGUI LibDesktop) diff --git a/Services/SystemMenu/main.cpp b/Services/SystemMenu/main.cpp index 32a57e8c8b..fc63bf3d24 100644 --- a/Services/SystemMenu/main.cpp +++ b/Services/SystemMenu/main.cpp @@ -30,9 +30,9 @@ #include #include #include +#include #include #include -#include #include #include #include @@ -103,7 +103,7 @@ int main(int argc, char** argv) Vector discover_apps_and_categories() { HashTable seen_app_categories; - GUI::AppFile::for_each([&](auto af) { + Desktop::AppFile::for_each([&](auto af) { g_apps.append({ af->executable(), af->name(), af->category() }); seen_app_categories.set(af->category()); }); diff --git a/Services/Taskbar/CMakeLists.txt b/Services/Taskbar/CMakeLists.txt index 5085461d50..83de9ee9c8 100644 --- a/Services/Taskbar/CMakeLists.txt +++ b/Services/Taskbar/CMakeLists.txt @@ -6,4 +6,4 @@ set(SOURCES ) serenity_bin(Taskbar) -target_link_libraries(Taskbar LibGUI) +target_link_libraries(Taskbar LibGUI LibDesktop) diff --git a/Services/Taskbar/TaskbarWindow.cpp b/Services/Taskbar/TaskbarWindow.cpp index 22c798f7b9..2665a48216 100644 --- a/Services/Taskbar/TaskbarWindow.cpp +++ b/Services/Taskbar/TaskbarWindow.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include @@ -111,8 +111,8 @@ void TaskbarWindow::create_quick_launch_bar() // FIXME: Core::ConfigFile does not keep the order of the entries. for (auto& name : config->keys(quick_launch)) { auto af_name = config->read_entry(quick_launch, name); - auto af_path = String::formatted("{}/{}", GUI::AppFile::APP_FILES_DIRECTORY, af_name); - auto af = GUI::AppFile::open(af_path); + auto af_path = String::formatted("{}/{}", Desktop::AppFile::APP_FILES_DIRECTORY, af_name); + auto af = Desktop::AppFile::open(af_path); if (!af->is_valid()) continue; auto app_executable = af->executable();