From 115a2b5d2fb0b8b4950c6daa897fbe012b9204b2 Mon Sep 17 00:00:00 2001 From: Federico Angelilli Date: Sat, 16 Mar 2024 16:03:21 +0100 Subject: Split animation paint_func --- src/animate.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/animate.h') diff --git a/src/animate.h b/src/animate.h index a4ded33..b296723 100644 --- a/src/animate.h +++ b/src/animate.h @@ -8,18 +8,20 @@ typedef struct Animation Animation; typedef struct State State; -typedef bool (* DrawFunc)(Animation *anim, cairo_t *cr, const Layout *layout); typedef bool (* LayoutFunc)(Animation *anim, Layout *layout); +typedef bool (* DrawFunc)(Animation *anim, Layout *layout, cairo_t *cr); struct Animation { enum { ANIM_SHINE, ANIM_PULSE, } type; - DrawFunc paint_func; - LayoutFunc layout_func; gint64 start; gint64 duration; + LayoutFunc layout_func; + // NOTE: These should not change the layout width + DrawFunc before_func; + DrawFunc after_func; }; double clamp(double x, double min, double max); -- cgit v1.2.3