From 920fdd6bff0f78d6f7f5de6167a23af303e00e57 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 28 Jul 2022 13:28:43 +0200 Subject: Animation config rework --- src/config/ConfigManager.hpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/config/ConfigManager.hpp') 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 configPaths; // stores all the config paths std::unordered_map configModifyTimes; // stores modify times @@ -91,6 +108,8 @@ private: std::unordered_map configValues; std::unordered_map> deviceConfigs; // stores device configs + std::unordered_map 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&); -- cgit v1.2.3