diff --git a/src/core/generation.cpp b/src/core/generation.cpp index f4fcde6..c4eb358 100644 --- a/src/core/generation.cpp +++ b/src/core/generation.cpp @@ -42,7 +42,7 @@ EngineGeneration::EngineGeneration(const QDir& rootPath, QmlScanner scanner) this->engine->addImageProvider("qsimage", new QsImageProvider()); this->engine->addImageProvider("qspixmap", new QsPixmapProvider()); - QuickshellPlugin::runConstructGeneration(*this); + QsEnginePlugin::runConstructGeneration(*this); } EngineGeneration::~EngineGeneration() { @@ -141,7 +141,7 @@ void EngineGeneration::postReload() { // This can be called on a generation during its destruction. if (this->engine == nullptr || this->root == nullptr) return; - QuickshellPlugin::runOnReload(); + QsEnginePlugin::runOnReload(); PostReloadHook::postReloadTree(this->root); this->singletonRegistry.onPostReload(); } diff --git a/src/core/plugin.cpp b/src/core/plugin.cpp index 697406a..c6ceb13 100644 --- a/src/core/plugin.cpp +++ b/src/core/plugin.cpp @@ -5,41 +5,41 @@ #include "generation.hpp" -static QVector plugins; // NOLINT +static QVector plugins; // NOLINT -void QuickshellPlugin::registerPlugin(QuickshellPlugin& plugin) { plugins.push_back(&plugin); } +void QsEnginePlugin::registerPlugin(QsEnginePlugin& plugin) { plugins.push_back(&plugin); } -void QuickshellPlugin::initPlugins() { +void QsEnginePlugin::initPlugins() { plugins.erase( std::remove_if( plugins.begin(), plugins.end(), - [](QuickshellPlugin* plugin) { return !plugin->applies(); } + [](QsEnginePlugin* plugin) { return !plugin->applies(); } ), plugins.end() ); - std::sort(plugins.begin(), plugins.end(), [](QuickshellPlugin* a, QuickshellPlugin* b) { + std::sort(plugins.begin(), plugins.end(), [](QsEnginePlugin* a, QsEnginePlugin* b) { return b->dependencies().contains(a->name()); }); - for (QuickshellPlugin* plugin: plugins) { + for (QsEnginePlugin* plugin: plugins) { plugin->init(); } - for (QuickshellPlugin* plugin: plugins) { + for (QsEnginePlugin* plugin: plugins) { plugin->registerTypes(); } } -void QuickshellPlugin::runConstructGeneration(EngineGeneration& generation) { - for (QuickshellPlugin* plugin: plugins) { +void QsEnginePlugin::runConstructGeneration(EngineGeneration& generation) { + for (QsEnginePlugin* plugin: plugins) { plugin->constructGeneration(generation); } } -void QuickshellPlugin::runOnReload() { - for (QuickshellPlugin* plugin: plugins) { +void QsEnginePlugin::runOnReload() { + for (QsEnginePlugin* plugin: plugins) { plugin->onReload(); } } diff --git a/src/core/plugin.hpp b/src/core/plugin.hpp index 082eb03..f0c14dc 100644 --- a/src/core/plugin.hpp +++ b/src/core/plugin.hpp @@ -6,14 +6,14 @@ class EngineGeneration; -class QuickshellPlugin { +class QsEnginePlugin { public: - QuickshellPlugin() = default; - virtual ~QuickshellPlugin() = default; - QuickshellPlugin(QuickshellPlugin&&) = delete; - QuickshellPlugin(const QuickshellPlugin&) = delete; - void operator=(QuickshellPlugin&&) = delete; - void operator=(const QuickshellPlugin&) = delete; + QsEnginePlugin() = default; + virtual ~QsEnginePlugin() = default; + QsEnginePlugin(QsEnginePlugin&&) = delete; + QsEnginePlugin(const QsEnginePlugin&) = delete; + void operator=(QsEnginePlugin&&) = delete; + void operator=(const QsEnginePlugin&) = delete; virtual QString name() { return QString(); } virtual QList dependencies() { return {}; } @@ -23,7 +23,7 @@ public: virtual void constructGeneration(EngineGeneration& /*unused*/) {} // NOLINT virtual void onReload() {} - static void registerPlugin(QuickshellPlugin& plugin); + static void registerPlugin(QsEnginePlugin& plugin); static void initPlugins(); static void runConstructGeneration(EngineGeneration& generation); static void runOnReload(); @@ -33,6 +33,6 @@ public: #define QS_REGISTER_PLUGIN(clazz) \ [[gnu::constructor]] void qsInitPlugin() { \ static clazz plugin; \ - QuickshellPlugin::registerPlugin(plugin); \ + QsEnginePlugin::registerPlugin(plugin); \ } // NOLINTEND diff --git a/src/io/init.cpp b/src/io/init.cpp index ea2bba7..33c3dc3 100644 --- a/src/io/init.cpp +++ b/src/io/init.cpp @@ -3,7 +3,7 @@ namespace { -class IoPlugin: public QuickshellPlugin { +class IoPlugin: public QsEnginePlugin { void onReload() override { DisownedProcessContext::destroyInstance(); } }; diff --git a/src/launch/launch.cpp b/src/launch/launch.cpp index 30c87a6..ec5863e 100644 --- a/src/launch/launch.cpp +++ b/src/launch/launch.cpp @@ -212,7 +212,7 @@ int launch(const LaunchArgs& args, char** argv, QCoreApplication* coreApplicatio QQmlDebuggingEnabler::startTcpDebugServer(args.debugPort, wait); } - QuickshellPlugin::initPlugins(); + QsEnginePlugin::initPlugins(); // Base window transparency appears to be additive. // Use a fully transparent window with a colored rect. diff --git a/src/wayland/init.cpp b/src/wayland/init.cpp index a9ddcad..7c024c4 100644 --- a/src/wayland/init.cpp +++ b/src/wayland/init.cpp @@ -15,7 +15,7 @@ void installPopupPositioner(); namespace { -class WaylandPlugin: public QuickshellPlugin { +class WaylandPlugin: public QsEnginePlugin { QList dependencies() override { return {"window"}; } bool applies() override { diff --git a/src/window/init.cpp b/src/window/init.cpp index 9930b41..47c03a4 100644 --- a/src/window/init.cpp +++ b/src/window/init.cpp @@ -5,7 +5,7 @@ namespace { -class WindowPlugin: public QuickshellPlugin { +class WindowPlugin: public QsEnginePlugin { // _Window has to be registered before wayland or x11 modules, otherwise module overlays // will apply in the wrong order. QString name() override { return "window"; } diff --git a/src/x11/init.cpp b/src/x11/init.cpp index 2e41e76..ae1fa9b 100644 --- a/src/x11/init.cpp +++ b/src/x11/init.cpp @@ -9,7 +9,7 @@ namespace { -class X11Plugin: public QuickshellPlugin { +class X11Plugin: public QsEnginePlugin { QList dependencies() override { return {"window"}; } bool applies() override { return QGuiApplication::platformName() == "xcb"; }