From 8b81f41e52b55835aaaa7e4962af23a00188cbdc Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Mon, 27 Feb 2023 12:32:38 +0000 Subject: Plugin System (#1590) --------- Co-authored-by: Mihai Fufezan --- src/config/ConfigManager.hpp | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) (limited to 'src/config/ConfigManager.hpp') diff --git a/src/config/ConfigManager.hpp b/src/config/ConfigManager.hpp index e246d506..742f9fe8 100644 --- a/src/config/ConfigManager.hpp +++ b/src/config/ConfigManager.hpp @@ -21,6 +21,8 @@ #define INITANIMCFG(name) animationConfig[name] = {} #define CREATEANIMCFG(name, parent) animationConfig[name] = {false, "", "", 0.f, -1, &animationConfig["global"], &animationConfig[parent]} +#define HANDLE void* + struct SConfigValue { int64_t intValue = -INT64_MAX; float floatValue = -__FLT_MAX__; @@ -159,6 +161,9 @@ class CConfigManager { std::unordered_map getAnimationConfig(); + void addPluginConfigVar(HANDLE handle, const std::string& name, const SConfigValue& value); + void removePluginConfig(HANDLE handle); + // no-op when done. void dispatchExecOnce(); @@ -180,33 +185,35 @@ class CConfigManager { std::string configCurrentPath; private: - std::deque configPaths; // stores all the config paths - std::unordered_map configModifyTimes; // stores modify times - std::unordered_map configDynamicVars; // stores dynamic vars declared by the user - std::unordered_map configValues; - std::unordered_map> deviceConfigs; // stores device configs + std::deque configPaths; // stores all the config paths + std::unordered_map configModifyTimes; // stores modify times + std::unordered_map configDynamicVars; // stores dynamic vars declared by the user + std::unordered_map configValues; + std::unordered_map> deviceConfigs; // stores device configs + + std::unordered_map animationConfig; // stores all the animations with their set values - std::unordered_map animationConfig; // stores all the animations with their set values + std::string currentCategory = ""; // For storing the category of the current item - std::string currentCategory = ""; // For storing the category of the current item + std::string parseError = ""; // For storing a parse error to display later - std::string parseError = ""; // For storing a parse error to display later + std::string m_szCurrentSubmap = ""; // For storing the current keybind submap - std::string m_szCurrentSubmap = ""; // For storing the current keybind submap + std::vector> boundWorkspaces; - std::vector> boundWorkspaces; + std::vector execRequestedRules; // rules requested with exec, e.g. [workspace 2] kitty - std::vector execRequestedRules; // rules requested with exec, e.g. [workspace 2] kitty + std::unordered_map>> pluginConfigs; // stores plugin configs - bool isFirstLaunch = true; // For exec-once + bool isFirstLaunch = true; // For exec-once - std::deque m_dMonitorRules; - std::deque m_dWindowRules; - std::deque m_dLayerRules; - std::deque m_dBlurLSNamespaces; + std::deque m_dMonitorRules; + std::deque m_dWindowRules; + std::deque m_dLayerRules; + std::deque m_dBlurLSNamespaces; - bool firstExecDispatched = false; - std::deque firstExecRequests; + bool firstExecDispatched = false; + std::deque firstExecRequests; // internal methods void setDefaultVars(); -- cgit v1.2.3