comparison include/mb_redraw_man.h @ 224:29e1b2bffe4c

X backend only sent EVT_MOUSE_MOVE_RAW to MadButterfly. - backend does not interpret mouse events (over/out/move), now. - redraw manager, now, interpret mouse events to make it backend independent. - The task (interpret mouse events) should be moved to somewhere in futhure. - backend only sent MotionNotify as EVT_MOUSE_MOVE_RAW. - EVT_MOUSE_MOVE_RAW is interpreted by backend independent code.
author Thinker K.F. Li <thinker@branda.to>
date Mon, 15 Dec 2008 10:13:03 +0800
parents 530bb7728546
children a6e559fb76d7
comparison
equal deleted inserted replaced
223:8be36a0d4239 224:29e1b2bffe4c
48 elmpool_t *coord_pool; 48 elmpool_t *coord_pool;
49 elmpool_t *shnode_pool; 49 elmpool_t *shnode_pool;
50 elmpool_t *observer_pool; 50 elmpool_t *observer_pool;
51 elmpool_t *subject_pool; 51 elmpool_t *subject_pool;
52 elmpool_t *paint_color_pool; 52 elmpool_t *paint_color_pool;
53 elmpool_t *pent_pool;
53 54
54 coords_t dirty_coords; 55 coords_t dirty_coords;
55 geos_t dirty_geos; 56 geos_t dirty_geos;
56 areas_t dirty_areas; 57 areas_t dirty_areas;
57 58
66 cairo_t *backend; 67 cairo_t *backend;
67 68
68 ob_factory_t ob_factory; 69 ob_factory_t ob_factory;
69 70
70 subject_t *redraw; /*!< \brief Notified after redrawing. */ 71 subject_t *redraw; /*!< \brief Notified after redrawing. */
72 subject_t *addrm_monitor; /*!< \brief Monitor adding/removing observers
73 * to/from mouse event subjects.
74 */
75 mb_obj_t *last_mouse_over;
71 }; 76 };
72 77
73 extern int redraw_man_init(redraw_man_t *rdman, cairo_t *cr, 78 extern int redraw_man_init(redraw_man_t *rdman, cairo_t *cr,
74 cairo_t *backend); 79 cairo_t *backend);
75 extern void redraw_man_destroy(redraw_man_t *rdman); 80 extern void redraw_man_destroy(redraw_man_t *rdman);
77 geo_t *geo, 82 geo_t *geo,
78 geo_t ***overlays); 83 geo_t ***overlays);
79 extern int rdman_add_shape(redraw_man_t *rdman, 84 extern int rdman_add_shape(redraw_man_t *rdman,
80 shape_t *shape, coord_t *coord); 85 shape_t *shape, coord_t *coord);
81 /*! \brief Make a shape been managed by a redraw manager. */ 86 /*! \brief Make a shape been managed by a redraw manager. */
82 #define rdman_shape_man(rdman, shape) \ 87 #define rdman_shape_man(rdman, shape) \
83 STAILQ_INS_TAIL(rdman->shapes, shape_t, sh_next, shape) 88 do { \
89 mb_prop_store_init(&((mb_obj_t *)(shape))->props, \
90 (rdman)->pent_pool); \
91 STAILQ_INS_TAIL(rdman->shapes, shape_t, sh_next, shape); \
92 if(rdman->last_mouse_over == (mb_obj_t *)(shape)) \
93 rdman->last_mouse_over = NULL; \
94 } while(0)
84 extern int rdman_shape_free(redraw_man_t *rdman, shape_t *shape); 95 extern int rdman_shape_free(redraw_man_t *rdman, shape_t *shape);
85 96
86 #define rdman_paint_man(rdman, paint) \ 97 #define rdman_paint_man(rdman, paint) \
87 STAILQ_INS_TAIL(rdman->paints, paint_t, pnt_next, shape) 98 STAILQ_INS_TAIL(rdman->paints, paint_t, pnt_next, shape)
88 extern int rdman_paint_free(redraw_man_t *rdman, paint_t *paint); 99 extern int rdman_paint_free(redraw_man_t *rdman, paint_t *paint);
153 164
154 extern shape_t *find_shape_at_pos(redraw_man_t *rdman, 165 extern shape_t *find_shape_at_pos(redraw_man_t *rdman,
155 co_aix x, co_aix y, int *in_stroke); 166 co_aix x, co_aix y, int *in_stroke);
156 #define rdman_get_ob_factory(rdman) (&(rdman)->ob_factory) 167 #define rdman_get_ob_factory(rdman) (&(rdman)->ob_factory)
157 #define rdman_get_redraw_subject(rdman) ((rdman)->redraw) 168 #define rdman_get_redraw_subject(rdman) ((rdman)->redraw)
169 #define rdman_get_root(rdman) ((rdman)->root_coord)
158 170
159 171
160 #endif /* __REDRAW_MAN_H_ */ 172 #endif /* __REDRAW_MAN_H_ */