00001 #ifndef __ANIMATE_H_
00002 #define __ANIMATE_H_
00003
00004 #include "mb_types.h"
00005 #include "mb_timer.h"
00006 #include "mb_paint.h"
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 typedef struct _mb_progm mb_progm_t;
00029 typedef struct _mb_word mb_word_t;
00030 typedef struct _mb_action mb_action_t;
00031
00032 struct _mb_progm_complete {
00033 event_t event;
00034 mb_progm_t *progm;
00035 };
00036 typedef struct _mb_progm_complete mb_progm_complete_t;
00037
00038 extern mb_progm_t *mb_progm_new(int max_words, redraw_man_t *rdman);
00039 extern void mb_progm_free(mb_progm_t *progm);
00040 extern mb_word_t *mb_progm_next_word(mb_progm_t *progm,
00041 const mb_timeval_t *start,
00042 const mb_timeval_t *playing);
00043 extern void mb_progm_start(mb_progm_t *progm, mb_tman_t *tman,
00044 mb_timeval_t *now);
00045 extern void mb_progm_abort(mb_progm_t *progm);
00046 extern subject_t *mb_progm_get_complete(mb_progm_t *progm);
00047
00048
00049
00050
00051 extern mb_action_t *mb_shift_new(co_aix x, co_aix y, coord_t *coord,
00052 mb_word_t *word);
00053 extern mb_action_t *mb_chgcolor_new(co_comp_t r, co_comp_t g,
00054 co_comp_t b, co_comp_t a,
00055 paint_t *paint, mb_word_t *word);
00056 extern mb_action_t *mb_rotate_new(float angle1, float angle2,
00057 coord_t *coord, mb_word_t *word);
00058
00059 enum { VIS_VISIBLE, VIS_HIDDEN };
00060 extern mb_action_t *mb_visibility_new(int visib, coord_t *coord,
00061 mb_word_t *word);
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071 struct _mb_action {
00072 void (*start)(mb_action_t *act,
00073 const mb_timeval_t *now,
00074 const mb_timeval_t *playing_time,
00075 redraw_man_t *rdman);
00076 void (*step)(mb_action_t *act, const mb_timeval_t *now,
00077 redraw_man_t *rdman);
00078 void (*stop)(mb_action_t *act, const mb_timeval_t *now,
00079 redraw_man_t *rdman);
00080 void (*free)(mb_action_t *act);
00081 mb_action_t *next;
00082 };
00083
00084 extern void mb_word_add_action(mb_word_t *word, mb_action_t *act);
00085
00086
00087
00088
00089 #endif