changeset 1112:1993e5ae60aa

Rename X_kb_event_t to mb_kb_event_t
author Thinker K.F. Li <thinker@codemud.net>
date Wed, 08 Dec 2010 19:17:03 +0800
parents fa5f71d4aa04
children 572277fcec0d
files examples/tank/tank_main.c include/mb_X_supp.h include/mb_ani_menu.h include/mb_observer.h nodejs/observer.cc src/X_supp.c src/mbaf/animated_menu.c
diffstat 7 files changed, 20 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- 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;
 
--- 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 <X11/Xlib.h>
-#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;
--- 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.
--- 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,
--- 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<Object> 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;
--- 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 <sys/ipc.h>
 #include <sys/shm.h>
 #include <X11/extensions/XShm.h>
-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);
--- 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;
     }