comparison src/animate.h @ 116:1d74eb3861b7

move animation actions from animate.c to files.
author Thinker K.F. Li <thinker@branda.to>
date Sun, 14 Sep 2008 09:42:07 +0800
parents 98c83441d7d6
children e4e47d2cdbcd
comparison
equal deleted inserted replaced
115:3895d2224e67 116:1d74eb3861b7
11 */ 11 */
12 typedef struct _mb_progm mb_progm_t; 12 typedef struct _mb_progm mb_progm_t;
13 typedef struct _mb_word mb_word_t; 13 typedef struct _mb_word mb_word_t;
14 typedef struct _mb_action mb_action_t; 14 typedef struct _mb_action mb_action_t;
15 typedef struct _mb_progm_state mb_progm_state_t; 15 typedef struct _mb_progm_state mb_progm_state_t;
16
17 /*! \defgroup act_support Action Supports.
18 * @{
19 */
20 /*! \brief Basic class of nnimation actions.
21 *
22 * A action must implement following 4 functions.
23 * \li start,
24 * \li step,
25 * \li stop,
26 * \li free, and
27 * \li *_new().
28 *
29 * *_new() must invokes mb_word_add_action() to add new object
30 * as one of actions in the word specified as an argument of it.
31 * It also means *_new() must have an argument with type of
32 * (mb_word_t *).
33 */
34 struct _mb_action {
35 void (*start)(mb_action_t *act,
36 const mb_timeval_t *now,
37 const mb_timeval_t *playing_time,
38 redraw_man_t *rdman);
39 void (*step)(mb_action_t *act, const mb_timeval_t *now,
40 redraw_man_t *rdman);
41 void (*stop)(mb_action_t *act, const mb_timeval_t *now,
42 redraw_man_t *rdman);
43 void (*free)(mb_action_t *act);
44 mb_action_t *next;
45 };
46
47 extern void mb_word_add_action(mb_word_t *word, mb_action_t *act);
48 /* @} */
16 49
17 extern mb_progm_t *mb_progm_new(int max_words, redraw_man_t *rdman); 50 extern mb_progm_t *mb_progm_new(int max_words, redraw_man_t *rdman);
18 extern void mb_progm_free(mb_progm_t *progm); 51 extern void mb_progm_free(mb_progm_t *progm);
19 extern mb_word_t *mb_progm_next_word(mb_progm_t *progm, 52 extern mb_word_t *mb_progm_next_word(mb_progm_t *progm,
20 const mb_timeval_t *start, 53 const mb_timeval_t *start,