#ifndef COMET_ANIMATE_H #define COMET_ANIMATE_H #include #include "draw.h" 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); struct Animation { enum { ANIM_SHINE, ANIM_PULSE, } type; DrawFunc paint_func; LayoutFunc layout_func; gint64 start; gint64 duration; }; double clamp(double x, double min, double max); double smoothstep(double x, double edge0, double edge1); 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(gint64 duration); Animation *animation_pulse_create(gint64 duration); void animation_destroy(Animation *anim); #endif // vim: ts=4 sw=4 et