Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

animation: add BezierCurve, AnimationManager and AnimatedVariable #27

Merged
merged 13 commits into from
Dec 29, 2024

Conversation

PaideiaDilemma
Copy link
Contributor

Moved from Hyprland.

I simplified the AnimationManager a bit, so that it only stores references to active variables. (Previously registerVar and unregister existed as well)

I also changed the way variables are removed from active, so that we don't have to search through the active vector each time an animation ends. It now just replaces the whole vector with a new one containing all variables that return true for isBeeingAnimated() on a call to tickDone. disconnectFromActive is only used for the dtor of CBaseAnimatedVariable.

CBaseAnimatedVariable stores a reference to the animation manager for now in order to connect/disconnect an active var to the animation manager. (discussed that with vaxry)

CGenericAnimatedVariable is only defined in the header and takes two template parameters. The type of the underlying value and a context. The context is there to store damage policy and variable parent (window,workspace,layer) in Hyprland and the parent widget in hyprlock.

The test shows an example usage of AnimationManager and AnimatedVariables.

VERSION Outdated Show resolved Hide resolved
include/hyprutils/animation/AnimatedVariable.hpp Outdated Show resolved Hide resolved
include/hyprutils/animation/AnimatedVariable.hpp Outdated Show resolved Hide resolved
include/hyprutils/animation/AnimatedVariable.hpp Outdated Show resolved Hide resolved
include/hyprutils/animation/AnimationManager.hpp Outdated Show resolved Hide resolved
include/hyprutils/animation/BezierCurve.hpp Outdated Show resolved Hide resolved
src/animation/BezierCurve.cpp Outdated Show resolved Hide resolved
@PaideiaDilemma
Copy link
Contributor Author

Now uses smart pointers for throughout.

Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally looks nice

include/hyprutils/animation/AnimatedVariable.hpp Outdated Show resolved Hide resolved
Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest approved

src/animation/AnimationManager.cpp Outdated Show resolved Hide resolved
Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@vaxerski vaxerski merged commit 8af7e4b into hyprwm:main Dec 29, 2024
4 checks passed
@PaideiaDilemma PaideiaDilemma deleted the animation branch January 1, 2025 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants