Mercurial > MadButterfly
diff src/X_supp.c @ 83:ea758bb3bbe2
example
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Fri, 22 Aug 2008 00:12:04 +0800 |
parents | 4bb6451ef036 |
children | 42698de1f653 |
line wrap: on
line diff
--- a/src/X_supp.c Thu Aug 21 14:13:50 2008 +0800 +++ b/src/X_supp.c Fri Aug 22 00:12:04 2008 +0800 @@ -70,9 +70,9 @@ /*! \brief Dispatch all X events in the queue. */ -static void handle_x_event(Display *display, - redraw_man_t *rdman, - mb_tman_t *tman) { +static void handle_x_event(X_MB_runtime_t *rt) { + Display *display = rt->display; + redraw_man_t *rdman = rt->rdman; XEvent evt; XMotionEvent *mevt; XButtonEvent *bevt; @@ -164,9 +164,10 @@ * The display is managed by specified rdman and tman. rdman draws * on the display, and tman trigger actions according timers. */ -void X_MB_handle_connection(Display *display, - redraw_man_t *rdman, - mb_tman_t *tman) { +void X_MB_handle_connection(X_MB_runtime_t *rt) { + Display *display = rt->display; + redraw_man_t *rdman = rt->rdman; + mb_tman_t *tman = rt->tman; int fd; mb_timeval_t now, tmo; struct timeval tv; @@ -204,7 +205,7 @@ rdman_redraw_changed(rdman); XFlush(display); } else if(FD_ISSET(fd, &rfds)){ - handle_x_event(display, rdman, tman); + handle_x_event(rt); } } } @@ -291,6 +292,8 @@ xmb_rt->tman = mb_tman_new(); + xmb_rt->last = NULL; + return OK; }