Mercurial > MadButterfly
comparison include/mb_redraw_man.h @ 984:3fe8054457a8 refine_backend_if
Change interface of mb_backend_t for more concise
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Mon, 22 Nov 2010 00:42:29 +0800 |
parents | 4f8d53be9488 |
children | 2cbe3721dc9a |
comparison
equal
deleted
inserted
replaced
970:a1ebbe11354d | 984:3fe8054457a8 |
---|---|
241 | 241 |
242 typedef void (*mb_eventcb_t )(int fd,void *arg); | 242 typedef void (*mb_eventcb_t )(int fd,void *arg); |
243 #define MONITOR_READ 1 | 243 #define MONITOR_READ 1 |
244 #define MONITOR_WRITE 2 | 244 #define MONITOR_WRITE 2 |
245 | 245 |
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 | 246 |
273 #endif /* __REDRAW_MAN_H_ */ | 247 #endif /* __REDRAW_MAN_H_ */ |