comparison src/redraw_man.h @ 73:9ab15ebc9061

Observer for mouse events
author Thinker K.F. Li <thinker@branda.to>
date Mon, 18 Aug 2008 01:59:26 +0800
parents 943acee7f346
children 4c2d83721bcc
comparison
equal deleted inserted replaced
72:171a8cb7e4b5 73:9ab15ebc9061
2 #define __REDRAW_MAN_H_ 2 #define __REDRAW_MAN_H_
3 3
4 #include <cairo.h> 4 #include <cairo.h>
5 #include "tools.h" 5 #include "tools.h"
6 #include "mb_types.h" 6 #include "mb_types.h"
7 #include "observer.h"
7 8
8 /*! \brief Manage redrawing of shapes (graphic elements). 9 /*! \brief Manage redrawing of shapes (graphic elements).
9 * 10 *
10 * Every coord_t and geo_t object is assigned with a unique 11 * Every coord_t and geo_t object is assigned with a unique
11 * incremental order. The order is a unsigned integer. 12 * incremental order. The order is a unsigned integer.
32 coord_t *root_coord; 33 coord_t *root_coord;
33 34
34 elmpool_t *geo_pool; 35 elmpool_t *geo_pool;
35 elmpool_t *coord_pool; 36 elmpool_t *coord_pool;
36 elmpool_t *shnode_pool; 37 elmpool_t *shnode_pool;
38 elmpool_t *observer_pool;
39 elmpool_t *subject_pool;
37 40
38 int max_dirty_coords; 41 int max_dirty_coords;
39 int n_dirty_coords; 42 int n_dirty_coords;
40 coord_t **dirty_coords; 43 coord_t **dirty_coords;
41 44
51 int n_gen_geos; 54 int n_gen_geos;
52 geo_t **gen_geos; /* general geo list */ 55 geo_t **gen_geos; /* general geo list */
53 56
54 cairo_t *cr; 57 cairo_t *cr;
55 cairo_t *backend; 58 cairo_t *backend;
59
60 ob_factory_t ob_factory;
56 } redraw_man_t; 61 } redraw_man_t;
57 62
58 extern int redraw_man_init(redraw_man_t *rdman, cairo_t *cr, 63 extern int redraw_man_init(redraw_man_t *rdman, cairo_t *cr,
59 cairo_t *backend); 64 cairo_t *backend);
60 extern void redraw_man_destroy(redraw_man_t *rdman); 65 extern void redraw_man_destroy(redraw_man_t *rdman);
110 } while(0) 115 } while(0)
111 extern int rdman_paint_changed(redraw_man_t *rdman, paint_t *paint); 116 extern int rdman_paint_changed(redraw_man_t *rdman, paint_t *paint);
112 117
113 extern shape_t *find_shape_at_pos(redraw_man_t *rdman, 118 extern shape_t *find_shape_at_pos(redraw_man_t *rdman,
114 co_aix x, co_aix y, int *in_stroke); 119 co_aix x, co_aix y, int *in_stroke);
120 #define rdman_get_ob_factory(rdman) (&(rdman)->ob_factory)
115 121
116 122
117 #endif /* __REDRAW_MAN_H_ */ 123 #endif /* __REDRAW_MAN_H_ */