annotate include/mb_redraw_man.h @ 822:586e50f82c1f

Unify coding style tag for emacs and vim.
author Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
date Tue, 14 Sep 2010 01:08:39 +0800
parents f43224bf3524
children 048cc704bef7
rev   line source
822
586e50f82c1f Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents: 757
diff changeset
1 // -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 4; -*-
586e50f82c1f Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents: 757
diff changeset
2 // vim: sw=4:ts=8:sts=4
12
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
3 #ifndef __REDRAW_MAN_H_
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
4 #define __REDRAW_MAN_H_
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
5
448
16116d84bc5e Replace Cairo with a abstract layer mb_graph_engine.
Thinker K.F. Li <thinker@branda.to>
parents: 356
diff changeset
6 #include "mb_graph_engine.h"
186
530bb7728546 Move header files to $(top_srcdir)/include/ and prefixed with 'mb_'.
Thinker K.F. Li <thinker@branda.to>
parents: 185
diff changeset
7 #include "mb_tools.h"
12
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
8 #include "mb_types.h"
186
530bb7728546 Move header files to $(top_srcdir)/include/ and prefixed with 'mb_'.
Thinker K.F. Li <thinker@branda.to>
parents: 185
diff changeset
9 #include "mb_observer.h"
260
29acbd8a0dd0 Integrate sh_image with svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents: 257
diff changeset
10 #include "mb_img_ldr.h"
462
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
11 #include "mb_timer.h"
12
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
12
159
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
13 typedef struct _redraw_man redraw_man_t;
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
14
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
15 typedef void (*free_func_t)(redraw_man_t *rdman, void *obj);
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
16 struct _free_obj {
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
17 void *obj;
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
18 free_func_t free_func;
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
19 };
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
20 typedef struct _free_obj free_obj_t;
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
21 struct _free_objs {
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
22 int num, max;
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
23 free_obj_t *objs;
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
24 };
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
25 typedef struct _free_objs free_objs_t;
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
26
158
c1cdd3fcd28f Postponing rdman_coord_free() and rdman_remove_shape().
Thinker K.F. Li <thinker@branda.to>
parents: 154
diff changeset
27 DARRAY(coords, coord_t *);
c1cdd3fcd28f Postponing rdman_coord_free() and rdman_remove_shape().
Thinker K.F. Li <thinker@branda.to>
parents: 154
diff changeset
28 DARRAY(geos, geo_t *);
c1cdd3fcd28f Postponing rdman_coord_free() and rdman_remove_shape().
Thinker K.F. Li <thinker@branda.to>
parents: 154
diff changeset
29
13
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
30 /*! \brief Manage redrawing of shapes (graphic elements).
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
31 *
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
32 * Every coord_t and geo_t object is assigned with a unique
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
33 * incremental order. The order is a unsigned integer.
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
34 * Every time a new coord_t or geo_t object is added, it is
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
35 * assigned with a order number that 1 bigger than last one
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
36 * until reaching maximum of unsigned integer.
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
37 * When a maximum is meet, all coord_t or geo_t objects
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
38 * are reasigned with a new order number from 1. It means
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
39 * order numbers that have been assigned and then removed
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
40 * later are recycled.
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
41 *
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
42 * Dirty flag is clear when the transformation matrix of a coord
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
43 * object been recomputed or when a geo_t objects been redrawed.
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
44 */
159
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
45 struct _redraw_man {
13
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
46 unsigned int next_coord_order;
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
47 int n_coords;
12
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
48 coord_t *root_coord;
13
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
49
12
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
50 elmpool_t *geo_pool;
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
51 elmpool_t *coord_pool;
18
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
52 elmpool_t *shnode_pool;
73
9ab15ebc9061 Observer for mouse events
Thinker K.F. Li <thinker@branda.to>
parents: 37
diff changeset
53 elmpool_t *observer_pool;
9ab15ebc9061 Observer for mouse events
Thinker K.F. Li <thinker@branda.to>
parents: 37
diff changeset
54 elmpool_t *subject_pool;
146
e96a584487af Use elmpool to manage paint_color_t objects.
Thinker K.F. Li <thinker@branda.to>
parents: 139
diff changeset
55 elmpool_t *paint_color_pool;
224
29e1b2bffe4c X backend only sent EVT_MOUSE_MOVE_RAW to MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents: 186
diff changeset
56 elmpool_t *pent_pool;
314
6c350fc92ae3 Cache rednering result is now workable.
Thinker K.F. Li <thinker@branda.to>
parents: 270
diff changeset
57 elmpool_t *coord_canvas_pool;
13
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
58
158
c1cdd3fcd28f Postponing rdman_coord_free() and rdman_remove_shape().
Thinker K.F. Li <thinker@branda.to>
parents: 154
diff changeset
59 coords_t dirty_coords;
536
b6b3dbeaedf3 [mq]: pcached_area1.diff
Thinker K.F. Li <thinker@branda.to>
parents: 491
diff changeset
60 coords_t dirty_pcache_area_coords;
158
c1cdd3fcd28f Postponing rdman_coord_free() and rdman_remove_shape().
Thinker K.F. Li <thinker@branda.to>
parents: 154
diff changeset
61 geos_t dirty_geos;
314
6c350fc92ae3 Cache rednering result is now workable.
Thinker K.F. Li <thinker@branda.to>
parents: 270
diff changeset
62 int n_dirty_areas; /*!< \brief Number of all dirty areas. */
13
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
63
158
c1cdd3fcd28f Postponing rdman_coord_free() and rdman_remove_shape().
Thinker K.F. Li <thinker@branda.to>
parents: 154
diff changeset
64 geos_t gen_geos;
314
6c350fc92ae3 Cache rednering result is now workable.
Thinker K.F. Li <thinker@branda.to>
parents: 270
diff changeset
65 coords_t zeroing_coords;
13
ed55009d96d3 refactory for redrawing
Thinker K.F. Li <thinker@branda.to>
parents: 12
diff changeset
66
159
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
67 STAILQ(shape_t) shapes; /*!< \brief All managed shapes. */
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
68 STAILQ(paint_t) paints; /*!< \brief All managed paints. */
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
69
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
70 free_objs_t free_objs;
30
e06a4a667ce2 Accept mouse/pointer event and hint the shape that the pointer is over.
Thinker K.F. Li <thinker@branda.to>
parents: 24
diff changeset
71
448
16116d84bc5e Replace Cairo with a abstract layer mb_graph_engine.
Thinker K.F. Li <thinker@branda.to>
parents: 356
diff changeset
72 mbe_t *cr;
16116d84bc5e Replace Cairo with a abstract layer mb_graph_engine.
Thinker K.F. Li <thinker@branda.to>
parents: 356
diff changeset
73 mbe_t *backend;
73
9ab15ebc9061 Observer for mouse events
Thinker K.F. Li <thinker@branda.to>
parents: 37
diff changeset
74
9ab15ebc9061 Observer for mouse events
Thinker K.F. Li <thinker@branda.to>
parents: 37
diff changeset
75 ob_factory_t ob_factory;
154
6ce68c1f7405 Tank can fire bullet.
Thinker K.F. Li <thinker@branda.to>
parents: 146
diff changeset
76
6ce68c1f7405 Tank can fire bullet.
Thinker K.F. Li <thinker@branda.to>
parents: 146
diff changeset
77 subject_t *redraw; /*!< \brief Notified after redrawing. */
224
29e1b2bffe4c X backend only sent EVT_MOUSE_MOVE_RAW to MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents: 186
diff changeset
78 subject_t *addrm_monitor; /*!< \brief Monitor adding/removing observers
29e1b2bffe4c X backend only sent EVT_MOUSE_MOVE_RAW to MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents: 186
diff changeset
79 * to/from mouse event subjects.
231
2637519e2bd7 Move mouse event handler and interpreter to src/mouse.c.
Thinker K.F. Li <thinker@branda.to>
parents: 227
diff changeset
80 * \see addrm_monitor_hdlr()
224
29e1b2bffe4c X backend only sent EVT_MOUSE_MOVE_RAW to MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents: 186
diff changeset
81 */
29e1b2bffe4c X backend only sent EVT_MOUSE_MOVE_RAW to MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents: 186
diff changeset
82 mb_obj_t *last_mouse_over;
822
586e50f82c1f Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents: 757
diff changeset
83 void *rt; /*!< \brief This is a pointer to the current
586e50f82c1f Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents: 757
diff changeset
84 * graphic backend.
249
ab8284c8dcee * Add loopback reference from rdman to the backend. This is only required when we need to acquire the tman for the animation. This is not a reasonable arrangement since the animation should be backend transparent. We should not touch the backend directly from the animation. We should relocate the tman to the rdman.
wycc
parents: 235
diff changeset
85 * \see rdman_attach_backend()
ab8284c8dcee * Add loopback reference from rdman to the backend. This is only required when we need to acquire the tman for the animation. This is not a reasonable arrangement since the animation should be backend transparent. We should not touch the backend directly from the animation. We should relocate the tman to the rdman.
wycc
parents: 235
diff changeset
86 */
257
50d253d0fcba Simple image loader and image shape.
Thinker K.F. Li <thinker@branda.to>
parents: 253
diff changeset
87 mb_prop_store_t props;
260
29acbd8a0dd0 Integrate sh_image with svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents: 257
diff changeset
88 mb_img_ldr_t *img_ldr; /*!< \brief Image Loader.
29acbd8a0dd0 Integrate sh_image with svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents: 257
diff changeset
89 * This is initialized by backend.
29acbd8a0dd0 Integrate sh_image with svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents: 257
diff changeset
90 */
270
cd6af7da32c9 Fix the problem that clean_canvas() can not clean canvas cleanly.
Thinker K.F. Li <thinker@branda.to>
parents: 265
diff changeset
91 co_aix w, h; /*!< \brief Size of viewport
cd6af7da32c9 Fix the problem that clean_canvas() can not clean canvas cleanly.
Thinker K.F. Li <thinker@branda.to>
parents: 265
diff changeset
92 * This is initialized by backend.
cd6af7da32c9 Fix the problem that clean_canvas() can not clean canvas cleanly.
Thinker K.F. Li <thinker@branda.to>
parents: 265
diff changeset
93 */
159
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
94 };
12
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
95
448
16116d84bc5e Replace Cairo with a abstract layer mb_graph_engine.
Thinker K.F. Li <thinker@branda.to>
parents: 356
diff changeset
96 extern int redraw_man_init(redraw_man_t *rdman, mbe_t *cr,
16116d84bc5e Replace Cairo with a abstract layer mb_graph_engine.
Thinker K.F. Li <thinker@branda.to>
parents: 356
diff changeset
97 mbe_t *backend);
12
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
98 extern void redraw_man_destroy(redraw_man_t *rdman);
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
99 extern int rdman_find_overlaid_shapes(redraw_man_t *rdman,
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
100 geo_t *geo,
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
101 geo_t ***overlays);
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
102 extern int rdman_add_shape(redraw_man_t *rdman,
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
103 shape_t *shape, coord_t *coord);
159
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
104 /*! \brief Make a shape been managed by a redraw manager. */
224
29e1b2bffe4c X backend only sent EVT_MOUSE_MOVE_RAW to MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents: 186
diff changeset
105 #define rdman_shape_man(rdman, shape) \
29e1b2bffe4c X backend only sent EVT_MOUSE_MOVE_RAW to MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents: 186
diff changeset
106 do { \
29e1b2bffe4c X backend only sent EVT_MOUSE_MOVE_RAW to MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents: 186
diff changeset
107 mb_prop_store_init(&((mb_obj_t *)(shape))->props, \
29e1b2bffe4c X backend only sent EVT_MOUSE_MOVE_RAW to MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents: 186
diff changeset
108 (rdman)->pent_pool); \
29e1b2bffe4c X backend only sent EVT_MOUSE_MOVE_RAW to MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents: 186
diff changeset
109 STAILQ_INS_TAIL(rdman->shapes, shape_t, sh_next, shape); \
29e1b2bffe4c X backend only sent EVT_MOUSE_MOVE_RAW to MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents: 186
diff changeset
110 if(rdman->last_mouse_over == (mb_obj_t *)(shape)) \
29e1b2bffe4c X backend only sent EVT_MOUSE_MOVE_RAW to MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents: 186
diff changeset
111 rdman->last_mouse_over = NULL; \
672
cbad519226d4 Make sh_image_t managed, and init property store for managed shapes
Thinker K.F. Li <thinker@branda.to>
parents: 536
diff changeset
112 mb_prop_store_init(&((mb_obj_t *)(shape))->props, \
cbad519226d4 Make sh_image_t managed, and init property store for managed shapes
Thinker K.F. Li <thinker@branda.to>
parents: 536
diff changeset
113 (rdman)->pent_pool); \
224
29e1b2bffe4c X backend only sent EVT_MOUSE_MOVE_RAW to MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents: 186
diff changeset
114 } while(0)
159
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
115 extern int rdman_shape_free(redraw_man_t *rdman, shape_t *shape);
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
116
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
117 extern int rdman_paint_free(redraw_man_t *rdman, paint_t *paint);
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
118
12
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
119 extern coord_t *rdman_coord_new(redraw_man_t *rdman, coord_t *parent);
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
120 extern int rdman_coord_free(redraw_man_t *rdman, coord_t *coord);
154
6ce68c1f7405 Tank can fire bullet.
Thinker K.F. Li <thinker@branda.to>
parents: 146
diff changeset
121 extern int rdman_coord_subtree_free(redraw_man_t *rdman, coord_t *subtree);
15
c2ce186a5c37 X_main uses rdman_redraw_all()
Thinker K.F. Li <thinker@branda.to>
parents: 14
diff changeset
122 extern int rdman_coord_changed(redraw_man_t *rdman, coord_t *coord);
16
e17e12b112c4 A simple animation using rdman_redraw_changed().
Thinker K.F. Li <thinker@branda.to>
parents: 15
diff changeset
123 extern int rdman_shape_changed(redraw_man_t *rdman, shape_t *shape);
15
c2ce186a5c37 X_main uses rdman_redraw_all()
Thinker K.F. Li <thinker@branda.to>
parents: 14
diff changeset
124 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
125 extern int rdman_redraw_all(redraw_man_t *rdman);
37
943acee7f346 update exposed area
Thinker K.F. Li <thinker@branda.to>
parents: 30
diff changeset
126 extern int rdman_redraw_area(redraw_man_t *rdman, co_aix x, co_aix y,
943acee7f346 update exposed area
Thinker K.F. Li <thinker@branda.to>
parents: 30
diff changeset
127 co_aix w, co_aix h);
139
1695a4b02b14 Members of coords are geos instead of shapes, now.
Thinker K.F. Li <thinker@branda.to>
parents: 133
diff changeset
128 extern geo_t *rdman_geos(redraw_man_t *rdman, geo_t *last);
235
65cabbdd5284 termporary revision
Thinker K.F. Li <thinker@branda.to>
parents: 232
diff changeset
129 #define rdman_shapes(rdman, last_shape) \
65cabbdd5284 termporary revision
Thinker K.F. Li <thinker@branda.to>
parents: 232
diff changeset
130 geo_get_shape_safe(rdman_geos(rdman, sh_get_geo_safe(last_shape)))
30
e06a4a667ce2 Accept mouse/pointer event and hint the shape that the pointer is over.
Thinker K.F. Li <thinker@branda.to>
parents: 24
diff changeset
131 extern int rdman_force_clean(redraw_man_t *rdman);
18
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
132 extern shnode_t *shnode_new(redraw_man_t *rdman, shape_t *shape);
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
133 #define shnode_free(rdman, node) elmpool_elm_free((rdman)->shnode_pool, node)
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
134 #define shnode_list_free(rdman, q) \
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
135 do { \
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
136 shnode_t *__node, *__last; \
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
137 __last = STAILQ_HEAD(q); \
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
138 if(__last == NULL) break; \
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
139 for(__node = STAILQ_NEXT(shnode_t, next, __last); \
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
140 __node != NULL; \
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
141 __node = STAILQ_NEXT(shnode_t, next, __node)) { \
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
142 shnode_free(rdman, __last); \
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
143 __last = __node; \
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
144 } \
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
145 shnode_free(rdman, __last); \
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
146 } while(0)
22
8fcf2d878ecd shapes with stroke
Thinker K.F. Li <thinker@branda.to>
parents: 18
diff changeset
147 #define _rdman_paint_child(rdman, paint, shape) \
18
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
148 do { \
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
149 shnode_t *__node; \
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
150 if((shape)->fill != (paint) && \
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
151 (shape)->stroke != (paint)) { \
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
152 __node = shnode_new(rdman, shape); \
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
153 STAILQ_INS_TAIL((paint)->members, \
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
154 shnode_t, next, __node); \
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
155 } \
22
8fcf2d878ecd shapes with stroke
Thinker K.F. Li <thinker@branda.to>
parents: 18
diff changeset
156 } while(0)
159
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
157 extern void _rdman_paint_real_remove_child(redraw_man_t *rdman,
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
158 paint_t *paint,
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
159 shape_t *shape);
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
160 #define _rdman_paint_remove_child(rdman, paint, shape) \
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
161 do { \
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
162 if((shape)->fill == (shape)->stroke && \
490
5d0b2761f89c Reset stroke and fill for shapes when a paint is freed.
Thinker K.F. Li <thinker@branda.to>
parents: 462
diff changeset
163 (shape)->stroke == (paint)) \
159
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
164 break; \
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
165 _rdman_paint_real_remove_child(rdman, paint, shape); \
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 158
diff changeset
166 } while(0)
490
5d0b2761f89c Reset stroke and fill for shapes when a paint is freed.
Thinker K.F. Li <thinker@branda.to>
parents: 462
diff changeset
167 #define rdman_paint_fill(rdman, paint, shape) \
5d0b2761f89c Reset stroke and fill for shapes when a paint is freed.
Thinker K.F. Li <thinker@branda.to>
parents: 462
diff changeset
168 do { \
5d0b2761f89c Reset stroke and fill for shapes when a paint is freed.
Thinker K.F. Li <thinker@branda.to>
parents: 462
diff changeset
169 if((shape)->fill == paint) \
5d0b2761f89c Reset stroke and fill for shapes when a paint is freed.
Thinker K.F. Li <thinker@branda.to>
parents: 462
diff changeset
170 break; \
5d0b2761f89c Reset stroke and fill for shapes when a paint is freed.
Thinker K.F. Li <thinker@branda.to>
parents: 462
diff changeset
171 if((shape)->fill) \
5d0b2761f89c Reset stroke and fill for shapes when a paint is freed.
Thinker K.F. Li <thinker@branda.to>
parents: 462
diff changeset
172 _rdman_paint_remove_child(rdman, (shape)->fill, \
5d0b2761f89c Reset stroke and fill for shapes when a paint is freed.
Thinker K.F. Li <thinker@branda.to>
parents: 462
diff changeset
173 shape); \
5d0b2761f89c Reset stroke and fill for shapes when a paint is freed.
Thinker K.F. Li <thinker@branda.to>
parents: 462
diff changeset
174 if(paint) \
5d0b2761f89c Reset stroke and fill for shapes when a paint is freed.
Thinker K.F. Li <thinker@branda.to>
parents: 462
diff changeset
175 _rdman_paint_child(rdman, paint, shape); \
5d0b2761f89c Reset stroke and fill for shapes when a paint is freed.
Thinker K.F. Li <thinker@branda.to>
parents: 462
diff changeset
176 (shape)->fill = paint; \
18
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
177 } while(0)
490
5d0b2761f89c Reset stroke and fill for shapes when a paint is freed.
Thinker K.F. Li <thinker@branda.to>
parents: 462
diff changeset
178 #define rdman_paint_stroke(rdman, paint, shape) \
5d0b2761f89c Reset stroke and fill for shapes when a paint is freed.
Thinker K.F. Li <thinker@branda.to>
parents: 462
diff changeset
179 do { \
5d0b2761f89c Reset stroke and fill for shapes when a paint is freed.
Thinker K.F. Li <thinker@branda.to>
parents: 462
diff changeset
180 if((shape)->stroke == paint) \
5d0b2761f89c Reset stroke and fill for shapes when a paint is freed.
Thinker K.F. Li <thinker@branda.to>
parents: 462
diff changeset
181 break; \
5d0b2761f89c Reset stroke and fill for shapes when a paint is freed.
Thinker K.F. Li <thinker@branda.to>
parents: 462
diff changeset
182 if((shape)->stroke) \
5d0b2761f89c Reset stroke and fill for shapes when a paint is freed.
Thinker K.F. Li <thinker@branda.to>
parents: 462
diff changeset
183 _rdman_paint_remove_child(rdman, (shape)->stroke, \
5d0b2761f89c Reset stroke and fill for shapes when a paint is freed.
Thinker K.F. Li <thinker@branda.to>
parents: 462
diff changeset
184 shape); \
5d0b2761f89c Reset stroke and fill for shapes when a paint is freed.
Thinker K.F. Li <thinker@branda.to>
parents: 462
diff changeset
185 if(paint) \
5d0b2761f89c Reset stroke and fill for shapes when a paint is freed.
Thinker K.F. Li <thinker@branda.to>
parents: 462
diff changeset
186 _rdman_paint_child(rdman, paint, shape); \
5d0b2761f89c Reset stroke and fill for shapes when a paint is freed.
Thinker K.F. Li <thinker@branda.to>
parents: 462
diff changeset
187 (shape)->stroke = paint; \
22
8fcf2d878ecd shapes with stroke
Thinker K.F. Li <thinker@branda.to>
parents: 18
diff changeset
188 } while(0)
18
0f3baa488a62 Support solid color paint for fill.
Thinker K.F. Li <thinker@branda.to>
parents: 16
diff changeset
189 extern int rdman_paint_changed(redraw_man_t *rdman, paint_t *paint);
12
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
190
30
e06a4a667ce2 Accept mouse/pointer event and hint the shape that the pointer is over.
Thinker K.F. Li <thinker@branda.to>
parents: 24
diff changeset
191 extern shape_t *find_shape_at_pos(redraw_man_t *rdman,
e06a4a667ce2 Accept mouse/pointer event and hint the shape that the pointer is over.
Thinker K.F. Li <thinker@branda.to>
parents: 24
diff changeset
192 co_aix x, co_aix y, int *in_stroke);
232
527894c2ad39 Add functions for collision test.
Thinker K.F. Li <thinker@branda.to>
parents: 231
diff changeset
193 extern int mb_obj_pos_is_in(redraw_man_t *rdman, mb_obj_t *obj,
527894c2ad39 Add functions for collision test.
Thinker K.F. Li <thinker@branda.to>
parents: 231
diff changeset
194 co_aix x, co_aix y, int *in_stroke);
253
99a9cca4bbd0 Fix typo in mb_redraw_man.h
Thinker K.F. Li <thinker@branda.to>
parents: 249
diff changeset
195 extern int mb_objs_are_overlay(redraw_man_t *rdman,
99a9cca4bbd0 Fix typo in mb_redraw_man.h
Thinker K.F. Li <thinker@branda.to>
parents: 249
diff changeset
196 mb_obj_t *obj1, mb_obj_t *obj2);
73
9ab15ebc9061 Observer for mouse events
Thinker K.F. Li <thinker@branda.to>
parents: 37
diff changeset
197 #define rdman_get_ob_factory(rdman) (&(rdman)->ob_factory)
154
6ce68c1f7405 Tank can fire bullet.
Thinker K.F. Li <thinker@branda.to>
parents: 146
diff changeset
198 #define rdman_get_redraw_subject(rdman) ((rdman)->redraw)
224
29e1b2bffe4c X backend only sent EVT_MOUSE_MOVE_RAW to MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents: 186
diff changeset
199 #define rdman_get_root(rdman) ((rdman)->root_coord)
235
65cabbdd5284 termporary revision
Thinker K.F. Li <thinker@branda.to>
parents: 232
diff changeset
200 #define rdman_get_cr(rdman) ((rdman)->cr)
65cabbdd5284 termporary revision
Thinker K.F. Li <thinker@branda.to>
parents: 232
diff changeset
201 #define rdman_get_gen_geos(rdman) (&(rdman)->gen_geos)
65cabbdd5284 termporary revision
Thinker K.F. Li <thinker@branda.to>
parents: 232
diff changeset
202 extern int rdman_add_gen_geos(redraw_man_t *rdman, geo_t *geo);
65cabbdd5284 termporary revision
Thinker K.F. Li <thinker@branda.to>
parents: 232
diff changeset
203 #define rdman_get_shape_gl(rdman, idx) \
65cabbdd5284 termporary revision
Thinker K.F. Li <thinker@branda.to>
parents: 232
diff changeset
204 geo_get_shape(rdman_get_gen_geos(rdman)->ds[idx])
65cabbdd5284 termporary revision
Thinker K.F. Li <thinker@branda.to>
parents: 232
diff changeset
205 #define rdman_add_shape_gl(rdman, shape) \
65cabbdd5284 termporary revision
Thinker K.F. Li <thinker@branda.to>
parents: 232
diff changeset
206 rdman_add_gen_geos(rdman, sh_get_geo(shape))
65cabbdd5284 termporary revision
Thinker K.F. Li <thinker@branda.to>
parents: 232
diff changeset
207 #define rdman_shape_gl_len(rdman) \
65cabbdd5284 termporary revision
Thinker K.F. Li <thinker@branda.to>
parents: 232
diff changeset
208 rdman_get_gen_geos(rdman)->num
65cabbdd5284 termporary revision
Thinker K.F. Li <thinker@branda.to>
parents: 232
diff changeset
209 #define rdman_clear_shape_gl(rdman) \
65cabbdd5284 termporary revision
Thinker K.F. Li <thinker@branda.to>
parents: 232
diff changeset
210 DARRAY_CLEAN(rdman_get_gen_geos(rdman))
260
29acbd8a0dd0 Integrate sh_image with svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents: 257
diff changeset
211 #define rdman_prop_store(rdman) ((rdman)->props)
29acbd8a0dd0 Integrate sh_image with svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents: 257
diff changeset
212 #define rdman_img_ldr(rdman) ((rdman)->img_ldr)
265
b42ee279669e Change function name and add comments.
Thinker K.F. Li <thinker@branda.to>
parents: 260
diff changeset
213 #define rdman_set_img_ldr(rdman, ldr) \
b42ee279669e Change function name and add comments.
Thinker K.F. Li <thinker@branda.to>
parents: 260
diff changeset
214 do { (rdman)->img_ldr = ldr; } while(0)
30
e06a4a667ce2 Accept mouse/pointer event and hint the shape that the pointer is over.
Thinker K.F. Li <thinker@branda.to>
parents: 24
diff changeset
215
249
ab8284c8dcee * Add loopback reference from rdman to the backend. This is only required when we need to acquire the tman for the animation. This is not a reasonable arrangement since the animation should be backend transparent. We should not touch the backend directly from the animation. We should relocate the tman to the rdman.
wycc
parents: 235
diff changeset
216 /*! \brief Attach backend to the redraw manager so that we can hide the backend from the users.
ab8284c8dcee * Add loopback reference from rdman to the backend. This is only required when we need to acquire the tman for the animation. This is not a reasonable arrangement since the animation should be backend transparent. We should not touch the backend directly from the animation. We should relocate the tman to the rdman.
wycc
parents: 235
diff changeset
217 *
ab8284c8dcee * Add loopback reference from rdman to the backend. This is only required when we need to acquire the tman for the animation. This is not a reasonable arrangement since the animation should be backend transparent. We should not touch the backend directly from the animation. We should relocate the tman to the rdman.
wycc
parents: 235
diff changeset
218 */
ab8284c8dcee * Add loopback reference from rdman to the backend. This is only required when we need to acquire the tman for the animation. This is not a reasonable arrangement since the animation should be backend transparent. We should not touch the backend directly from the animation. We should relocate the tman to the rdman.
wycc
parents: 235
diff changeset
219 #define rdman_attach_backend(rdman,backend) (((rdman)->rt)=(backend))
822
586e50f82c1f Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents: 757
diff changeset
220 /*! \brief Load sprite dymanicly from the shared object module.
586e50f82c1f Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents: 757
diff changeset
221 *
260
29acbd8a0dd0 Integrate sh_image with svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents: 257
diff changeset
222 * The search path can be changed by sprite_set_search_path. The name
29acbd8a0dd0 Integrate sh_image with svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents: 257
diff changeset
223 * can have a relative path in the front of it.
29acbd8a0dd0 Integrate sh_image with svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents: 257
diff changeset
224 * This function will search the object in the current working directory
29acbd8a0dd0 Integrate sh_image with svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents: 257
diff changeset
225 * and then search the system search path.
227
a6e559fb76d7 Add dynamic loading function for sprite
wycc
parents: 224
diff changeset
226 */
356
3e84458968ec Move mb_img_data_t out from argument list of rdman_shape_image_new().
Thinker K.F. Li <thinker@branda.to>
parents: 314
diff changeset
227 extern mb_sprite_t *sprite_load(const char *name, redraw_man_t *rdman,
3e84458968ec Move mb_img_data_t out from argument list of rdman_shape_image_new().
Thinker K.F. Li <thinker@branda.to>
parents: 314
diff changeset
228 coord_t *root);
227
a6e559fb76d7 Add dynamic loading function for sprite
wycc
parents: 224
diff changeset
229
a6e559fb76d7 Add dynamic loading function for sprite
wycc
parents: 224
diff changeset
230 /*! \brief Set the search path of dymanic object loading.
a6e559fb76d7 Add dynamic loading function for sprite
wycc
parents: 224
diff changeset
231 *
a6e559fb76d7 Add dynamic loading function for sprite
wycc
parents: 224
diff changeset
232 */
356
3e84458968ec Move mb_img_data_t out from argument list of rdman_shape_image_new().
Thinker K.F. Li <thinker@branda.to>
parents: 314
diff changeset
233 extern void sprite_set_search_path(char *path);
3e84458968ec Move mb_img_data_t out from argument list of rdman_shape_image_new().
Thinker K.F. Li <thinker@branda.to>
parents: 314
diff changeset
234
3e84458968ec Move mb_img_data_t out from argument list of rdman_shape_image_new().
Thinker K.F. Li <thinker@branda.to>
parents: 314
diff changeset
235 extern paint_t *rdman_img_ldr_load_paint(redraw_man_t *rdman,
3e84458968ec Move mb_img_data_t out from argument list of rdman_shape_image_new().
Thinker K.F. Li <thinker@branda.to>
parents: 314
diff changeset
236 const char *img_id);
12
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
237
462
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
238 typedef void (*mb_eventcb_t )(int fd,void *arg);
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
239 #define MONITOR_READ 1
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
240 #define MONITOR_WRITE 2
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
241
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
242 /*! \brief The backend engine mb_backend_t is used to define the interface to realize the MB.
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
243 *
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
244 * A backend is used to receive events from the system. The MB does not define the backend by itself.
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
245 * Instead, it define an interface which allow the lower layer to implement the event system. Each
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
246 * backend need to provides the following events.
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
247 *
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
248 * - keyboard event
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
249 * - timer event
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
250 * - image loader(?)
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
251 * - render manager(?)
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
252 */
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
253 typedef struct {
822
586e50f82c1f Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents: 757
diff changeset
254
757
f43224bf3524 Remove unused variables and refactor to X_MB_init_with_win
Thinker K.F. Li <thinker@codemud.net>
parents: 672
diff changeset
255 void *(*init)(const char *display,int w,int h);
462
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
256 void (*free)(void *be);
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
257 void (*add_event)(void *be,int type, int fd, mb_eventcb_t f,void *arg);
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
258 void (*remove_event)(void *be,int type, int fd);
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
259 void (*loop)(void *be);
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
260 subject_t *(*kbevents)(void *be);
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
261 redraw_man_t *(*rdman)(void *be);
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
262 mb_tman_t *(*tman)(void *be);
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
263 ob_factory_t *(*factory)(void *be);
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
264 mb_img_ldr_t *(*loader)(void *be);
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
265 } mb_backend_t;
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
266
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
267 extern mb_backend_t backend;
af4b506ad56f Add backend layer to seperate the backend with the MBAF. Currently, X is the only backend. If we have more than one backend, we need to modify the Makefile to sleect the backend or implement a backend selection mechanism in the runtime.
wycc@122-116-38-188.HINET-IP.hinet.net
parents: 448
diff changeset
268
12
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
269 #endif /* __REDRAW_MAN_H_ */