comparison src/X_supp.c @ 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 851a062368bd
children 673978a8bc4b
comparison
equal deleted inserted replaced
1111:fa5f71d4aa04 1112:1993e5ae60aa
16 #ifdef XSHM 16 #ifdef XSHM
17 /* \sa http://www.xfree86.org/current/mit-shm.html */ 17 /* \sa http://www.xfree86.org/current/mit-shm.html */
18 #include <sys/ipc.h> 18 #include <sys/ipc.h>
19 #include <sys/shm.h> 19 #include <sys/shm.h>
20 #include <X11/extensions/XShm.h> 20 #include <X11/extensions/XShm.h>
21 static void XSHM_update(X_supp_runtime_t *xmb_rt);
22 #endif 21 #endif
23 22
24 #define ERR -1 23 #define ERR -1
25 #define OK 0 24 #define OK 0
26 25
38 int ksym_per_code; 37 int ksym_per_code;
39 KeySym *syms; 38 KeySym *syms;
40 subject_t *kbevents; 39 subject_t *kbevents;
41 observer_factory_t *observer_factory; 40 observer_factory_t *observer_factory;
42 }; 41 };
42 typedef struct _X_kb_info X_kb_info_t;
43 43
44 /* @} */ 44 /* @} */
45 45
46 struct _X_supp_runtime { 46 struct _X_supp_runtime {
47 Display *display; 47 Display *display;
78 int ex1, ey1, ex2, ey2; /* Aggregate expose events */ 78 int ex1, ey1, ex2, ey2; /* Aggregate expose events */
79 int mflag; 79 int mflag;
80 int mx, my; /* Position of last motion event */ 80 int mx, my; /* Position of last motion event */
81 int mbut_state; /* Button state of last motion event */ 81 int mbut_state; /* Button state of last motion event */
82 }; 82 };
83 typedef struct _X_supp_runtime X_supp_runtime_t;
83 84
84 static void _x_supp_handle_x_event(X_supp_runtime_t *rt); 85 static void _x_supp_handle_x_event(X_supp_runtime_t *rt);
85 86
86 /*! \defgroup x_supp_io IO manager for X. 87 /*! \defgroup x_supp_io IO manager for X.
87 * @{ 88 * @{
157 struct _X_supp_IO_man *xmb_io_man = (struct _X_supp_IO_man *)io_man; 158 struct _X_supp_IO_man *xmb_io_man = (struct _X_supp_IO_man *)io_man;
158 159
159 ASSERT(io_hdl < xmb_io_man->n_monitor); 160 ASSERT(io_hdl < xmb_io_man->n_monitor);
160 xmb_io_man->monitors[io_hdl].type = MB_IO_DUMMY; 161 xmb_io_man->monitors[io_hdl].type = MB_IO_DUMMY;
161 } 162 }
163
164 #ifdef XSHM
165 static void XSHM_update(X_supp_runtime_t *xmb_rt);
166 #endif
162 167
163 /*! \brief Handle connection coming data and timeout of timers. 168 /*! \brief Handle connection coming data and timeout of timers.
164 * 169 *
165 * \param display is a Display returned by XOpenDisplay(). 170 * \param display is a Display returned by XOpenDisplay().
166 * \param rdman is a redraw manager. 171 * \param rdman is a redraw manager.
319 * dispatch it. 324 * dispatch it.
320 */ 325 */
321 static void X_kb_handle_event(X_kb_info_t *kbinfo, XKeyEvent *xkey) { 326 static void X_kb_handle_event(X_kb_info_t *kbinfo, XKeyEvent *xkey) {
322 unsigned int code; 327 unsigned int code;
323 int sym; 328 int sym;
324 X_kb_event_t event; 329 mb_kb_event_t event;
325 330
326 code = xkey->keycode; 331 code = xkey->keycode;
327 sym = keycode2sym(kbinfo, code); 332 sym = keycode2sym(kbinfo, code);
328 if(xkey->type == KeyPress) 333 if(xkey->type == KeyPress)
329 event.event.type = EVT_KB_PRESS; 334 event.event.type = EVT_KB_PRESS;