diff 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
line wrap: on
line diff
--- a/src/X_supp.h	Sun Sep 14 23:40:57 2008 +0800
+++ b/src/X_supp.h	Mon Sep 15 20:33:06 2008 +0800
@@ -6,25 +6,28 @@
 #include "mb_timer.h"
 #include "redraw_man.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_MB_runtime X_MB_runtime_t;
-struct _X_MB_runtime {
-    Display *display;
-    Window win;
-    Visual *visual;
-    cairo_surface_t *surface, *backend_surface;
-    cairo_t *cr, *backend_cr;
-    redraw_man_t *rdman;
-    mb_tman_t *tman;
-    int w, h;
-
-    /* States */
-    shape_t *last;
-};
 
 extern void X_MB_handle_connection(X_MB_runtime_t *rt);
-extern int X_MB_init(const char *display_name,
-		     int w, int h, X_MB_runtime_t *xmb_rt);
-extern void X_MB_destroy(X_MB_runtime_t *xmb_rt);
+extern X_MB_runtime_t *X_MB_new(const char *display_name, int w, int h);
+extern void X_MB_free(X_MB_runtime_t *xmb_rt);
 
+extern subject_t *X_MB_kbevents(X_MB_runtime_t *xmb_rt);
+extern redraw_man_t *X_MB_rdman(X_MB_runtime_t *xmb_rt);
+extern mb_tman_t *X_MB_tman(X_MB_runtime_t *xmb_rt);
 
 #endif