Mercurial > MadButterfly
annotate src/redraw_man.h @ 15:c2ce186a5c37
X_main uses rdman_redraw_all()
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Fri, 01 Aug 2008 01:40:07 +0800 |
parents | d34232f15863 |
children | e17e12b112c4 |
rev | line source |
---|---|
12 | 1 #ifndef __REDRAW_MAN_H_ |
2 #define __REDRAW_MAN_H_ | |
3 | |
15
c2ce186a5c37
X_main uses rdman_redraw_all()
Thinker K.F. Li <thinker@branda.to>
parents:
14
diff
changeset
|
4 #include <cairo.h> |
12 | 5 #include "tools.h" |
6 #include "mb_types.h" | |
7 | |
13 | 8 /*! \brief Manage redrawing of shapes (graphic elements). |
9 * | |
10 * Every coord_t and geo_t object is assigned with a unique | |
11 * incremental order. The order is a unsigned integer. | |
12 * Every time a new coord_t or geo_t object is added, it is | |
13 * assigned with a order number that 1 bigger than last one | |
14 * until reaching maximum of unsigned integer. | |
15 * When a maximum is meet, all coord_t or geo_t objects | |
16 * are reasigned with a new order number from 1. It means | |
17 * order numbers that have been assigned and then removed | |
18 * later are recycled. | |
19 * | |
20 * Dirty flag is clear when the transformation matrix of a coord | |
21 * object been recomputed or when a geo_t objects been redrawed. | |
22 */ | |
12 | 23 typedef struct _redraw_man { |
13 | 24 unsigned int next_geo_order; |
12 | 25 int n_geos; |
26 STAILQ(geo_t) all_geos; | |
13 | 27 |
28 unsigned int next_coord_order; | |
29 int n_coords; | |
12 | 30 coord_t *root_coord; |
13 | 31 |
12 | 32 elmpool_t *geo_pool; |
33 elmpool_t *coord_pool; | |
13 | 34 |
35 int max_dirty_coords; | |
36 int n_dirty_coords; | |
37 coord_t **dirty_coords; | |
38 | |
14 | 39 int max_dirty_geos; |
40 int n_dirty_geos; | |
41 geo_t **dirty_geos; | |
13 | 42 |
43 int max_dirty_areas; | |
44 int n_dirty_areas; | |
45 area_t **dirty_areas; | |
15
c2ce186a5c37
X_main uses rdman_redraw_all()
Thinker K.F. Li <thinker@branda.to>
parents:
14
diff
changeset
|
46 |
c2ce186a5c37
X_main uses rdman_redraw_all()
Thinker K.F. Li <thinker@branda.to>
parents:
14
diff
changeset
|
47 cairo_t *cr; |
12 | 48 } redraw_man_t; |
49 | |
15
c2ce186a5c37
X_main uses rdman_redraw_all()
Thinker K.F. Li <thinker@branda.to>
parents:
14
diff
changeset
|
50 extern int redraw_man_init(redraw_man_t *rdman, cairo_t *cr); |
12 | 51 extern void redraw_man_destroy(redraw_man_t *rdman); |
52 extern int rdman_find_overlaid_shapes(redraw_man_t *rdman, | |
53 geo_t *geo, | |
54 geo_t ***overlays); | |
55 extern int rdman_add_shape(redraw_man_t *rdman, | |
56 shape_t *shape, coord_t *coord); | |
57 extern int rdman_remove_shape(redraw_man_t *rdman, shape_t *shape); | |
58 extern coord_t *rdman_coord_new(redraw_man_t *rdman, coord_t *parent); | |
59 extern int rdman_coord_free(redraw_man_t *rdman, coord_t *coord); | |
15
c2ce186a5c37
X_main uses rdman_redraw_all()
Thinker K.F. Li <thinker@branda.to>
parents:
14
diff
changeset
|
60 extern int rdman_coord_changed(redraw_man_t *rdman, coord_t *coord); |
c2ce186a5c37
X_main uses rdman_redraw_all()
Thinker K.F. Li <thinker@branda.to>
parents:
14
diff
changeset
|
61 extern int rdman_redraw_changed(redraw_man_t *rdman); |
c2ce186a5c37
X_main uses rdman_redraw_all()
Thinker K.F. Li <thinker@branda.to>
parents:
14
diff
changeset
|
62 extern int rdman_redraw_all(redraw_man_t *rdman); |
12 | 63 |
64 | |
65 #endif /* __REDRAW_MAN_H_ */ |