summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2010-07-23 12:32:45 -0400
committerKristian Høgsberg <krh@bitplanet.net>2010-07-23 12:32:45 -0400
commit6fa3e0c937885e0302e8d7258cc94371203a906c (patch)
treecbe460ce49da1401b42f195dbd795ef7296f5f05
parent0e3496a1551d3b0947f8fd20cd78275ab81278ed (diff)
downloadxscope-6fa3e0c937885e0302e8d7258cc94371203a906c.tar.gz
Add basic support for GLX extension
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
-rw-r--r--Makefile.am2
-rw-r--r--decode_glx.c239
-rw-r--r--extensions.c3
-rw-r--r--extensions.h1
-rw-r--r--glxscope.h74
-rw-r--r--print_glx.c636
-rw-r--r--x11.h5
7 files changed, 959 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index a9426c7..076399d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -33,6 +33,7 @@ xscope_SOURCES = \
common.c \
decode11.c \
decode_bigreq.c \
+ decode_glx.c \
decode_lbx.c \
decode_randr.c \
decode_render.c \
@@ -47,6 +48,7 @@ xscope_SOURCES = \
nas.h \
print11.c \
print_bigreq.c \
+ print_glx.c \
print_lbx.c \
print_randr.c \
print_render.c \
diff --git a/decode_glx.c b/decode_glx.c
new file mode 100644
index 0000000..2ddf1af
--- /dev/null
+++ b/decode_glx.c
@@ -0,0 +1,239 @@
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ * Kristian Høgsberg <krh@bitplanet.net>
+ *
+ */
+
+
+#include <stdio.h>
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#define _GLX_SERVER_
+#include "scope.h"
+#include "x11.h"
+#include "glxscope.h"
+#include "extensions.h"
+
+static unsigned char GLXRequest, GLXError, GLXEvent;
+#define GLXNError 13
+
+
+static void
+glx_decode_req (
+ FD fd,
+ const unsigned char *buf)
+{
+ short Major = IByte (&buf[0]);
+ short Minor = IByte (&buf[1]);
+
+ switch (Minor) {
+ case 1: GLXRender (fd, buf); break;
+ case 2: GLXRenderLarge (fd, buf); break;
+ case 3: GLXCreateContext (fd, buf); break;
+ case 4: GLXDestroyContext (fd, buf); break;
+ case 5: GLXMakeCurrent (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
+ case 6: GLXIsDirect (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
+ case 7: GLXQueryVersion (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
+ case 8: GLXWaitGL (fd, buf); break;
+ case 9: GLXWaitX (fd, buf); break;
+ case 10: GLXCopyContext (fd, buf); break;
+ case 11: GLXSwapBuffers (fd, buf); break;
+ case 12: GLXUseXFont (fd, buf); break;
+ case 13: GLXCreateGLXPixmap (fd, buf); break;
+ case 14: GLXGetVisualConfigs (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
+ case 15: GLXDestroyGLXPixmap (fd, buf); break;
+ case 16: GLXVendorPrivate (fd, buf); break;
+ case 17: GLXVendorPrivateWithReply (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
+ case 18: GLXQueryExtensionsString (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
+ case 19: GLXQueryServerString (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
+ case 20: GLXClientInfo (fd, buf); break;
+ case 21: GLXGetFBConfigs (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
+ case 22: GLXCreatePixmap (fd, buf); break;
+ case 23: GLXDestroyPixmap (fd, buf); break;
+ case 24: GLXCreateNewContext (fd, buf); break;
+ case 25: GLXQueryContext (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
+ case 26: GLXMakeContextCurrent (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
+ case 27: GLXCreatePbuffer (fd, buf); break;
+ case 28: GLXDestroyPbuffer (fd, buf); break;
+ case 29: GLXGetDrawableAttributes (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
+ case 30: GLXChangeDrawableAttributes (fd, buf); break;
+ case 31: GLXCreateWindow (fd, buf); break;
+ case 32: GLXDestroyWindow (fd, buf); break;
+ default:
+ ExtendedRequest(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ }
+}
+
+static void
+glx_decode_reply (
+ FD fd,
+ const unsigned char *buf,
+ short RequestMinor)
+{
+ switch (RequestMinor) {
+ case 5: GLXMakeCurrentReply (fd, buf); break;
+ case 6: GLXIsDirectReply (fd, buf); break;
+ case 7: GLXQueryVersionReply (fd, buf); break;
+ case 14: GLXGetVisualConfigsReply (fd, buf); break;
+ case 17: GLXVendorPrivateWithReplyReply (fd, buf); break;
+ case 18: GLXQueryExtensionsStringReply (fd, buf); break;
+ case 19: GLXQueryServerStringReply (fd, buf); break;
+ case 21: GLXGetFBConfigsReply (fd, buf); break;
+ case 25: GLXQueryContextReply (fd, buf); break;
+ case 26: GLXMakeContextCurrentReply (fd, buf); break;
+ case 29: GLXGetDrawableAttributesReply (fd, buf); break;
+ default: UnknownReply(buf); break;
+ }
+}
+
+static void
+glx_decode_error (
+ FD fd,
+ const unsigned char *buf)
+{
+ short error = IByte(&buf[1]) - GLXError;
+
+ switch (error) {
+ case 0: GLXBadContextError (fd, buf); break;
+ case 1: GLXBadContextStateError (fd, buf); break;
+ case 2: GLXBadDrawableError (fd, buf); break;
+ case 3: GLXBadPixmapError (fd, buf); break;
+ case 4: GLXBadContextTagError (fd, buf); break;
+ case 5: GLXBadCurrentWindowError (fd, buf); break;
+ case 6: GLXBadRenderRequestError (fd, buf); break;
+ case 7: GLXBadLargeRequestError (fd, buf); break;
+ case 8: GLXUnsupportedPrivateRequestError (fd, buf); break;
+ case 9: GLXBadFBConfigError (fd, buf); break;
+ case 10: GLXBadPbufferError (fd, buf); break;
+ case 11: GLXBadCurrentDrawableError (fd, buf); break;
+ case 12: GLXBadWindowError (fd, buf); break;
+ default:
+ break;
+ }
+}
+
+static void
+glx_decode_event (
+ FD fd,
+ const unsigned char *buf)
+{
+ short event = IByte(&buf[0]) - GLXEvent;
+
+ switch (event) {
+ break;
+ }
+}
+
+void
+InitializeGLX (const unsigned char *buf)
+{
+ TYPE p;
+ int errcode;
+
+ GLXRequest = (unsigned char)(buf[9]);
+ GLXEvent = (unsigned char)(buf[10]);
+ GLXError = (unsigned char)(buf[11]);
+
+ DefineEValue (&TD[REQUEST], (unsigned long) GLXRequest, "GlxRequest");
+ DefineEValue (&TD[REPLY], (unsigned long) GLXRequest, "GlxReply");
+
+ DefineEValue (&TD[EVENT], (unsigned long) GLXEvent, "GlxEvent");
+
+ DefineEValue (&TD[ERROR], (unsigned long) GLXError + 0, "GLXBadContext");
+ DefineEValue (&TD[ERROR], (unsigned long) GLXError + 1, "GLXBadContextState");
+ DefineEValue (&TD[ERROR], (unsigned long) GLXError + 2, "GLXBadDrawable");
+ DefineEValue (&TD[ERROR], (unsigned long) GLXError + 3, "GLXBadPixmap");
+ DefineEValue (&TD[ERROR], (unsigned long) GLXError + 4, "GLXBadContextTag");
+ DefineEValue (&TD[ERROR], (unsigned long) GLXError + 5, "GLXBadCurrentWindow");
+ DefineEValue (&TD[ERROR], (unsigned long) GLXError + 6, "GLXBadRenderRequest");
+ DefineEValue (&TD[ERROR], (unsigned long) GLXError + 7, "GLXBadLargeRequest");
+ DefineEValue (&TD[ERROR], (unsigned long) GLXError + 8, "GLXUnsupportedPrivateRequest");
+ DefineEValue (&TD[ERROR], (unsigned long) GLXError + 9, "GLXBadFBConfig");
+ DefineEValue (&TD[ERROR], (unsigned long) GLXError + 10, "GLXBadPbuffer");
+ DefineEValue (&TD[ERROR], (unsigned long) GLXError + 11, "GLXBadCurrentDrawable");
+ DefineEValue (&TD[ERROR], (unsigned long) GLXError + 12, "GLXBadWindow");
+
+
+ p = DefineType(GLXREQUEST, ENUMERATED, "GLXREQUEST", (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 1L, "GLXRender");
+ DefineEValue(p, 2L, "GLXRenderLarge");
+ DefineEValue(p, 3L, "GLXCreateContext");
+ DefineEValue(p, 4L, "GLXDestroyContext");
+ DefineEValue(p, 5L, "GLXMakeCurrent");
+ DefineEValue(p, 6L, "GLXIsDirect");
+ DefineEValue(p, 7L, "GLXQueryVersion");
+ DefineEValue(p, 8L, "GLXWaitGL");
+ DefineEValue(p, 9L, "GLXWaitX");
+ DefineEValue(p, 10L, "GLXCopyContext");
+ DefineEValue(p, 11L, "GLXSwapBuffers");
+ DefineEValue(p, 12L, "GLXUseXFont");
+ DefineEValue(p, 13L, "GLXCreateGLXPixmap");
+ DefineEValue(p, 14L, "GLXGetVisualConfigs");
+ DefineEValue(p, 15L, "GLXDestroyGLXPixmap");
+ DefineEValue(p, 16L, "GLXVendorPrivate");
+ DefineEValue(p, 17L, "GLXVendorPrivateWithReply");
+ DefineEValue(p, 18L, "GLXQueryExtensionsString");
+ DefineEValue(p, 19L, "GLXQueryServerString");
+ DefineEValue(p, 20L, "GLXClientInfo");
+ DefineEValue(p, 21L, "GLXGetFBConfigs");
+ DefineEValue(p, 22L, "GLXCreatePixmap");
+ DefineEValue(p, 23L, "GLXDestroyPixmap");
+ DefineEValue(p, 24L, "GLXCreateNewContext");
+ DefineEValue(p, 25L, "GLXQueryContext");
+ DefineEValue(p, 26L, "GLXMakeContextCurrent");
+ DefineEValue(p, 27L, "GLXCreatePbuffer");
+ DefineEValue(p, 28L, "GLXDestroyPbuffer");
+ DefineEValue(p, 29L, "GLXGetDrawableAttributes");
+ DefineEValue(p, 30L, "GLXChangeDrawableAttributes");
+ DefineEValue(p, 31L, "GLXCreateWindow");
+ DefineEValue(p, 32L, "GLXDestroyWindow");
+
+ p = DefineType(GLXREPLY, ENUMERATED, "GLXREPLY", (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 17L, "GLXVendorPrivateWithReply");
+ DefineEValue(p, 5L, "GLXMakeCurrentReply");
+ DefineEValue(p, 6L, "GLXIsDirectReply");
+ DefineEValue(p, 7L, "GLXQueryVersionReply");
+ DefineEValue(p, 14L, "GLXGetVisualConfigsReply");
+ DefineEValue(p, 17L, "GLXVendorPrivateWithReplyReply");
+ DefineEValue(p, 18L, "GLXQueryExtensionsStringReply");
+ DefineEValue(p, 19L, "GLXQueryServerStringReply");
+ DefineEValue(p, 21L, "GLXGetFBConfigsReply");
+ DefineEValue(p, 25L, "GLXQueryContextReply");
+ DefineEValue(p, 26L, "GLXMakeContextCurrentReply");
+ DefineEValue(p, 29L, "GLXGetDrawableAttributesReply");
+
+ p = DefineType(GLXEVENT, ENUMERATED, "GLXEVENT", (PrintProcType) PrintENUMERATED);
+ DefineEValue (p, 0L, "PbufferClobberEvent");
+ DefineEValue (p, 1L, "BufferSwapComplete");
+
+ InitializeExtensionDecoder(GLXRequest, glx_decode_req,
+ glx_decode_reply);
+ InitializeExtensionEventDecoder(GLXEvent, glx_decode_event);
+ for (errcode = GLXError; errcode < (GLXError + GLXNError) ;
+ errcode ++) {
+ InitializeExtensionErrorDecoder(errcode, glx_decode_error);
+ }
+}
diff --git a/extensions.c b/extensions.c
index d1007ba..a904db6 100644
--- a/extensions.c
+++ b/extensions.c
@@ -42,7 +42,8 @@ static const struct extension_decoders decodable_extensions[] = {
{ "NCD-WinCenterPro", InitializeWCP },
{ "RANDR", InitializeRANDR },
{ "RENDER", InitializeRENDER },
- { NULL, NULL } /* List terminator - keep last */
+ { "GLX", InitializeGLX },
+ { NULL, NULL } /* List terminator - keep last */
};
/* all extensions we know about */
diff --git a/extensions.h b/extensions.h
index 4c1b072..715d9e3 100644
--- a/extensions.h
+++ b/extensions.h
@@ -48,6 +48,7 @@ extern void ExtensionEvent(FD fd, const unsigned char *buf, short Event);
/* X11 Extension decoders in decode_*.c */
extern void InitializeBIGREQ (const unsigned char *buf);
+extern void InitializeGLX (const unsigned char *buf);
extern void InitializeLBX (const unsigned char *buf);
extern void InitializeMITSHM (const unsigned char *buf);
extern void InitializeRANDR (const unsigned char *buf);
diff --git a/glxscope.h b/glxscope.h
new file mode 100644
index 0000000..89f1227
--- /dev/null
+++ b/glxscope.h
@@ -0,0 +1,74 @@
+#ifndef _GLXSCOPE_H_
+#define _GLXSCOPE_H_
+
+#define GLXREQUESTHEADER "GLXREQUEST"
+#define GLXREPLYHEADER "GLXREPLY"
+
+/*
+ To aid in making the choice between level 1 and level 2, we
+ define the following define, which does not print relatively
+ unimportant fields.
+*/
+
+#define printfield(a,b,c,d,e) if (Verbose > 1) PrintField(a,b,c,d,e)
+
+extern void GLXRender (FD fd, const unsigned char *buf);
+extern void GLXRenderLarge (FD fd, const unsigned char *buf);
+extern void GLXCreateContext (FD fd, const unsigned char *buf);
+extern void GLXDestroyContext (FD fd, const unsigned char *buf);
+extern void GLXMakeCurrent (FD fd, const unsigned char *buf);
+extern void GLXMakeCurrentReply (FD fd, const unsigned char *buf);
+extern void GLXIsDirect (FD fd, const unsigned char *buf);
+extern void GLXIsDirectReply (FD fd, const unsigned char *buf);
+extern void GLXQueryVersion (FD fd, const unsigned char *buf);
+extern void GLXQueryVersionReply (FD fd, const unsigned char *buf);
+extern void GLXWaitGL (FD fd, const unsigned char *buf);
+extern void GLXWaitX (FD fd, const unsigned char *buf);
+extern void GLXCopyContext (FD fd, const unsigned char *buf);
+extern void GLXSwapBuffers (FD fd, const unsigned char *buf);
+extern void GLXUseXFont (FD fd, const unsigned char *buf);
+extern void GLXCreateGLXPixmap (FD fd, const unsigned char *buf);
+extern void GLXGetVisualConfigs (FD fd, const unsigned char *buf);
+extern void GLXGetVisualConfigsReply (FD fd, const unsigned char *buf);
+extern void GLXDestroyGLXPixmap (FD fd, const unsigned char *buf);
+extern void GLXVendorPrivate (FD fd, const unsigned char *buf);
+extern void GLXVendorPrivateWithReply (FD fd, const unsigned char *buf);
+extern void GLXVendorPrivateWithReplyReply(FD fd, const unsigned char *buf);
+extern void GLXQueryExtensionsString (FD fd, const unsigned char *buf);
+extern void GLXQueryExtensionsStringReply(FD fd, const unsigned char *buf);
+extern void GLXQueryServerString (FD fd, const unsigned char *buf);
+extern void GLXQueryServerStringReply (FD fd, const unsigned char *buf);
+extern void GLXClientInfo (FD fd, const unsigned char *buf);
+extern void GLXGetFBConfigs (FD fd, const unsigned char *buf);
+extern void GLXGetFBConfigsReply (FD fd, const unsigned char *buf);
+extern void GLXCreatePixmap (FD fd, const unsigned char *buf);
+extern void GLXDestroyPixmap (FD fd, const unsigned char *buf);
+extern void GLXCreateNewContext (FD fd, const unsigned char *buf);
+extern void GLXQueryContext (FD fd, const unsigned char *buf);
+extern void GLXQueryContextReply (FD fd, const unsigned char *buf);
+extern void GLXMakeContextCurrent (FD fd, const unsigned char *buf);
+extern void GLXMakeContextCurrentReply (FD fd, const unsigned char *buf);
+extern void GLXCreatePbuffer (FD fd, const unsigned char *buf);
+extern void GLXDestroyPbuffer (FD fd, const unsigned char *buf);
+extern void GLXGetDrawableAttributes (FD fd, const unsigned char *buf);
+extern void GLXGetDrawableAttributesReply(FD fd, const unsigned char *buf);
+extern void GLXChangeDrawableAttributes (FD fd, const unsigned char *buf);
+extern void GLXCreateWindow (FD fd, const unsigned char *buf);
+extern void GLXDestroyWindow (FD fd, const unsigned char *buf);
+
+extern void GLXBadContextError (FD fd, const unsigned char *buf);
+extern void GLXBadContextStateError (FD fd, const unsigned char *buf);
+extern void GLXBadDrawableError (FD fd, const unsigned char *buf);
+extern void GLXBadPixmapError (FD fd, const unsigned char *buf);
+extern void GLXBadContextTagError (FD fd, const unsigned char *buf);
+extern void GLXBadCurrentWindowError (FD fd, const unsigned char *buf);
+extern void GLXBadRenderRequestError (FD fd, const unsigned char *buf);
+extern void GLXBadLargeRequestError (FD fd, const unsigned char *buf);
+extern void GLXUnsupportedPrivateRequestError(FD fd, const unsigned char *buf);
+extern void GLXBadFBConfigError (FD fd, const unsigned char *buf);
+extern void GLXBadPbufferError (FD fd, const unsigned char *buf);
+extern void GLXBadCurrentDrawableError (FD fd, const unsigned char *buf);
+extern void GLXBadWindowError (FD fd, const unsigned char *buf);
+
+#endif
+
diff --git a/print_glx.c b/print_glx.c
new file mode 100644
index 0000000..3559df0
--- /dev/null
+++ b/print_glx.c
@@ -0,0 +1,636 @@
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ * Kristian Høgsberg <krh@bitplanet.net>
+ *
+ */
+
+#include "scope.h"
+#include "x11.h"
+#include "glxscope.h"
+
+/* Print the portion of the glx request header common to all requests */
+static inline void
+GlxRequestHeader (FD fd, const unsigned char *buf)
+{
+ PrintField (buf, 0, 1, REQUEST, REQUESTHEADER);
+ PrintField (buf, 1, 1, GLXREQUEST, GLXREQUESTHEADER);
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+}
+
+void
+GLXRender (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXRenderLarge (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXCreateContext (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXDestroyContext (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXMakeCurrent (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void GLXMakeCurrentReply (FD fd, const unsigned char *buf)
+{
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+}
+
+void
+GLXIsDirect (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXIsDirectReply (FD fd, const unsigned char *buf)
+{
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+}
+
+void
+GLXQueryVersion (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXQueryVersionReply (FD fd, const unsigned char *buf)
+{
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+}
+
+void
+GLXWaitGL (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXWaitX (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXCopyContext (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXSwapBuffers (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXUseXFont (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXCreateGLXPixmap (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXGetVisualConfigs (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+ GLXGetVisualConfigsReply (FD fd, const unsigned char *buf)
+{
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+}
+
+void
+GLXDestroyGLXPixmap (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXVendorPrivate (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXVendorPrivateWithReply (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXVendorPrivateWithReplyReply (FD fd, const unsigned char *buf)
+{
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+}
+
+void
+GLXQueryExtensionsString (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+ GLXQueryExtensionsStringReply (FD fd, const unsigned char *buf)
+{
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+}
+
+void
+GLXQueryServerString (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+ GLXQueryServerStringReply (FD fd, const unsigned char *buf)
+{
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+}
+
+void
+GLXClientInfo (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXGetFBConfigs (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+ GLXGetFBConfigsReply (FD fd, const unsigned char *buf)
+{
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+}
+
+void
+GLXCreatePixmap (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXDestroyPixmap (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXCreateNewContext (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXQueryContext (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+ GLXQueryContextReply (FD fd, const unsigned char *buf)
+{
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+}
+
+void
+GLXMakeContextCurrent (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+ GLXMakeContextCurrentReply (FD fd, const unsigned char *buf)
+{
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+}
+
+void
+GLXCreatePbuffer (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXDestroyPbuffer (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXGetDrawableAttributes (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+ GLXGetDrawableAttributesReply (FD fd, const unsigned char *buf)
+{
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+}
+
+void
+GLXChangeDrawableAttributes (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXCreateWindow (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXDestroyWindow (FD fd, const unsigned char *buf)
+{
+ GlxRequestHeader (fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+}
+
+void
+GLXBadContextError (FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
+}
+
+void
+GLXBadContextStateError (FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
+}
+
+void
+GLXBadDrawableError (FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
+}
+
+void
+GLXBadPixmapError (FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
+}
+
+void
+GLXBadContextTagError (FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
+}
+
+void
+GLXBadCurrentWindowError (FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
+}
+
+void
+GLXBadRenderRequestError (FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
+}
+
+void
+GLXBadLargeRequestError (FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
+}
+
+void
+GLXUnsupportedPrivateRequestError (FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
+}
+
+void
+GLXBadFBConfigError (FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
+}
+
+void
+GLXBadPbufferError (FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
+}
+
+void
+GLXBadCurrentDrawableError (FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
+}
+
+void
+GLXBadWindowError (FD fd, const unsigned char *buf)
+{
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
+}
diff --git a/x11.h b/x11.h
index e80182f..26fd871 100644
--- a/x11.h
+++ b/x11.h
@@ -256,6 +256,11 @@
#define EXTENSION 159
+#define GLXREQUEST 160
+#define GLXREPLY 161
+#define GLXEVENT 162
+#define GLXERROR 163
+
#define MaxTypes 256
extern char ScopeEnabled;