aboutsummaryrefslogtreecommitdiff
path: root/src/animate.h
diff options
context:
space:
mode:
authorFederico Angelilli <code@fedang.net>2024-03-14 15:44:41 +0100
committerFederico Angelilli <code@fedang.net>2024-03-14 15:44:41 +0100
commitc7a8b75933b3bd963e19f1a9d85f3b610a08e669 (patch)
tree91de053f1caaf655eaeb1bbd3458c49362b22e2a /src/animate.h
parent93c4dc6893e733f563e70c315537922d55adfab2 (diff)
Change animation code and refactor state
Diffstat (limited to 'src/animate.h')
-rw-r--r--src/animate.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/animate.h b/src/animate.h
index 3bfa87f..c243287 100644
--- a/src/animate.h
+++ b/src/animate.h
@@ -5,24 +5,23 @@
#include "draw.h"
-// TODO: Custom drawing for animations
-typedef void (* DrawFunc)(cairo_t *cr, const Layout *layout);
-
+typedef struct Animation Animation;
typedef struct State State;
-typedef struct {
+typedef bool (* DrawFunc)(Animation *anim, cairo_t *cr, const Layout *layout);
+
+struct Animation {
enum {
ANIM_SHINE,
} type;
- GSourceFunc handler;
DrawFunc paint;
-} Animation;
+};
double quadratic_bezier(double x, double a, double b, double c);
double cubic_bezier(double x, double a, double b, double c, double d);
-Animation *animation_shine_create(State *state, gint64 duration);
+Animation *animation_shine_create(gint64 duration);
void animation_destroy(Animation *anim);