# HG changeset patch # User Thinker K.F. Li # Date 1291807023 -28800 # Node ID 1993e5ae60aadfbf10151ed65bafb2839e24aea2 # Parent fa5f71d4aa0415e70d55b47a368a0e0afee16632 Rename X_kb_event_t to mb_kb_event_t diff -r fa5f71d4aa04 -r 1993e5ae60aa examples/tank/tank_main.c --- a/examples/tank/tank_main.c Wed Dec 08 18:59:44 2010 +0800 +++ b/examples/tank/tank_main.c Wed Dec 08 19:17:03 2010 +0800 @@ -508,7 +508,7 @@ } while(0) static void keyboard_handler(event_t *event, void *arg) { - X_kb_event_t *xkey = (X_kb_event_t *)event; + mb_kb_event_t *xkey = (mb_kb_event_t *)event; tank_rt_t *tank_rt = (tank_rt_t *)arg; int direction; diff -r fa5f71d4aa04 -r 1993e5ae60aa include/mb_X_supp.h --- a/include/mb_X_supp.h Wed Dec 08 18:59:44 2010 +0800 +++ b/include/mb_X_supp.h Wed Dec 08 19:17:03 2010 +0800 @@ -4,26 +4,6 @@ #define __X_SUPP_H_ #include -#include "mb_types.h" -#include "mb_timer.h" -#include "mb_redraw_man.h" -#include "mb_img_ldr.h" - -/*! \ingroup xkb - * @{ - */ -typedef struct _X_kb_info X_kb_info_t; - -struct _X_kb_event { - event_t event; - int keycode; - int sym; -}; -typedef struct _X_kb_event X_kb_event_t; - -/* @} */ - -typedef struct _X_supp_runtime X_supp_runtime_t; typedef Window MB_WINDOW; typedef Display *MB_DISPLAY; diff -r fa5f71d4aa04 -r 1993e5ae60aa include/mb_ani_menu.h --- a/include/mb_ani_menu.h Wed Dec 08 18:59:44 2010 +0800 +++ b/include/mb_ani_menu.h Wed Dec 08 19:17:03 2010 +0800 @@ -18,7 +18,7 @@ void (*callback)(struct _mb_animated_menu *m, int sel); void (*update_callback)(struct _mb_animated_menu *m, int sel); mb_progm_t *progm; - X_kb_event_t pending_keys[16]; + mb_kb_event_t pending_keys[16]; int pending_pos, pending_last; } mb_animated_menu_t; /** \brief Create an instace of animated menu. diff -r fa5f71d4aa04 -r 1993e5ae60aa include/mb_observer.h --- a/include/mb_observer.h Wed Dec 08 18:59:44 2010 +0800 +++ b/include/mb_observer.h Wed Dec 08 19:17:03 2010 +0800 @@ -82,6 +82,13 @@ observer_t *observer; /*!< \brief Observer been added or removed. */ }; +struct _mb_kb_event { + event_t event; + int keycode; + int sym; +}; +typedef struct _mb_kb_event mb_kb_event_t; + /*! \brief Observer factory. * * It provides functions for allocation of subject and observer objects, diff -r fa5f71d4aa04 -r 1993e5ae60aa nodejs/observer.cc --- a/nodejs/observer.cc Wed Dec 08 18:59:44 2010 +0800 +++ b/nodejs/observer.cc Wed Dec 08 19:17:03 2010 +0800 @@ -31,7 +31,7 @@ static void xnjsmb_event_mod(Handle self, event_t *evt) { mouse_event_t *mevt; - X_kb_event_t *xkbevt; + mb_kb_event_t *xkbevt; switch(evt->type) { case EVT_ANY: @@ -49,7 +49,7 @@ case EVT_KB_PRESS: case EVT_KB_RELEASE: - xkbevt = (X_kb_event_t *)evt; + xkbevt = (mb_kb_event_t *)evt; SET(self, "keycode", Integer::New(xkbevt->keycode)); SET(self, "sym", Integer::New(xkbevt->sym)); break; diff -r fa5f71d4aa04 -r 1993e5ae60aa src/X_supp.c --- a/src/X_supp.c Wed Dec 08 18:59:44 2010 +0800 +++ b/src/X_supp.c Wed Dec 08 19:17:03 2010 +0800 @@ -18,7 +18,6 @@ #include #include #include -static void XSHM_update(X_supp_runtime_t *xmb_rt); #endif #define ERR -1 @@ -40,6 +39,7 @@ subject_t *kbevents; observer_factory_t *observer_factory; }; +typedef struct _X_kb_info X_kb_info_t; /* @} */ @@ -80,6 +80,7 @@ int mx, my; /* Position of last motion event */ int mbut_state; /* Button state of last motion event */ }; +typedef struct _X_supp_runtime X_supp_runtime_t; static void _x_supp_handle_x_event(X_supp_runtime_t *rt); @@ -160,6 +161,10 @@ xmb_io_man->monitors[io_hdl].type = MB_IO_DUMMY; } +#ifdef XSHM +static void XSHM_update(X_supp_runtime_t *xmb_rt); +#endif + /*! \brief Handle connection coming data and timeout of timers. * * \param display is a Display returned by XOpenDisplay(). @@ -321,7 +326,7 @@ static void X_kb_handle_event(X_kb_info_t *kbinfo, XKeyEvent *xkey) { unsigned int code; int sym; - X_kb_event_t event; + mb_kb_event_t event; code = xkey->keycode; sym = keycode2sym(kbinfo, code); diff -r fa5f71d4aa04 -r 1993e5ae60aa src/mbaf/animated_menu.c --- a/src/mbaf/animated_menu.c Wed Dec 08 18:59:44 2010 +0800 +++ b/src/mbaf/animated_menu.c Wed Dec 08 19:17:03 2010 +0800 @@ -259,7 +259,7 @@ static void mb_animated_menu_send_pending_key(event_t *ev,void *arg) { mb_animated_menu_t *m = (mb_animated_menu_t *) arg; - X_kb_event_t *xkey; + mb_kb_event_t *xkey; xkey = &m->pending_keys[m->pending_pos]; m->pending_pos = (m->pending_pos + 1) & 0xf; @@ -268,7 +268,7 @@ static void mb_animated_menu_keyHandler(event_t *ev, void *arg) { mb_animated_menu_t *m = (mb_animated_menu_t *) arg; - X_kb_event_t *xkey = (X_kb_event_t *)ev; + mb_kb_event_t *xkey = (mb_kb_event_t *)ev; if(xkey->event.type != EVT_KB_PRESS) { return; }