Hyprland/src/managers/AnimationManager.hpp

34 lines
1 KiB
C++
Raw Normal View History

2022-03-23 22:01:59 +01:00
#pragma once
#include "../defines.hpp"
#include <list>
2022-04-23 21:47:16 +02:00
#include <unordered_map>
2022-04-23 14:16:02 +02:00
#include "../helpers/AnimatedVariable.hpp"
2022-04-23 21:47:16 +02:00
#include "../helpers/BezierCurve.hpp"
2022-05-14 16:43:30 +02:00
#include "../Window.hpp"
2022-03-23 22:01:59 +01:00
class CAnimationManager {
public:
2022-04-23 21:47:16 +02:00
CAnimationManager();
2022-03-23 22:01:59 +01:00
void tick();
2022-04-23 21:47:16 +02:00
void addBezierWithName(std::string, const Vector2D&, const Vector2D&);
void removeAllBeziers();
2022-03-23 22:01:59 +01:00
2022-05-14 16:43:30 +02:00
void onWindowPostCreate(CWindow*);
2022-04-23 14:16:02 +02:00
std::list<CAnimatedVariable*> m_lAnimatedVariables;
2022-03-23 22:01:59 +01:00
private:
bool deltaSmallToFlip(const Vector2D& a, const Vector2D& b);
2022-03-31 17:50:00 +02:00
bool deltaSmallToFlip(const CColor& a, const CColor& b);
2022-04-14 16:43:29 +02:00
bool deltaSmallToFlip(const float& a, const float& b);
2022-03-23 22:01:59 +01:00
bool deltazero(const Vector2D& a, const Vector2D& b);
2022-03-31 17:50:00 +02:00
bool deltazero(const CColor& a, const CColor& b);
2022-04-14 16:43:29 +02:00
bool deltazero(const float& a, const float& b);
2022-04-23 21:47:16 +02:00
std::unordered_map<std::string, CBezierCurve> m_mBezierCurves;
2022-03-23 22:01:59 +01:00
};
inline std::unique_ptr<CAnimationManager> g_pAnimationManager;