Mercurial > MadButterfly
comparison src/redraw_man.h @ 154:6ce68c1f7405
Tank can fire bullet.
1. Add the redraw subject on redraw_man_t.
2. mb_c_source.m4 & mb_c_header.m4 are changed to free & remove shapes.
3. Add rdman_coord_subtree_free() to remove a subtree of coords.
4. Fix bug of rdman_remove_shape().
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Tue, 30 Sep 2008 02:44:06 +0800 |
parents | e96a584487af |
children | c1cdd3fcd28f |
comparison
equal
deleted
inserted
replaced
153:9870b049b7f6 | 154:6ce68c1f7405 |
---|---|
53 | 53 |
54 cairo_t *cr; | 54 cairo_t *cr; |
55 cairo_t *backend; | 55 cairo_t *backend; |
56 | 56 |
57 ob_factory_t ob_factory; | 57 ob_factory_t ob_factory; |
58 | |
59 subject_t *redraw; /*!< \brief Notified after redrawing. */ | |
58 } redraw_man_t; | 60 } redraw_man_t; |
59 | 61 |
60 extern int redraw_man_init(redraw_man_t *rdman, cairo_t *cr, | 62 extern int redraw_man_init(redraw_man_t *rdman, cairo_t *cr, |
61 cairo_t *backend); | 63 cairo_t *backend); |
62 extern void redraw_man_destroy(redraw_man_t *rdman); | 64 extern void redraw_man_destroy(redraw_man_t *rdman); |
66 extern int rdman_add_shape(redraw_man_t *rdman, | 68 extern int rdman_add_shape(redraw_man_t *rdman, |
67 shape_t *shape, coord_t *coord); | 69 shape_t *shape, coord_t *coord); |
68 extern int rdman_remove_shape(redraw_man_t *rdman, shape_t *shape); | 70 extern int rdman_remove_shape(redraw_man_t *rdman, shape_t *shape); |
69 extern coord_t *rdman_coord_new(redraw_man_t *rdman, coord_t *parent); | 71 extern coord_t *rdman_coord_new(redraw_man_t *rdman, coord_t *parent); |
70 extern int rdman_coord_free(redraw_man_t *rdman, coord_t *coord); | 72 extern int rdman_coord_free(redraw_man_t *rdman, coord_t *coord); |
73 extern int rdman_coord_subtree_free(redraw_man_t *rdman, coord_t *subtree); | |
71 extern int rdman_coord_changed(redraw_man_t *rdman, coord_t *coord); | 74 extern int rdman_coord_changed(redraw_man_t *rdman, coord_t *coord); |
72 extern int rdman_shape_changed(redraw_man_t *rdman, shape_t *shape); | 75 extern int rdman_shape_changed(redraw_man_t *rdman, shape_t *shape); |
73 extern int rdman_redraw_changed(redraw_man_t *rdman); | 76 extern int rdman_redraw_changed(redraw_man_t *rdman); |
74 extern int rdman_redraw_all(redraw_man_t *rdman); | 77 extern int rdman_redraw_all(redraw_man_t *rdman); |
75 extern int rdman_redraw_area(redraw_man_t *rdman, co_aix x, co_aix y, | 78 extern int rdman_redraw_area(redraw_man_t *rdman, co_aix x, co_aix y, |
114 extern int rdman_paint_changed(redraw_man_t *rdman, paint_t *paint); | 117 extern int rdman_paint_changed(redraw_man_t *rdman, paint_t *paint); |
115 | 118 |
116 extern shape_t *find_shape_at_pos(redraw_man_t *rdman, | 119 extern shape_t *find_shape_at_pos(redraw_man_t *rdman, |
117 co_aix x, co_aix y, int *in_stroke); | 120 co_aix x, co_aix y, int *in_stroke); |
118 #define rdman_get_ob_factory(rdman) (&(rdman)->ob_factory) | 121 #define rdman_get_ob_factory(rdman) (&(rdman)->ob_factory) |
122 #define rdman_get_redraw_subject(rdman) ((rdman)->redraw) | |
119 | 123 |
120 | 124 |
121 #endif /* __REDRAW_MAN_H_ */ | 125 #endif /* __REDRAW_MAN_H_ */ |