comparison src/animate.h @ 123:9e2316dc6ecb

Program completion events
author Thinker K.F. Li <thinker@branda.to>
date Tue, 16 Sep 2008 14:19:26 +0800
parents e4e47d2cdbcd
children 3a4d6179e6a9
comparison
equal deleted inserted replaced
122:17e97e92b76e 123:9e2316dc6ecb
26 */ 26 */
27 typedef struct _mb_progm mb_progm_t; 27 typedef struct _mb_progm mb_progm_t;
28 typedef struct _mb_word mb_word_t; 28 typedef struct _mb_word mb_word_t;
29 typedef struct _mb_action mb_action_t; 29 typedef struct _mb_action mb_action_t;
30 30
31 struct _mb_progm_complete {
32 event_t event;
33 mb_progm_t *progm;
34 };
35 typedef struct _mb_progm_complete mb_progm_complete_t;
36
37 extern mb_progm_t *mb_progm_new(int max_words, redraw_man_t *rdman);
38 extern void mb_progm_free(mb_progm_t *progm);
39 extern mb_word_t *mb_progm_next_word(mb_progm_t *progm,
40 const mb_timeval_t *start,
41 const mb_timeval_t *playing);
42 extern void mb_progm_start(mb_progm_t *progm, mb_tman_t *tman,
43 mb_timeval_t *now);
44 extern void mb_progm_abort(mb_progm_t *progm, mb_tman_t *tman);
45 extern subject_t *mb_progm_get_complete(mb_progm_t *progm);
46
47 /*! \defgroup ani_actions Animation Actions
48 * @{
49 */
50 extern mb_action_t *mb_shift_new(co_aix x, co_aix y, coord_t *coord,
51 mb_word_t *word);
52 extern mb_action_t *mb_chgcolor_new(co_comp_t r, co_comp_t g,
53 co_comp_t b, co_comp_t a,
54 paint_t *paint, mb_word_t *word);
55 extern mb_action_t *mb_rotate_new(float angle1, float angle2,
56 coord_t *coord, mb_word_t *word);
57
58 enum { VIS_VISIBLE, VIS_HIDDEN };
59 extern mb_action_t *mb_visibility_new(int visib, coord_t *coord,
60 mb_word_t *word);
61 /* @} */
62
31 /*! \defgroup act_support Action Supports. 63 /*! \defgroup act_support Action Supports.
32 * @{ 64 * @{
33 */ 65 */
34 /*! \brief Basic class of nnimation actions. 66 /*! \brief Basic class of animation actions.
35 * 67 *
36 * \sa \ref def_action 68 * \sa \ref def_action
37 */ 69 */
38 struct _mb_action { 70 struct _mb_action {
39 void (*start)(mb_action_t *act, 71 void (*start)(mb_action_t *act,
49 }; 81 };
50 82
51 extern void mb_word_add_action(mb_word_t *word, mb_action_t *act); 83 extern void mb_word_add_action(mb_word_t *word, mb_action_t *act);
52 /* @} */ 84 /* @} */
53 85
54 extern mb_progm_t *mb_progm_new(int max_words, redraw_man_t *rdman);
55 extern void mb_progm_free(mb_progm_t *progm);
56 extern mb_word_t *mb_progm_next_word(mb_progm_t *progm,
57 const mb_timeval_t *start,
58 const mb_timeval_t *playing);
59 extern void mb_progm_start(mb_progm_t *progm, mb_tman_t *tman,
60 mb_timeval_t *now);
61 extern void mb_progm_abort(mb_progm_t *progm, mb_tman_t *tman);
62 /*! \defgroup ani_actions Animation Actions
63 * @{
64 */
65 extern mb_action_t *mb_shift_new(co_aix x, co_aix y, coord_t *coord,
66 mb_word_t *word);
67 extern mb_action_t *mb_chgcolor_new(co_comp_t r, co_comp_t g,
68 co_comp_t b, co_comp_t a,
69 paint_t *paint, mb_word_t *word);
70 extern mb_action_t *mb_rotate_new(float angle1, float angle2,
71 coord_t *coord, mb_word_t *word);
72
73 enum { VIS_VISIBLE, VIS_HIDDEN };
74 extern mb_action_t *mb_visibility_new(int visib, coord_t *coord,
75 mb_word_t *word);
76 /* @} */
77
78 /* @} */ 86 /* @} */
79 87
80 #endif /* __ANIMATE_H_ */ 88 #endif /* __ANIMATE_H_ */