From 3a631e40db78f98ab82bb600d7cf9d7428bc2b02 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Mon, 1 May 2023 07:10:53 -0700 Subject: Declarative plugin management (#2180) * Declarative plugin management Allow declaring `plugin` entries in the hyprland configuration. Plugins will be loaded if an entry is added and unloaded if that entry is removed. * Replace pointers with copying in updateconfigPlugins * Include which plugin was declared twice in error --- src/plugins/PluginSystem.hpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/plugins/PluginSystem.hpp') diff --git a/src/plugins/PluginSystem.hpp b/src/plugins/PluginSystem.hpp index 5d1a1532..0ef30bab 100644 --- a/src/plugins/PluginSystem.hpp +++ b/src/plugins/PluginSystem.hpp @@ -15,6 +15,8 @@ class CPlugin { std::string path = ""; + bool m_bLoadedWithConfig = false; + HANDLE m_pHandle = nullptr; std::vector registeredLayouts; @@ -27,14 +29,15 @@ class CPluginSystem { public: CPluginSystem(); - CPlugin* loadPlugin(const std::string& path); - void unloadPlugin(const CPlugin* plugin, bool eject = false); - void unloadAllPlugins(); - CPlugin* getPluginByPath(const std::string& path); - CPlugin* getPluginByHandle(HANDLE handle); - std::vector getAllPlugins(); + CPlugin* loadPlugin(const std::string& path); + void unloadPlugin(const CPlugin* plugin, bool eject = false); + void unloadAllPlugins(); + std::vector updateConfigPlugins(const std::vector& plugins, bool& changed); + CPlugin* getPluginByPath(const std::string& path); + CPlugin* getPluginByHandle(HANDLE handle); + std::vector getAllPlugins(); - bool m_bAllowConfigVars = false; + bool m_bAllowConfigVars = false; private: std::vector> m_vLoadedPlugins; -- cgit v1.2.3