diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-07-28 13:28:43 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-07-28 13:28:43 +0200 |
| commit | 920fdd6bff0f78d6f7f5de6167a23af303e00e57 (patch) | |
| tree | ff28eaba4ee9c6647e0a3b8ac1fab1cb8e14fbf3 /src/config/ConfigManager.hpp | |
| parent | 9dd17a4be6a719ab0cc501f63cf07cfd066f3ef8 (diff) | |
Animation config rework
Diffstat (limited to 'src/config/ConfigManager.hpp')
| -rw-r--r-- | src/config/ConfigManager.hpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/config/ConfigManager.hpp b/src/config/ConfigManager.hpp index f26e8ea5..58b2789e 100644 --- a/src/config/ConfigManager.hpp +++ b/src/config/ConfigManager.hpp @@ -16,6 +16,9 @@ #define STRVAL_EMPTY "[[EMPTY]]" +#define INITANIMCFG(name) animationConfig[name] = {} +#define CREATEANIMCFG(name, parent) animationConfig[name] = {true, "", "", 0.f, -1, &animationConfig["global"], &animationConfig[parent]} + struct SConfigValue { int64_t intValue = -1; float floatValue = -1; @@ -47,6 +50,18 @@ struct SWindowRule { std::string szValue; }; +struct SAnimationPropertyConfig { + bool overriden = true; + + std::string internalBezier = ""; + std::string internalStyle = ""; + float internalSpeed = 0.f; + int internalEnabled = -1; + + SAnimationPropertyConfig* pValues = nullptr; + SAnimationPropertyConfig* pParentAnimation = nullptr; +}; + class CConfigManager { public: CConfigManager(); @@ -84,6 +99,8 @@ public: std::string parseKeyword(const std::string&, const std::string&, bool dynamic = false); + SAnimationPropertyConfig* getAnimationPropertyConfig(const std::string&); + private: std::deque<std::string> configPaths; // stores all the config paths std::unordered_map<std::string, time_t> configModifyTimes; // stores modify times @@ -91,6 +108,8 @@ private: 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::string configCurrentPath; std::string currentCategory = ""; // For storing the category of the current item @@ -110,9 +129,12 @@ private: // internal methods void setDefaultVars(); + void setDefaultAnimationVars(); void setDeviceDefaultVars(const std::string&); void ensureDPMS(); + void setAnimForChildren(SAnimationPropertyConfig *const); + void applyUserDefinedVars(std::string&, const size_t); void loadConfigLoadVars(); SConfigValue getConfigValueSafe(const std::string&); |
