Mercurial > MadButterfly
comparison include/mb_redraw_man.h @ 1044:5d4bc2a93c09
Merge from refine_backend_if branch
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Tue, 23 Nov 2010 11:58:04 +0800 |
parents | 7ccc094bdbe5 |
children | 83f39fdfbdaa |
comparison
equal
deleted
inserted
replaced
1035:18329b6f77a4 | 1044:5d4bc2a93c09 |
---|---|
6 #include "mb_graph_engine.h" | 6 #include "mb_graph_engine.h" |
7 #include "mb_tools.h" | 7 #include "mb_tools.h" |
8 #include "mb_types.h" | 8 #include "mb_types.h" |
9 #include "mb_observer.h" | 9 #include "mb_observer.h" |
10 #include "mb_img_ldr.h" | 10 #include "mb_img_ldr.h" |
11 #include "mb_timer.h" | |
12 | 11 |
13 typedef struct _redraw_man redraw_man_t; | 12 typedef struct _redraw_man redraw_man_t; |
14 | 13 |
15 typedef void (*free_func_t)(redraw_man_t *rdman, void *obj); | 14 typedef void (*free_func_t)(redraw_man_t *rdman, void *obj); |
16 struct _free_obj { | 15 struct _free_obj { |
232 coord_t *root); | 231 coord_t *root); |
233 | 232 |
234 /*! \brief Set the search path of dymanic object loading. | 233 /*! \brief Set the search path of dymanic object loading. |
235 * | 234 * |
236 */ | 235 */ |
237 extern void sprite_set_search_path(char *path); | 236 extern void sprite_set_search_path(const char *path); |
238 | 237 |
239 extern paint_t *rdman_img_ldr_load_paint(redraw_man_t *rdman, | 238 extern paint_t *rdman_img_ldr_load_paint(redraw_man_t *rdman, |
240 const char *img_id); | 239 const char *img_id); |
241 | 240 |
242 typedef void (*mb_eventcb_t )(int fd,void *arg); | 241 typedef void (*mb_eventcb_t )(int fd,void *arg); |
243 #define MONITOR_READ 1 | 242 #define MONITOR_READ 1 |
244 #define MONITOR_WRITE 2 | 243 #define MONITOR_WRITE 2 |
245 | 244 |
246 /*! \brief The backend engine mb_backend_t is used to define the interface to realize the MB. | |
247 * | |
248 * A backend is used to receive events from the system. The MB does not define the backend by itself. | |
249 * Instead, it define an interface which allow the lower layer to implement the event system. Each | |
250 * backend need to provides the following events. | |
251 * | |
252 * - keyboard event | |
253 * - timer event | |
254 * - image loader(?) | |
255 * - render manager(?) | |
256 */ | |
257 typedef struct { | |
258 | |
259 void *(*init)(const char *display,int w,int h); | |
260 void (*free)(void *be); | |
261 void (*add_event)(void *be,int type, int fd, mb_eventcb_t f,void *arg); | |
262 void (*remove_event)(void *be,int type, int fd); | |
263 void (*loop)(void *be); | |
264 subject_t *(*kbevents)(void *be); | |
265 redraw_man_t *(*rdman)(void *be); | |
266 mb_tman_t *(*tman)(void *be); | |
267 ob_factory_t *(*factory)(void *be); | |
268 mb_img_ldr_t *(*loader)(void *be); | |
269 } mb_backend_t; | |
270 | |
271 extern mb_backend_t backend; | |
272 | 245 |
273 #endif /* __REDRAW_MAN_H_ */ | 246 #endif /* __REDRAW_MAN_H_ */ |