From c7a8b75933b3bd963e19f1a9d85f3b610a08e669 Mon Sep 17 00:00:00 2001 From: Federico Angelilli Date: Thu, 14 Mar 2024 15:44:41 +0100 Subject: Change animation code and refactor state --- src/animate.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/animate.h') 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); -- cgit v1.2.3