summaryrefslogtreecommitdiff
path: root/src/config/shared/animation/AnimationTree.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2026-03-20 13:52:37 -0400
committerGitHub <noreply@github.com>2026-03-20 17:52:37 +0000
commit8726a7363eb9213235e6e23657668e0daac39a5b (patch)
tree42eeb40f6f81a9ccec1455f308e56173e9dcce4b /src/config/shared/animation/AnimationTree.cpp
parentb940b0d2c197841b0f648598ee782dbaf9e0a89b (diff)
config: cleanup the entire config infrastructure (#13785)
Massively refactors the config infrastructure, sorely needed and will be req'd for the lua stuff
Diffstat (limited to 'src/config/shared/animation/AnimationTree.cpp')
-rw-r--r--src/config/shared/animation/AnimationTree.cpp78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/config/shared/animation/AnimationTree.cpp b/src/config/shared/animation/AnimationTree.cpp
new file mode 100644
index 00000000..39f7620a
--- /dev/null
+++ b/src/config/shared/animation/AnimationTree.cpp
@@ -0,0 +1,78 @@
+#include "AnimationTree.hpp"
+
+using namespace Config;
+
+UP<CAnimationTreeController>& Config::animationTree() {
+ static UP<CAnimationTreeController> p = makeUnique<CAnimationTreeController>();
+ return p;
+}
+
+CAnimationTreeController::CAnimationTreeController() {
+ reset();
+}
+
+void CAnimationTreeController::reset() {
+ m_animationTree.createNode("__internal_fadeCTM");
+ m_animationTree.createNode("global");
+
+ // global
+ m_animationTree.createNode("windows", "global");
+ m_animationTree.createNode("layers", "global");
+ m_animationTree.createNode("fade", "global");
+ m_animationTree.createNode("border", "global");
+ m_animationTree.createNode("borderangle", "global");
+ m_animationTree.createNode("workspaces", "global");
+ m_animationTree.createNode("zoomFactor", "global");
+ m_animationTree.createNode("monitorAdded", "global");
+
+ // layer
+ m_animationTree.createNode("layersIn", "layers");
+ m_animationTree.createNode("layersOut", "layers");
+
+ // windows
+ m_animationTree.createNode("windowsIn", "windows");
+ m_animationTree.createNode("windowsOut", "windows");
+ m_animationTree.createNode("windowsMove", "windows");
+
+ // fade
+ m_animationTree.createNode("fadeIn", "fade");
+ m_animationTree.createNode("fadeOut", "fade");
+ m_animationTree.createNode("fadeSwitch", "fade");
+ m_animationTree.createNode("fadeShadow", "fade");
+ m_animationTree.createNode("fadeDim", "fade");
+ m_animationTree.createNode("fadeLayers", "fade");
+ m_animationTree.createNode("fadeLayersIn", "fadeLayers");
+ m_animationTree.createNode("fadeLayersOut", "fadeLayers");
+ m_animationTree.createNode("fadePopups", "fade");
+ m_animationTree.createNode("fadePopupsIn", "fadePopups");
+ m_animationTree.createNode("fadePopupsOut", "fadePopups");
+ m_animationTree.createNode("fadeDpms", "fade");
+
+ // workspaces
+ m_animationTree.createNode("workspacesIn", "workspaces");
+ m_animationTree.createNode("workspacesOut", "workspaces");
+ m_animationTree.createNode("specialWorkspace", "workspaces");
+ m_animationTree.createNode("specialWorkspaceIn", "specialWorkspace");
+ m_animationTree.createNode("specialWorkspaceOut", "specialWorkspace");
+
+ // init the root nodes
+ m_animationTree.setConfigForNode("global", 1, 8.f, "default");
+ m_animationTree.setConfigForNode("__internal_fadeCTM", 1, 5.f, "linear");
+ m_animationTree.setConfigForNode("borderangle", 0, 1, "default");
+}
+
+const std::unordered_map<std::string, SP<Hyprutils::Animation::SAnimationPropertyConfig>>& CAnimationTreeController::getAnimationConfig() {
+ return m_animationTree.getFullConfig();
+}
+
+SP<Hyprutils::Animation::SAnimationPropertyConfig> CAnimationTreeController::getAnimationPropertyConfig(const std::string& name) {
+ return m_animationTree.getConfig(name);
+}
+
+void CAnimationTreeController::setConfigForNode(const std::string& name, bool enabled, float speed, const std::string& bezier, const std::string& style) {
+ m_animationTree.setConfigForNode(name, enabled, speed, bezier, style);
+}
+
+bool CAnimationTreeController::nodeExists(const std::string& name) {
+ return m_animationTree.nodeExists(name);
+}