diff options
| author | Federico Angelilli <code@fedang.net> | 2024-03-16 16:03:21 +0100 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2024-03-16 16:03:21 +0100 |
| commit | 115a2b5d2fb0b8b4950c6daa897fbe012b9204b2 (patch) | |
| tree | 2d9c7bb94dd006b750805fe742365e20a271016b /src/animate.c | |
| parent | 40ca9598d269c9b6f162e80b5293f83ec37bb75d (diff) | |
Split animation paint_func
Diffstat (limited to 'src/animate.c')
| -rw-r--r-- | src/animate.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/animate.c b/src/animate.c index 7241104..8bd09b5 100644 --- a/src/animate.c +++ b/src/animate.c @@ -47,8 +47,7 @@ typedef struct { cairo_pattern_t *gradient; } AnimationShine; -// FIXME: Not working for button group -static bool shine_paint(AnimationShine *shine, cairo_t *cr, const Layout *layout) +static bool shine_func(AnimationShine *shine, Layout *layout, cairo_t *cr) { gint64 end = shine->anim.start + shine->anim.duration; gint64 now = g_get_monotonic_time(); @@ -88,7 +87,7 @@ Animation *animation_shine_create(gint64 duration) // Note the 0 initialization AnimationShine *shine = g_malloc0(sizeof(AnimationShine)); shine->anim.type = ANIM_SHINE; - shine->anim.paint_func = (DrawFunc)shine_paint; + shine->anim.after_func = (DrawFunc)shine_func; shine->anim.duration = duration; // TODO: Change it depending on container size @@ -102,7 +101,7 @@ Animation *animation_shine_create(gint64 duration) return (gpointer)shine; } -static bool pulse_layout(Animation *pulse, Layout *layout) +static bool pulse_func(Animation *pulse, Layout *layout, cairo_t *cr) { gint64 end = pulse->start + pulse->duration; gint64 now = g_get_monotonic_time(); @@ -128,7 +127,7 @@ Animation *animation_pulse_create(gint64 duration) // Note the 0 initialization Animation *pulse = g_malloc0(sizeof(Animation)); pulse->type = ANIM_PULSE; - pulse->layout_func = (LayoutFunc)pulse_layout; + pulse->before_func = (DrawFunc)pulse_func; pulse->duration = duration; return (gpointer)pulse; |
