summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2006-02-19 11:49:15 -0800
committerJamey Sharp <jamey@minilop.net>2006-02-19 11:49:15 -0800
commitc7cda56eebaf6ab11403363be14d4948d7d8be38 (patch)
tree6a304232a2ae0f4f46853445d78c089466c84541 /include
parent881467b3032261791ef5ec61b3879bb68d0a3d8c (diff)
Land XCB support on X.org HEAD.
Diffstat (limited to 'include')
-rw-r--r--include/Makefile.am4
-rw-r--r--include/X11/Xlibint.h9
-rw-r--r--include/X11/xcl.h52
3 files changed, 65 insertions, 0 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index e36df309..97932084 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -14,3 +14,7 @@ x11include_HEADERS=\
EXTRA_DIST=\
X11/XlibConf.h.in
+
+if XCB
+x11include_HEADERS += X11/xcl.h
+endif
diff --git a/include/X11/Xlibint.h b/include/X11/Xlibint.h
index 8517f653..00e6e5d8 100644
--- a/include/X11/Xlibint.h
+++ b/include/X11/Xlibint.h
@@ -184,6 +184,7 @@ struct _XDisplay
int xcmisc_opcode; /* major opcode for XC-MISC */
struct _XkbInfoRec *xkb_info; /* XKB info */
struct _XtransConnInfo *trans_conn; /* transport connection object */
+ struct XCLPrivate *xcl; /* XCB glue private data */
};
#define XAllocIDs(dpy,ids,n) (*(dpy)->idlist_alloc)(dpy,ids,n)
@@ -958,6 +959,9 @@ extern void _XGetAsyncData(
int /* datalen */,
int /* discardtotal */
);
+extern void _XSetSeqSyncFunction(
+ Display* /* dpy */
+);
extern void _XFlush(
Display* /* dpy */
);
@@ -1214,6 +1218,11 @@ extern void _XUnregisterInternalConnection(
int /* fd */
);
+extern void _XProcessInternalConnection(
+ Display* /* dpy */,
+ struct _XConnectionInfo* /* conn_info */
+);
+
/* Display structure has pointers to these */
struct _XConnectionInfo { /* info from _XRegisterInternalConnection */
diff --git a/include/X11/xcl.h b/include/X11/xcl.h
new file mode 100644
index 00000000..8f6d8028
--- /dev/null
+++ b/include/X11/xcl.h
@@ -0,0 +1,52 @@
+/* Copyright (C) 2003 Jamey Sharp.
+ * This file is licensed under the MIT license. See the file COPYING. */
+
+#ifndef XCL_H
+#define XCL_H
+
+#include <X11/XCB/xcb.h>
+#include <X11/Xlib.h>
+
+/* Coercions from Xlib XID types to XCB XID types.
+ * On GCC/x86 with optimizations turned on, these compile to zero
+ * instructions. */
+
+#define XCLCASTDECL(src_t, dst_t, field) \
+ static inline XCB##dst_t XCL##dst_t(src_t src) \
+ { \
+ XCB##dst_t dst; \
+ dst.field = src; \
+ return dst; \
+ }
+#define XCLXIDCASTDECL(src_t, dst_t) XCLCASTDECL(src_t, dst_t, xid)
+#define XCLIDCASTDECL(src_t, dst_t) XCLCASTDECL(src_t, dst_t, id)
+
+XCLXIDCASTDECL(Window, WINDOW)
+XCLXIDCASTDECL(Pixmap, PIXMAP)
+XCLXIDCASTDECL(Cursor, CURSOR)
+XCLXIDCASTDECL(Font, FONT)
+XCLXIDCASTDECL(GContext, GCONTEXT)
+XCLXIDCASTDECL(Colormap, COLORMAP)
+XCLXIDCASTDECL(Atom, ATOM)
+
+/* For the union types, pick an arbitrary field of the union to hold the
+ * Xlib XID. Assumes the bit pattern is the same regardless of the field. */
+XCLCASTDECL(Drawable, DRAWABLE, window.xid)
+XCLCASTDECL(Font, FONTABLE, font.xid)
+
+XCLIDCASTDECL(VisualID, VISUALID)
+XCLIDCASTDECL(Time, TIMESTAMP)
+XCLIDCASTDECL(KeySym, KEYSYM)
+XCLIDCASTDECL(KeyCode, KEYCODE)
+XCLIDCASTDECL(CARD8, BUTTON)
+
+/* xcl/display.c */
+
+XCBConnection *XCBConnectionOfDisplay(Display *dpy);
+
+/* xcl/io.c */
+
+enum XEventQueueOwner { XlibOwnsEventQueue = 0, XCBOwnsEventQueue };
+void XSetEventQueueOwner(Display *dpy, enum XEventQueueOwner owner);
+
+#endif /* XCL_H */