comparison src/X_supp.h @ 122:17e97e92b76e

Encapsulate X_MB_runtime_t and support X keyboard events.
author Thinker K.F. Li <thinker@branda.to>
date Mon, 15 Sep 2008 20:33:06 +0800
parents ea758bb3bbe2
children 6a8588df68af
comparison
equal deleted inserted replaced
121:76ba6fd61c7d 122:17e97e92b76e
4 #include <X11/Xlib.h> 4 #include <X11/Xlib.h>
5 #include "mb_types.h" 5 #include "mb_types.h"
6 #include "mb_timer.h" 6 #include "mb_timer.h"
7 #include "redraw_man.h" 7 #include "redraw_man.h"
8 8
9 /*! \ingroup xkb
10 * @{
11 */
12 typedef struct _X_kb_info X_kb_info_t;
13
14 struct _X_kb_event {
15 event_t event;
16 int keycode;
17 int sym;
18 };
19 typedef struct _X_kb_event X_kb_event_t;
20
21 /* @} */
22
9 typedef struct _X_MB_runtime X_MB_runtime_t; 23 typedef struct _X_MB_runtime X_MB_runtime_t;
10 struct _X_MB_runtime {
11 Display *display;
12 Window win;
13 Visual *visual;
14 cairo_surface_t *surface, *backend_surface;
15 cairo_t *cr, *backend_cr;
16 redraw_man_t *rdman;
17 mb_tman_t *tman;
18 int w, h;
19
20 /* States */
21 shape_t *last;
22 };
23 24
24 extern void X_MB_handle_connection(X_MB_runtime_t *rt); 25 extern void X_MB_handle_connection(X_MB_runtime_t *rt);
25 extern int X_MB_init(const char *display_name, 26 extern X_MB_runtime_t *X_MB_new(const char *display_name, int w, int h);
26 int w, int h, X_MB_runtime_t *xmb_rt); 27 extern void X_MB_free(X_MB_runtime_t *xmb_rt);
27 extern void X_MB_destroy(X_MB_runtime_t *xmb_rt);
28 28
29 extern subject_t *X_MB_kbevents(X_MB_runtime_t *xmb_rt);
30 extern redraw_man_t *X_MB_rdman(X_MB_runtime_t *xmb_rt);
31 extern mb_tman_t *X_MB_tman(X_MB_runtime_t *xmb_rt);
29 32
30 #endif 33 #endif