comparison src/X_supp.c @ 1003:4b1bef7e5516 refine_backend_if

Change _X_MB_runtime and fix _x_mb_event_loop()
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 22 Nov 2010 00:42:30 +0800
parents aa0583e0a96b
children d6035efd64dc
comparison
equal deleted inserted replaced
1002:aa0583e0a96b 1003:4b1bef7e5516
44 Visual *visual; 44 Visual *visual;
45 mbe_surface_t *surface, *backend_surface; 45 mbe_surface_t *surface, *backend_surface;
46 mbe_pattern_t *surface_ptn; 46 mbe_pattern_t *surface_ptn;
47 mbe_t *cr, *backend_cr; 47 mbe_t *cr, *backend_cr;
48 redraw_man_t *rdman; 48 redraw_man_t *rdman;
49 mb_tman_t *tman;
50 mb_img_ldr_t *img_ldr; 49 mb_img_ldr_t *img_ldr;
51 int w, h; 50 int w, h;
52 51
53 X_kb_info_t kbinfo; 52 X_kb_info_t kbinfo;
54 mb_IO_man_t *io_man; 53 mb_IO_man_t *io_man;
54 mb_timer_man_t *timer_man;
55 55
56 #ifndef ONLY_MOUSE_MOVE_RAW 56 #ifndef ONLY_MOUSE_MOVE_RAW
57 /* States */ 57 /* States */
58 shape_t *last; 58 shape_t *last;
59 #endif 59 #endif
252 * 252 *
253 * The display is managed by specified rdman and tman. rdman draws 253 * The display is managed by specified rdman and tman. rdman draws
254 * on the display, and tman trigger actions according timers. 254 * on the display, and tman trigger actions according timers.
255 */ 255 */
256 static void 256 static void
257 _x_mb_handle_connection(struct _mb_IO_man *io_man) { 257 _x_mb_event_loop(mb_rt_t *rt) {
258 X_MB_runtime_t *rt = (X_MB_runtime_t *) be; 258 struct _X_MB_runtime *xmbrt = (struct _X_MB_runtime *)rt;
259 mb_tman_t *tman = rt->tman; 259 struct _X_supp_IO_man *io_man = (struct _X_supp_IO_man *)xmbrt->io_man;
260 struct _X_supp_timer_man *timer_man =
261 (struct _X_supp_timer_man *)xmbrt->timer_man;
262 mb_tman_t *tman = timer_man->tman;
260 int fd; 263 int fd;
261 mb_timeval_t now, tmo; 264 mb_timeval_t now, tmo;
262 struct timeval tv; 265 struct timeval tv;
263 fd_set rfds, wfds; 266 fd_set rfds, wfds;
264 int nfds = 0; 267 int nfds = 0;
305 } else { 308 } else {
306 for(i = 0; i < io_man->n_monitor; i++) { 309 for(i = 0; i < io_man->n_monitor; i++) {
307 if(io_man->monitors[i].type == MB_IO_R || 310 if(io_man->monitors[i].type == MB_IO_R ||
308 io_man->monitors[i].type == MB_IO_RW) { 311 io_man->monitors[i].type == MB_IO_RW) {
309 if(FD_ISSET(io_man->monitors[i].fd, &rfds)) 312 if(FD_ISSET(io_man->monitors[i].fd, &rfds))
310 ioman->monitors[i].cb(i, io_man->monitors[i].fd, 313 io_man->monitors[i].cb(i, io_man->monitors[i].fd,
311 MB_IO_R, 314 MB_IO_R,
312 rt->monitors[i].data); 315 io_man->monitors[i].data);
313 } 316 }
314 if(io_man->monitors[i].type == MB_IO_W || 317 if(io_man->monitors[i].type == MB_IO_W ||
315 io_man->monitors[i].type == MB_IO_RW) { 318 io_man->monitors[i].type == MB_IO_RW) {
316 if(FD_ISSET(io_man->monitors[i].fd, &wfds)) 319 if(FD_ISSET(io_man->monitors[i].fd, &wfds))
317 io_man->monitors[i].cb(i, io_man->monitors[i].fd, 320 io_man->monitors[i].cb(i, io_man->monitors[i].fd,