diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2023-02-27 12:32:38 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-27 12:32:38 +0000 |
| commit | 8b81f41e52b55835aaaa7e4962af23a00188cbdc (patch) | |
| tree | bca65923843ea931c0e0222f29d4e2901cfa8637 /src/config/ConfigManager.hpp | |
| parent | 74a10f26a469de54968e584525f6507928f615f0 (diff) | |
Plugin System (#1590)
---------
Co-authored-by: Mihai Fufezan <fufexan@protonmail.com>
Diffstat (limited to 'src/config/ConfigManager.hpp')
| -rw-r--r-- | src/config/ConfigManager.hpp | 43 |
1 files changed, 25 insertions, 18 deletions
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<std::string, SAnimationPropertyConfig> 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<std::string> configPaths; // stores all the config paths - std::unordered_map<std::string, time_t> configModifyTimes; // stores modify times - std::unordered_map<std::string, std::string> configDynamicVars; // stores dynamic vars declared by the user - std::unordered_map<std::string, SConfigValue> configValues; - std::unordered_map<std::string, std::unordered_map<std::string, SConfigValue>> deviceConfigs; // stores device configs + std::deque<std::string> configPaths; // stores all the config paths + std::unordered_map<std::string, time_t> configModifyTimes; // stores modify times + std::unordered_map<std::string, std::string> configDynamicVars; // stores dynamic vars declared by the user + std::unordered_map<std::string, SConfigValue> configValues; + std::unordered_map<std::string, std::unordered_map<std::string, SConfigValue>> deviceConfigs; // stores device configs + + std::unordered_map<std::string, SAnimationPropertyConfig> animationConfig; // stores all the animations with their set values - std::unordered_map<std::string, SAnimationPropertyConfig> 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<std::pair<std::string, std::string>> boundWorkspaces; - std::vector<std::pair<std::string, std::string>> boundWorkspaces; + std::vector<SExecRequestedRule> execRequestedRules; // rules requested with exec, e.g. [workspace 2] kitty - std::vector<SExecRequestedRule> execRequestedRules; // rules requested with exec, e.g. [workspace 2] kitty + std::unordered_map<HANDLE, std::unique_ptr<std::unordered_map<std::string, SConfigValue>>> pluginConfigs; // stores plugin configs - bool isFirstLaunch = true; // For exec-once + bool isFirstLaunch = true; // For exec-once - std::deque<SMonitorRule> m_dMonitorRules; - std::deque<SWindowRule> m_dWindowRules; - std::deque<SLayerRule> m_dLayerRules; - std::deque<std::string> m_dBlurLSNamespaces; + std::deque<SMonitorRule> m_dMonitorRules; + std::deque<SWindowRule> m_dWindowRules; + std::deque<SLayerRule> m_dLayerRules; + std::deque<std::string> m_dBlurLSNamespaces; - bool firstExecDispatched = false; - std::deque<std::string> firstExecRequests; + bool firstExecDispatched = false; + std::deque<std::string> firstExecRequests; // internal methods void setDefaultVars(); |
