diff options
Diffstat (limited to 'src/effect.h')
| -rw-r--r-- | src/effect.h | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/src/effect.h b/src/effect.h index 1bf1a9e..980d339 100644 --- a/src/effect.h +++ b/src/effect.h @@ -5,25 +5,41 @@ #include "util.h" -typedef enum { - EFFECT_PULSE, -} effect_type_t; - typedef struct effect effect_t; +typedef struct effect_info effect_info_t; + typedef struct layout layout_t; +// NOTE: Should only allocate the effect and set any extra values +// +typedef effect_t *(*effect_allocate_t)(const effect_info_t *info); + +// NOTE: Must free any state associated with the effect +// +typedef void (*effect_finalize_t)(effect_t *effect); + typedef void (*effect_render_t)(effect_t *effect, layout_t *layout, cairo_t *cr); -struct effect { - effect_type_t type; - struct timespec start; +// NOTE: effect_info's state will be free'd simply +// +struct effect_info { + char *label; struct timespec duration; + effect_allocate_t allocate; + effect_finalize_t finalize; effect_render_t pre; effect_render_t post; + void *state; +}; + +struct effect { + effect_info_t *info; + struct timespec start; + struct effect *next; }; -effect_t *effect_pulse(struct timespec duration); +void effect_info_free(effect_info_t *info); void effect_free(effect_t *effect); |
