diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-01-25 15:16:28 +0000 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-01-25 15:16:28 +0000 |
| commit | 9813ba2f567a2e489b95bf15168cdcd26a31bec9 (patch) | |
| tree | 654d8282f73f6bfea95f4626c1b61baa4ee97ec9 /src/managers | |
| parent | 12e293e3092b03dbb9d82e7a749f482ef2b7ea6e (diff) | |
Add hyprctl animations
Diffstat (limited to 'src/managers')
| -rw-r--r-- | src/managers/AnimationManager.cpp | 10 | ||||
| -rw-r--r-- | src/managers/AnimationManager.hpp | 18 |
2 files changed, 17 insertions, 11 deletions
diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp index ad5185bd..a5330c1e 100644 --- a/src/managers/AnimationManager.cpp +++ b/src/managers/AnimationManager.cpp @@ -201,8 +201,8 @@ void CAnimationManager::tick() { const auto EXTENTS = PDECO->getWindowDecorationExtents(); wlr_box dmg = {PWINDOW->m_vRealPosition.vec().x - EXTENTS.topLeft.x, PWINDOW->m_vRealPosition.vec().y - EXTENTS.topLeft.y, - PWINDOW->m_vRealSize.vec().x + EXTENTS.topLeft.x + EXTENTS.bottomRight.x, - PWINDOW->m_vRealSize.vec().y + EXTENTS.topLeft.y + EXTENTS.bottomRight.y}; + PWINDOW->m_vRealSize.vec().x + EXTENTS.topLeft.x + EXTENTS.bottomRight.x, + PWINDOW->m_vRealSize.vec().y + EXTENTS.topLeft.y + EXTENTS.bottomRight.y}; if (!*PSHADOWIGNOREWINDOW) { // easy, damage the entire box @@ -463,4 +463,8 @@ CBezierCurve* CAnimationManager::getBezier(const std::string& name) { const auto BEZIER = std::find_if(m_mBezierCurves.begin(), m_mBezierCurves.end(), [&](const auto& other) { return other.first == name; }); return BEZIER == m_mBezierCurves.end() ? &m_mBezierCurves["default"] : &BEZIER->second; -}
\ No newline at end of file +} + +std::unordered_map<std::string, CBezierCurve> CAnimationManager::getAllBeziers() { + return m_mBezierCurves; +} diff --git a/src/managers/AnimationManager.hpp b/src/managers/AnimationManager.hpp index d08d3395..77e8acf1 100644 --- a/src/managers/AnimationManager.hpp +++ b/src/managers/AnimationManager.hpp @@ -11,18 +11,20 @@ class CAnimationManager { public: CAnimationManager(); - void tick(); - void addBezierWithName(std::string, const Vector2D&, const Vector2D&); - void removeAllBeziers(); + void tick(); + void addBezierWithName(std::string, const Vector2D&, const Vector2D&); + void removeAllBeziers(); - void onWindowPostCreateClose(CWindow*, bool close = false); + void onWindowPostCreateClose(CWindow*, bool close = false); - bool bezierExists(const std::string&); - CBezierCurve* getBezier(const std::string&); + bool bezierExists(const std::string&); + CBezierCurve* getBezier(const std::string&); - std::string styleValidInConfigVar(const std::string&, const std::string&); + std::string styleValidInConfigVar(const std::string&, const std::string&); - std::list<CAnimatedVariable*> m_lAnimatedVariables; + std::unordered_map<std::string, CBezierCurve> getAllBeziers(); + + std::list<CAnimatedVariable*> m_lAnimatedVariables; private: bool deltaSmallToFlip(const Vector2D& a, const Vector2D& b); |
