aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gl/configure.ac26
-rw-r--r--gl/glxproto.h5411
-rw-r--r--libX11/src/FSWrap.c2
-rw-r--r--libxcb/xcb-proto/src/glx.xml68
-rw-r--r--mesalib/src/mesa/main/mtypes.h1
-rw-r--r--mesalib/src/mesa/main/teximage.c7
-rw-r--r--mesalib/src/mesa/main/transformfeedback.c9
-rw-r--r--mesalib/src/mesa/swrast/s_texfilter.c18
-rw-r--r--xkbcomp/compat.c6
-rw-r--r--xorg-server/Xext/saver.c3
-rw-r--r--xorg-server/Xext/xvdisp.c4
-rw-r--r--xorg-server/Xi/extinit.c4
-rw-r--r--xorg-server/config/hal.c1
-rw-r--r--xorg-server/configure.ac47
-rw-r--r--xorg-server/hw/dmx/config/Makefile.am3
-rw-r--r--xorg-server/hw/kdrive/ephyr/hostx.c5
-rw-r--r--xorg-server/hw/kdrive/src/kinput.c6
-rw-r--r--xorg-server/hw/vfb/InitOutput.c30
-rw-r--r--xorg-server/hw/xfree86/fbdevhw/fbdevhw.c18
-rw-r--r--xorg-server/hw/xfree86/loader/loadmod.c2
-rw-r--r--xorg-server/hw/xfree86/parser/scan.c4
-rw-r--r--xorg-server/hw/xfree86/xaa/xaaGC.c1299
-rw-r--r--xorg-server/hw/xfree86/xaa/xaaTables.c3
-rw-r--r--xorg-server/hw/xnest/Display.c5
-rw-r--r--xorg-server/hw/xwin/win.h4
-rw-r--r--xorg-server/include/dix-config.h.in85
-rw-r--r--xorg-server/include/dix.h2
-rw-r--r--xorg-server/include/os.h8
-rw-r--r--xorg-server/include/xkb-config.h.in3
-rw-r--r--xorg-server/include/xorg-server.h.in21
-rw-r--r--xorg-server/include/xwin-config.h.in3
-rw-r--r--xorg-server/mi/mibitblt.c1650
-rw-r--r--xorg-server/os/Makefile.am16
-rw-r--r--xorg-server/os/access.c28
-rw-r--r--xorg-server/os/connection.c6
-rw-r--r--xorg-server/os/osdep.h570
-rw-r--r--xorg-server/os/strcasecmp.c140
-rw-r--r--xorg-server/os/strcasestr.c128
-rw-r--r--xorg-server/os/strlcpy.c110
-rw-r--r--xorg-server/test/Makefile.am28
40 files changed, 4936 insertions, 4848 deletions
diff --git a/gl/configure.ac b/gl/configure.ac
index e8117bc56..9907db05c 100644
--- a/gl/configure.ac
+++ b/gl/configure.ac
@@ -1,13 +1,13 @@
-AC_PREREQ([2.60])
-AC_INIT([GLProto], [1.4.14], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
-AM_INIT_AUTOMAKE([foreign dist-bzip2])
-AM_MAINTAINER_MODE
-
-# Require xorg-macros: XORG_DEFAULT_OPTIONS
-m4_ifndef([XORG_MACROS_VERSION],
- [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
-XORG_MACROS_VERSION(1.3)
-XORG_DEFAULT_OPTIONS
-
-AC_OUTPUT([Makefile
- glproto.pc])
+AC_PREREQ([2.60])
+AC_INIT([GLProto], [1.4.15], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+ [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+XORG_DEFAULT_OPTIONS
+
+AC_OUTPUT([Makefile
+ glproto.pc])
diff --git a/gl/glxproto.h b/gl/glxproto.h
index 89fb6d982..b50adc2c8 100644
--- a/gl/glxproto.h
+++ b/gl/glxproto.h
@@ -1,2689 +1,2722 @@
-#ifndef _GLX_glxproto_h_
-#define _GLX_glxproto_h_
-
-/*
- * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
- * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
- *
- * 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 including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * 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
- * SILICON GRAPHICS, INC. 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.
- *
- * Except as contained in this notice, the name of Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
- */
-
-#include <GL/glxmd.h>
-
-/*****************************************************************************/
-
-/*
-** Errrors.
-*/
-#define GLXBadContext 0
-#define GLXBadContextState 1
-#define GLXBadDrawable 2
-#define GLXBadPixmap 3
-#define GLXBadContextTag 4
-#define GLXBadCurrentWindow 5
-#define GLXBadRenderRequest 6
-#define GLXBadLargeRequest 7
-#define GLXUnsupportedPrivateRequest 8
-#define GLXBadFBConfig 9
-#define GLXBadPbuffer 10
-#define GLXBadCurrentDrawable 11
-#define GLXBadWindow 12
-#define GLXBadProfileARB 13
-
-#define __GLX_NUMBER_ERRORS 14
-
-/*
-** Events.
-** __GLX_NUMBER_EVENTS is set to 17 to account for the BufferClobberSGIX
-** event - this helps initialization if the server supports the pbuffer
-** extension and the client doesn't.
-*/
-#define GLX_PbufferClobber 0
-#define GLX_BufferSwapComplete 1
-
-#define __GLX_NUMBER_EVENTS 17
-
-#define GLX_EXTENSION_NAME "GLX"
-#define GLX_EXTENSION_ALIAS "SGI-GLX"
-
-#define __GLX_MAX_CONTEXT_PROPS 3
-
-#ifndef GLX_VENDOR
-#define GLX_VENDOR 0x1
-#endif
-#ifndef GLX_VERSION
-#define GLX_VERSION 0x2
-#endif
-#ifndef GLX_EXTENSIONS
-#define GLX_EXTENSIONS 0x3
-#endif
-
-/*****************************************************************************/
-
-/*
-** For the structure definitions in this file, we must redefine these types in
-** terms of Xmd.h types, which may include bitfields. All of these are
-** undef'ed at the end of this file, restoring the definitions in glx.h.
-*/
-#define GLXContextID CARD32
-#define GLXPixmap CARD32
-#define GLXDrawable CARD32
-#define GLXPbuffer CARD32
-#define GLXWindow CARD32
-#define GLXFBConfigID CARD32
-#define GLXFBConfigIDSGIX CARD32
-#define GLXPbufferSGIX CARD32
-
-/*
-** ContextTag is not exposed to the API.
-*/
-typedef CARD32 GLXContextTag;
-
-/*****************************************************************************/
-
-/*
-** Sizes of basic wire types.
-*/
-#define __GLX_SIZE_INT8 1
-#define __GLX_SIZE_INT16 2
-#define __GLX_SIZE_INT32 4
-#define __GLX_SIZE_CARD8 1
-#define __GLX_SIZE_CARD16 2
-#define __GLX_SIZE_CARD32 4
-#define __GLX_SIZE_FLOAT32 4
-#define __GLX_SIZE_FLOAT64 8
-
-/*****************************************************************************/
-
-/* Requests */
-
-/*
-** Render command request. A bunch of rendering commands are packed into
-** a single X extension request.
-*/
-typedef struct GLXRender {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- GLXContextTag contextTag B32;
-} xGLXRenderReq;
-#define sz_xGLXRenderReq 8
-
-/*
-** The maximum size that a GLXRender command can be. The value must fit
-** in 16 bits and should be a multiple of 4.
-*/
-#define __GLX_MAX_RENDER_CMD_SIZE 64000
-
-/*
-** Large render command request. A single large rendering command
-** is output in multiple X extension requests. The first packet
-** contains an opcode dependent header (see below) that describes
-** the data that follows.
-*/
-typedef struct GLXRenderLarge {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- GLXContextTag contextTag B32;
- CARD16 requestNumber B16;
- CARD16 requestTotal B16;
- CARD32 dataBytes B32;
-} xGLXRenderLargeReq;
-#define sz_xGLXRenderLargeReq 16
-
-/*
-** GLX single request. Commands that go over as single GLX protocol
-** requests use this structure. The glxCode will be one of the X_GLsop
-** opcodes.
-*/
-typedef struct GLXSingle {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- GLXContextTag contextTag B32;
-} xGLXSingleReq;
-#define sz_xGLXSingleReq 8
-
-/*
-** glXQueryVersion request
-*/
-typedef struct GLXQueryVersion {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 majorVersion B32;
- CARD32 minorVersion B32;
-} xGLXQueryVersionReq;
-#define sz_xGLXQueryVersionReq 12
-
-/*
-** glXIsDirect request
-*/
-typedef struct GLXIsDirect {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- GLXContextID context B32;
-} xGLXIsDirectReq;
-#define sz_xGLXIsDirectReq 8
-
-/*
-** glXCreateContext request
-*/
-typedef struct GLXCreateContext {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- GLXContextID context B32;
- CARD32 visual B32;
- CARD32 screen B32;
- GLXContextID shareList B32;
- BOOL isDirect;
- CARD8 reserved1;
- CARD16 reserved2 B16;
-} xGLXCreateContextReq;
-#define sz_xGLXCreateContextReq 24
-
-/*
-** glXDestroyContext request
-*/
-typedef struct GLXDestroyContext {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- GLXContextID context B32;
-} xGLXDestroyContextReq;
-#define sz_xGLXDestroyContextReq 8
-
-/*
-** glXMakeCurrent request
-*/
-typedef struct GLXMakeCurrent {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- GLXDrawable drawable B32;
- GLXContextID context B32;
- GLXContextTag oldContextTag B32;
-} xGLXMakeCurrentReq;
-#define sz_xGLXMakeCurrentReq 16
-
-/*
-** glXWaitGL request
-*/
-typedef struct GLXWaitGL {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- GLXContextTag contextTag B32;
-} xGLXWaitGLReq;
-#define sz_xGLXWaitGLReq 8
-
-/*
-** glXWaitX request
-*/
-typedef struct GLXWaitX {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- GLXContextTag contextTag B32;
-} xGLXWaitXReq;
-#define sz_xGLXWaitXReq 8
-
-/*
-** glXCopyContext request
-*/
-typedef struct GLXCopyContext {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- GLXContextID source B32;
- GLXContextID dest B32;
- CARD32 mask B32;
- GLXContextTag contextTag B32;
-} xGLXCopyContextReq;
-#define sz_xGLXCopyContextReq 20
-
-/*
-** glXSwapBuffers request
-*/
-typedef struct GLXSwapBuffers {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- GLXContextTag contextTag B32;
- GLXDrawable drawable B32;
-} xGLXSwapBuffersReq;
-#define sz_xGLXSwapBuffersReq 12
-
-/*
-** glXUseXFont request
-*/
-typedef struct GLXUseXFont {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- GLXContextTag contextTag B32;
- CARD32 font B32;
- CARD32 first B32;
- CARD32 count B32;
- CARD32 listBase B32;
-} xGLXUseXFontReq;
-#define sz_xGLXUseXFontReq 24
-
-/*
-** glXCreateGLXPixmap request
-*/
-typedef struct GLXCreateGLXPixmap {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 screen B32;
- CARD32 visual B32;
- CARD32 pixmap B32;
- GLXPixmap glxpixmap B32;
-} xGLXCreateGLXPixmapReq;
-#define sz_xGLXCreateGLXPixmapReq 20
-
-/*
-** glXDestroyGLXPixmap request
-*/
-typedef struct GLXDestroyGLXPixmap {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- GLXPixmap glxpixmap B32;
-} xGLXDestroyGLXPixmapReq;
-#define sz_xGLXDestroyGLXPixmapReq 8
-
-/*
-** glXGetVisualConfigs request
-*/
-typedef struct GLXGetVisualConfigs {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 screen B32;
-} xGLXGetVisualConfigsReq;
-#define sz_xGLXGetVisualConfigsReq 8
-
-/*
-** glXVendorPrivate request.
-*/
-typedef struct GLXVendorPrivate {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 vendorCode B32; /* vendor-specific opcode */
- GLXContextTag contextTag B32;
- /*
- ** More data may follow; this is just the header.
- */
-} xGLXVendorPrivateReq;
-#define sz_xGLXVendorPrivateReq 12
-
-/*
-** glXVendorPrivateWithReply request
-*/
-typedef struct GLXVendorPrivateWithReply {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 vendorCode B32; /* vendor-specific opcode */
- GLXContextTag contextTag B32;
- /*
- ** More data may follow; this is just the header.
- */
-} xGLXVendorPrivateWithReplyReq;
-#define sz_xGLXVendorPrivateWithReplyReq 12
-
-/*
-** glXQueryExtensionsString request
-*/
-typedef struct GLXQueryExtensionsString {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 screen B32;
-} xGLXQueryExtensionsStringReq;
-#define sz_xGLXQueryExtensionsStringReq 8
-
-/*
-** glXQueryServerString request
-*/
-typedef struct GLXQueryServerString {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 screen B32;
- CARD32 name B32;
-} xGLXQueryServerStringReq;
-#define sz_xGLXQueryServerStringReq 12
-
-/*
-** glXClientInfo request
-*/
-typedef struct GLXClientInfo {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 major B32;
- CARD32 minor B32;
- CARD32 numbytes B32;
-} xGLXClientInfoReq;
-#define sz_xGLXClientInfoReq 16
-
-/*** Start of GLX 1.3 requests */
-
-/*
-** glXGetFBConfigs request
-*/
-typedef struct GLXGetFBConfigs {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 screen B32;
-} xGLXGetFBConfigsReq;
-#define sz_xGLXGetFBConfigsReq 8
-
-/*
-** glXCreatePixmap request
-*/
-typedef struct GLXCreatePixmap {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 screen B32;
- GLXFBConfigID fbconfig B32;
- CARD32 pixmap B32;
- GLXPixmap glxpixmap B32;
- CARD32 numAttribs B32;
- /* followed by attribute list */
-} xGLXCreatePixmapReq;
-#define sz_xGLXCreatePixmapReq 24
-
-/*
-** glXDestroyPixmap request
-*/
-typedef struct GLXDestroyPixmap {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- GLXPixmap glxpixmap B32;
-} xGLXDestroyPixmapReq;
-#define sz_xGLXDestroyPixmapReq 8
-
-/*
-** glXCreateNewContext request
-*/
-typedef struct GLXCreateNewContext {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- GLXContextID context B32;
- GLXFBConfigID fbconfig B32;
- CARD32 screen B32;
- CARD32 renderType;
- GLXContextID shareList B32;
- BOOL isDirect;
- CARD8 reserved1;
- CARD16 reserved2 B16;
-} xGLXCreateNewContextReq;
-#define sz_xGLXCreateNewContextReq 28
-
-/*
-** glXQueryContext request
-*/
-typedef struct GLXQueryContext {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- GLXContextID context B32;
-} xGLXQueryContextReq;
-#define sz_xGLXQueryContextReq 8
-
-/*
-** glXMakeContextCurrent request
-*/
-typedef struct GLXMakeContextCurrent {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- GLXContextTag oldContextTag B32;
- GLXDrawable drawable B32;
- GLXDrawable readdrawable B32;
- GLXContextID context B32;
-} xGLXMakeContextCurrentReq;
-#define sz_xGLXMakeContextCurrentReq 20
-
-/*
-** glXCreatePbuffer request
-*/
-typedef struct GLXCreatePbuffer {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 screen B32;
- GLXFBConfigID fbconfig B32;
- GLXPbuffer pbuffer B32;
- CARD32 numAttribs B32;
- /* followed by attribute list */
-} xGLXCreatePbufferReq;
-#define sz_xGLXCreatePbufferReq 20
-
-/*
-** glXDestroyPbuffer request
-*/
-typedef struct GLXDestroyPbuffer {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- GLXPbuffer pbuffer B32;
-} xGLXDestroyPbufferReq;
-#define sz_xGLXDestroyPbufferReq 8
-
-/*
-** glXGetDrawableAttributes request
-*/
-typedef struct GLXGetDrawableAttributes {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- GLXDrawable drawable B32;
-} xGLXGetDrawableAttributesReq;
-#define sz_xGLXGetDrawableAttributesReq 8
-
-/*
-** glXChangeDrawableAttributes request
-*/
-typedef struct GLXChangeDrawableAttributes {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- GLXDrawable drawable B32;
- CARD32 numAttribs B32;
- /* followed by attribute list */
-} xGLXChangeDrawableAttributesReq;
-#define sz_xGLXChangeDrawableAttributesReq 12
-
-/*
-** glXCreateWindow request
-*/
-typedef struct GLXCreateWindow {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 screen B32;
- GLXFBConfigID fbconfig B32;
- CARD32 window B32;
- GLXWindow glxwindow B32;
- CARD32 numAttribs B32;
- /* followed by attribute list */
-} xGLXCreateWindowReq;
-#define sz_xGLXCreateWindowReq 24
-
-/*
-** glXDestroyWindow request
-*/
-typedef struct GLXDestroyWindow {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- GLXWindow glxwindow B32;
-} xGLXDestroyWindowReq;
-#define sz_xGLXDestroyWindowReq 8
-
-/* Replies */
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 error B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXGetErrorReply;
-#define sz_xGLXGetErrorReply 32
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- GLXContextTag contextTag B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXMakeCurrentReply;
-#define sz_xGLXMakeCurrentReply 32
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXReadPixelsReply;
-#define sz_xGLXReadPixelsReply 32
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 width B32;
- CARD32 height B32;
- CARD32 depth B32;
- CARD32 pad6 B32;
-} xGLXGetTexImageReply;
-#define sz_xGLXGetTexImageReply 32
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 width B32;
- CARD32 height B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXGetSeparableFilterReply;
-#define sz_xGLXGetSeparableFilterReply 32
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 width B32;
- CARD32 height B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXGetConvolutionFilterReply;
-#define sz_xGLXGetConvolutionFilterReply 32
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 width B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXGetHistogramReply;
-#define sz_xGLXGetHistogramReply 32
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXGetMinmaxReply;
-#define sz_xGLXGetMinmaxReply 32
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 retval B32;
- CARD32 size B32;
- CARD32 newMode B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXRenderModeReply;
-#define sz_xGLXRenderModeReply 32
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 majorVersion B32;
- CARD32 minorVersion B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXQueryVersionReply;
-#define sz_xGLXQueryVersionReply 32
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 numVisuals B32;
- CARD32 numProps B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXGetVisualConfigsReply;
-#define sz_xGLXGetVisualConfigsReply 32
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- BOOL isDirect;
- CARD8 pad1;
- CARD16 pad2 B16;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- CARD32 pad7 B32;
-} xGLXIsDirectReply;
-#define sz_xGLXIsDirectReply 32
-
-/*
-** This reply structure is used for all single replies. Single replies
-** ship either 1 piece of data or N pieces of data. In these cases
-** size indicates how much data is to be returned.
-*/
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 retval B32;
- CARD32 size B32;
- CARD32 pad3 B32; /* NOTE: may hold a single value */
- CARD32 pad4 B32; /* NOTE: may hold half a double */
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXSingleReply;
-#define sz_xGLXSingleReply 32
-
-/*
-** This reply structure is used for all Vendor Private replies. Vendor
-** Private replies can ship up to 24 bytes within the header or can
-** be variable sized, in which case, the reply length field indicates
-** the number of words of data which follow the header.
-*/
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 retval B32;
- CARD32 size B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXVendorPrivReply;
-#define sz_xGLXVendorPrivReply 32
-
-/*
-** QueryExtensionsStringReply
-** n indicates the number of bytes to be returned.
-*/
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 pad1 B32;
- CARD32 n B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXQueryExtensionsStringReply;
-#define sz_xGLXQueryExtensionsStringReply 32
-
-/*
-** QueryServerString Reply struct
-** n indicates the number of bytes to be returned.
-*/
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 pad1 B32;
- CARD32 n B32;
- CARD32 pad3 B32; /* NOTE: may hold a single value */
- CARD32 pad4 B32; /* NOTE: may hold half a double */
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXQueryServerStringReply;
-#define sz_xGLXQueryServerStringReply 32
-
-/*** Start of GLX 1.3 replies */
-
-/*
-** glXGetFBConfigs reply
-*/
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 numFBConfigs B32;
- CARD32 numAttribs B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXGetFBConfigsReply;
-#define sz_xGLXGetFBConfigsReply 32
-
-/*
-** glXQueryContext reply
-*/
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 n B32; /* number of attribute/value pairs */
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXQueryContextReply;
-#define sz_xGLXQueryContextReply 32
-
-/*
-** glXMakeContextCurrent reply
-*/
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- GLXContextTag contextTag B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXMakeContextCurrentReply;
-#define sz_xGLXMakeContextCurrentReply 32
-
-/*
-** glXCreateGLXPbuffer reply
-** This is used only in the direct rendering case on SGIs - otherwise
-** CreateGLXPbuffer has no reply. It is not part of GLX 1.3.
-*/
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 success;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXCreateGLXPbufferReply;
-#define sz_xGLXCreateGLXPbufferReply 32
-
-/*
-** glXGetDrawableAttributes reply
-*/
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 numAttribs B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXGetDrawableAttributesReply;
-#define sz_xGLXGetDrawableAttributesReply 32
-
-/*
-** glXGetColorTable reply
-*/
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 width B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXGetColorTableReply;
-#define sz_xGLXGetColorTableReply 32
-
-/************************************************************************/
-
-/* GLX extension requests and replies */
-
-/*
-** glXQueryContextInfoEXT request
-*/
-typedef struct GLXQueryContextInfoEXT {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 vendorCode B32; /* vendor-specific opcode */
- CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
- GLXContextID context B32;
-} xGLXQueryContextInfoEXTReq;
-#define sz_xGLXQueryContextInfoEXTReq 16
-
-/*
-** glXQueryContextInfoEXT reply
-*/
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 n B32; /* number of attribute/value pairs */
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXQueryContextInfoEXTReply;
-#define sz_xGLXQueryContextInfoEXTReply 32
-
-/*
-** glXMakeCurrentReadSGI request
-*/
-typedef struct GLXMakeCurrentReadSGI {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 vendorCode B32; /* vendor-specific opcode */
- GLXContextTag oldContextTag B32;
- GLXDrawable drawable B32;
- GLXDrawable readable B32;
- GLXContextID context B32;
-} xGLXMakeCurrentReadSGIReq;
-#define sz_xGLXMakeCurrentReadSGIReq 24
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- GLXContextTag contextTag B32;
- CARD32 writeVid B32;
- CARD32 writeType B32;
- CARD32 readVid B32;
- CARD32 readType B32;
- CARD32 pad6 B32;
-} xGLXMakeCurrentReadSGIReply;
-#define sz_xGLXMakeCurrentReadSGIReply 32
-
-/*
-** glXGetFBConfigsSGIX request
-*/
-typedef struct GLXGetFBConfigsSGIX {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 vendorCode B32; /* vendor-specific opcode */
- CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
- CARD32 screen B32;
-} xGLXGetFBConfigsSGIXReq;
-#define sz_xGLXGetFBConfigsSGIXReq 16
-
-/*
-** glXCreateContextWithConfigSGIX request
-*/
-
-typedef struct GLXCreateContextWithConfigSGIX {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 vendorCode B32; /* vendor-specific opcode */
- CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
- GLXContextID context B32;
- GLXFBConfigID fbconfig B32;
- CARD32 screen B32;
- CARD32 renderType;
- GLXContextID shareList B32;
- BOOL isDirect;
- CARD8 reserved1;
- CARD16 reserved2 B16;
-} xGLXCreateContextWithConfigSGIXReq;
-#define sz_xGLXCreateContextWithConfigSGIXReq 36
-
-/*
-** glXCreatePixmapWithConfigSGIX request
-*/
-
-typedef struct GLXCreateGLXPixmapWithConfigSGIX {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 vendorCode B32; /* vendor-specific opcode */
- CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
- CARD32 screen B32;
- GLXFBConfigID fbconfig B32;
- CARD32 pixmap B32;
- GLXPixmap glxpixmap B32;
-} xGLXCreateGLXPixmapWithConfigSGIXReq;
-#define sz_xGLXCreateGLXPixmapWithConfigSGIXReq 28
-
-/*
-** glXCreateGLXPbufferSGIX request
-*/
-typedef struct GLXCreateGLXPbufferSGIX {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 vendorCode B32; /* vendor-specific opcode */
- CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
- CARD32 screen B32;
- GLXFBConfigID fbconfig B32;
- GLXPbuffer pbuffer B32;
- CARD32 width B32;
- CARD32 height B32;
- /* followed by attribute list */
-} xGLXCreateGLXPbufferSGIXReq;
-#define sz_xGLXCreateGLXPbufferSGIXReq 32
-
-/*
-** glXDestroyGLXPbufferSGIX request
-*/
-typedef struct GLXDestroyGLXPbuffer {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 vendorCode B32; /* vendor-specific opcode */
- CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
- GLXPbuffer pbuffer B32;
-} xGLXDestroyGLXPbufferSGIXReq;
-#define sz_xGLXDestroyGLXPbufferSGIXReq 16
-
-/*
-** glXChangeDrawableAttributesSGIX request
-*/
-typedef struct GLXChangeDrawableAttributesSGIX {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 vendorCode B32; /* vendor-specific opcode */
- CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
- GLXDrawable drawable B32;
- CARD32 numAttribs B32;
- /* followed by attribute list */
-} xGLXChangeDrawableAttributesSGIXReq;
-#define sz_xGLXChangeDrawableAttributesSGIXReq 20
-
-/*
-** glXGetDrawableAttributesSGIX request
-*/
-typedef struct GLXGetDrawableAttributesSGIX {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 vendorCode B32; /* vendor-specific opcode */
- CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
- GLXDrawable drawable B32;
-} xGLXGetDrawableAttributesSGIXReq;
-#define sz_xGLXGetDrawableAttributesSGIXReq 16
-
-/*
-** glXGetDrawableAttributesSGIX reply
-*/
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 numAttribs B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXGetDrawableAttributesSGIXReply;
-#define sz_xGLXGetDrawableAttributesSGIXReply 32
-
-/*
-** glXJoinSwapGroupSGIX request
-*/
-typedef struct GLXJoinSwapGroupSGIX {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 vendorCode B32; /* vendor-specific opcode */
- CARD32 unused B32; /* corresponds to contextTag in hdr */
- GLXDrawable drawable B32;
- GLXDrawable member B32;
-} xGLXJoinSwapGroupSGIXReq;
-#define sz_xGLXJoinSwapGroupSGIXReq 20
-
-/*
-** glXBindSwapBarrierSGIX request
-*/
-typedef struct GLXBindSwapBarrierSGIX {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 vendorCode B32; /* vendor-specific opcode */
- CARD32 unused B32; /* corresponds to contextTag in hdr */
- GLXDrawable drawable B32;
- CARD32 barrier B32;
-} xGLXBindSwapBarrierSGIXReq;
-#define sz_xGLXBindSwapBarrierSGIXReq 20
-
-/*
-** glXQueryMaxSwapBarriersSGIX request
-*/
-typedef struct GLXQueryMaxSwapBarriersSGIX {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 vendorCode B32; /* vendor-specific opcode */
- CARD32 unused B32; /* corresponds to contextTag in hdr */
- CARD32 screen B32;
-} xGLXQueryMaxSwapBarriersSGIXReq;
-#define sz_xGLXQueryMaxSwapBarriersSGIXReq 16
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 max B32;
- CARD32 size B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXQueryMaxSwapBarriersSGIXReply;
-#define sz_xGLXQueryMaxSwapBarriersSGIXReply 32
-
-/*
-** glXQueryHyperpipeNetworkSGIX request
-*/
-typedef struct GLXQueryHyperpipeNetworkSGIX {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 vendorCode B32; /* vendor-specific opcode */
- CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
- CARD32 screen B32;
-} xGLXQueryHyperpipeNetworkSGIXReq;
-#define sz_xGLXQueryHyperpipeNetworkSGIXReq 16
-
-/*
-** glXQueryHyperpipeNetworkSGIX reply
-*/
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 pad1 B32;
- CARD32 n B32;
- CARD32 npipes B32; /* NOTE: may hold a single value */
- CARD32 pad4 B32; /* NOTE: may hold half a double */
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXQueryHyperpipeNetworkSGIXReply;
-#define sz_xGLXQueryHyperpipeNetworkSGIXReply 32
-
-/*
-** glXDestroyHyperpipeConfigSGIX request
-*/
-typedef struct GLXDestroyHyperpipeConfigSGIX {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 vendorCode B32; /* vendor-specific opcode */
- CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
- CARD32 screen B32;
- CARD32 hpId B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
-} xGLXDestroyHyperpipeConfigSGIXReq;
-#define sz_xGLXDestroyHyperpipeConfigSGIXReq 32
-
-/*
-** glXDestroyHyperpipeConfigSGIX reply
-*/
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 pad1 B32;
- CARD32 n B32;
- CARD32 success B32; /* NOTE: may hold a single value */
- CARD32 pad4 B32; /* NOTE: may hold half a double */
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXDestroyHyperpipeConfigSGIXReply;
-#define sz_xGLXDestroyHyperpipeConfigSGIXReply 32
-
-/*
-** glXQueryHyperpipeConfigSGIX request
-*/
-typedef struct GLXQueryHyperpipeConfigSGIX {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 vendorCode B32; /* vendor-specific opcode */
- CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
- CARD32 screen B32;
- CARD32 hpId B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
-} xGLXQueryHyperpipeConfigSGIXReq;
-#define sz_xGLXQueryHyperpipeConfigSGIXReq 32
-
-/*
-** glXQueryHyperpipeConfigSGIX reply
-*/
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 pad1 B32;
- CARD32 n B32;
- CARD32 npipes B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXQueryHyperpipeConfigSGIXReply;
-#define sz_xGLXQueryHyperpipeConfigSGIXReply 32
-
-/*
-** glXHyperpipeConfigSGIX request
-*/
-typedef struct {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 vendorCode B32; /* vendor-specific opcode */
- CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
- CARD32 screen B32;
- CARD32 npipes B32;
- CARD32 networkId B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- /* followed by attribute list */
-} xGLXHyperpipeConfigSGIXReq;
-#define sz_xGLXHyperpipeConfigSGIXReq 32
-
-/*
-** glXHyperpipeConfigSGIX reply
-*/
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 unused; /* not used */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 pad1 B32;
- CARD32 n B32;
- CARD32 npipes B32;
- CARD32 hpId B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
-} xGLXHyperpipeConfigSGIXReply;
-#define sz_xGLXHyperpipeConfigSGIXReply 32
-
-/*
- * GLX_ARB_create_context
- * GLX_ARB_create_context_profile
- */
-
-/*
- * glXSetClientInfoARB
- */
-typedef struct {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 major B32;
- CARD32 minor B32;
- CARD32 n0 B32;
- CARD32 n1 B32;
- CARD32 n2 B32;
- /*
- ** More data may follow; this is just the header.
- */
-} xGLXSetClientInfoARB;
-#define sz_xGLXSetClientInfoARB 24
-
-/*
-** glXCreateContextAttribsARB
-*/
-typedef struct {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- GLXContextID context B32;
- GLXFBConfigID fbconfig B32;
- CARD32 screen;
- GLXContextID shareList B32;
- BOOL isDirect;
- CARD8 reserved1;
- CARD16 reserved2 B16;
- CARD32 numAttribs B32;
- /* followed by attribute list */
-} xGLXCreateContextAttribsARB;
-#define sz_xGLXCreateContextAttribsARB 28
-
-/*
- * glXSetClientInfo2ARB
- */
-typedef struct {
- CARD8 reqType;
- CARD8 glxCode;
- CARD16 length B16;
- CARD32 major B32;
- CARD32 minor B32;
- CARD32 n0 B32;
- CARD32 n1 B32;
- CARD32 n2 B32;
- /*
- ** More data may follow; this is just the header.
- */
-} xGLXSetClientInfo2ARB;
-#define sz_xGLXSetClientInfo2ARB 24
-/************************************************************************/
-
-/*
-** Events
-*/
-
-typedef struct {
- BYTE type;
- BYTE pad;
- CARD16 sequenceNumber B16;
- CARD16 event_type B16; /*** was clobber_class */
- CARD16 draw_type B16;
- CARD32 drawable B32;
- CARD32 buffer_mask B32; /*** was mask */
- CARD16 aux_buffer B16;
- CARD16 x B16;
- CARD16 y B16;
- CARD16 width B16;
- CARD16 height B16;
- CARD16 count B16;
- CARD32 unused2 B32;
-} xGLXPbufferClobberEvent;
-
-typedef struct {
- BYTE type;
- BYTE pad;
- CARD16 sequenceNumber B16;
- CARD16 event_type B16;
- CARD32 drawable;
- CARD32 ust_hi B32;
- CARD32 ust_lo B32;
- CARD32 msc_hi B32;
- CARD32 msc_lo B32;
- CARD32 sbc_hi B32;
- CARD32 sbc_lo B32;
-} xGLXBufferSwapComplete;
-
-typedef struct {
- BYTE type;
- BYTE pad;
- CARD16 sequenceNumber B16;
- CARD16 event_type B16;
- CARD16 pad2;
- CARD32 drawable;
- CARD32 ust_hi B32;
- CARD32 ust_lo B32;
- CARD32 msc_hi B32;
- CARD32 msc_lo B32;
- CARD32 sbc B32;
-} xGLXBufferSwapComplete2;
-
-/************************************************************************/
-
-/*
-** Size of the standard X request header.
-*/
-#define __GLX_SINGLE_HDR_SIZE sz_xGLXSingleReq
-#define __GLX_VENDPRIV_HDR_SIZE sz_xGLXVendorPrivateReq
-
-#define __GLX_RENDER_HDR \
- CARD16 length B16; \
- CARD16 opcode B16
-
-#define __GLX_RENDER_HDR_SIZE 4
-
-typedef struct {
- __GLX_RENDER_HDR;
-} __GLXrenderHeader;
-
-#define __GLX_RENDER_LARGE_HDR \
- CARD32 length B32; \
- CARD32 opcode B32
-
-#define __GLX_RENDER_LARGE_HDR_SIZE 8
-
-typedef struct {
- __GLX_RENDER_LARGE_HDR;
-} __GLXrenderLargeHeader;
-
-/*
-** The glBitmap, glPolygonStipple, glTexImage[12]D, glTexSubImage[12]D
-** and glDrawPixels calls all have a pixel header transmitted after the
-** Render or RenderLarge header and before their own opcode specific
-** headers.
-*/
-#define __GLX_PIXEL_HDR \
- BOOL swapBytes; \
- BOOL lsbFirst; \
- CARD8 reserved0; \
- CARD8 reserved1; \
- CARD32 rowLength B32; \
- CARD32 skipRows B32; \
- CARD32 skipPixels B32; \
- CARD32 alignment B32
-
-#define __GLX_PIXEL_HDR_SIZE 20
-
-typedef struct {
- __GLX_PIXEL_HDR;
-} __GLXpixelHeader;
-
-/*
-** glTexImage[34]D and glTexSubImage[34]D calls
-** all have a pixel header transmitted after the Render or RenderLarge
-** header and before their own opcode specific headers.
-*/
-#define __GLX_PIXEL_3D_HDR \
- BOOL swapBytes; \
- BOOL lsbFirst; \
- CARD8 reserved0; \
- CARD8 reserved1; \
- CARD32 rowLength B32; \
- CARD32 imageHeight B32; \
- CARD32 imageDepth B32; \
- CARD32 skipRows B32; \
- CARD32 skipImages B32; \
- CARD32 skipVolumes B32; \
- CARD32 skipPixels B32; \
- CARD32 alignment B32
-
-#define __GLX_PIXEL_3D_HDR_SIZE 36
-
-/*
-** Data that is specific to a glBitmap call. The data is sent in the
-** following order:
-** Render or RenderLarge header
-** Pixel header
-** Bitmap header
-*/
-#define __GLX_BITMAP_HDR \
- CARD32 width B32; \
- CARD32 height B32; \
- FLOAT32 xorig F32; \
- FLOAT32 yorig F32; \
- FLOAT32 xmove F32; \
- FLOAT32 ymove F32
-
-typedef struct {
- __GLX_RENDER_HDR;
- __GLX_PIXEL_HDR;
- __GLX_BITMAP_HDR;
-} __GLXbitmapHeader;
-
-typedef struct {
- __GLX_RENDER_LARGE_HDR;
- __GLX_PIXEL_HDR;
- __GLX_BITMAP_HDR;
-} __GLXbitmapLargeHeader;
-
-typedef struct {
- __GLX_PIXEL_HDR;
- __GLX_BITMAP_HDR;
-} __GLXdispatchBitmapHeader;
-
-#define __GLX_BITMAP_HDR_SIZE 24
-
-#define __GLX_BITMAP_CMD_HDR_SIZE \
- (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_BITMAP_HDR_SIZE)
-
-#define __GLX_BITMAP_CMD_DISPATCH_HDR_SIZE \
- (__GLX_PIXEL_HDR_SIZE + __GLX_BITMAP_HDR_SIZE)
-
-typedef struct {
- __GLX_RENDER_HDR;
- __GLX_PIXEL_HDR;
-} __GLXpolygonStippleHeader;
-
-#define __GLX_POLYGONSTIPPLE_CMD_HDR_SIZE \
- (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE)
-
-/*
-** Data that is specific to a glTexImage1D or glTexImage2D call. The
-** data is sent in the following order:
-** Render or RenderLarge header
-** Pixel header
-** TexImage header
-** When a glTexImage1D call the height field is unexamined by the server.
-*/
-#define __GLX_TEXIMAGE_HDR \
- CARD32 target B32; \
- CARD32 level B32; \
- CARD32 components B32; \
- CARD32 width B32; \
- CARD32 height B32; \
- CARD32 border B32; \
- CARD32 format B32; \
- CARD32 type B32
-
-#define __GLX_TEXIMAGE_HDR_SIZE 32
-
-#define __GLX_TEXIMAGE_CMD_HDR_SIZE \
- (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_TEXIMAGE_HDR_SIZE)
-
-#define __GLX_TEXIMAGE_CMD_DISPATCH_HDR_SIZE \
- (__GLX_PIXEL_HDR_SIZE + __GLX_TEXIMAGE_HDR_SIZE)
-
-typedef struct {
- __GLX_RENDER_HDR;
- __GLX_PIXEL_HDR;
- __GLX_TEXIMAGE_HDR;
-} __GLXtexImageHeader;
-
-typedef struct {
- __GLX_RENDER_LARGE_HDR;
- __GLX_PIXEL_HDR;
- __GLX_TEXIMAGE_HDR;
-} __GLXtexImageLargeHeader;
-
-typedef struct {
- __GLX_PIXEL_HDR;
- __GLX_TEXIMAGE_HDR;
-} __GLXdispatchTexImageHeader;
-
-/*
-** Data that is specific to a glTexImage3D or glTexImage4D call. The
-** data is sent in the following order:
-** Render or RenderLarge header
-** Pixel 3D header
-** TexImage 3D header
-** When a glTexImage3D call the size4d and woffset fields are unexamined
-** by the server.
-** Could be used by all TexImage commands and perhaps should be in the
-** future.
-*/
-#define __GLX_TEXIMAGE_3D_HDR \
- CARD32 target B32; \
- CARD32 level B32; \
- CARD32 internalformat B32; \
- CARD32 width B32; \
- CARD32 height B32; \
- CARD32 depth B32; \
- CARD32 size4d B32; \
- CARD32 border B32; \
- CARD32 format B32; \
- CARD32 type B32; \
- CARD32 nullimage B32
-
-#define __GLX_TEXIMAGE_3D_HDR_SIZE 44
-
-#define __GLX_TEXIMAGE_3D_CMD_HDR_SIZE \
- (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_3D_HDR_SIZE + \
- __GLX_TEXIMAGE_3D_HDR_SIZE)
-
-#define __GLX_TEXIMAGE_3D_CMD_DISPATCH_HDR_SIZE \
- (__GLX_PIXEL_3D_HDR_SIZE + __GLX_TEXIMAGE_3D_HDR_SIZE)
-
-typedef struct {
- __GLX_RENDER_HDR;
- __GLX_PIXEL_3D_HDR;
- __GLX_TEXIMAGE_3D_HDR;
-} __GLXtexImage3DHeader;
-
-typedef struct {
- __GLX_RENDER_LARGE_HDR;
- __GLX_PIXEL_3D_HDR;
- __GLX_TEXIMAGE_3D_HDR;
-} __GLXtexImage3DLargeHeader;
-
-typedef struct {
- __GLX_PIXEL_3D_HDR;
- __GLX_TEXIMAGE_3D_HDR;
-} __GLXdispatchTexImage3DHeader;
-
-/*
-** Data that is specific to a glTexSubImage1D or glTexSubImage2D call. The
-** data is sent in the following order:
-** Render or RenderLarge header
-** Pixel header
-** TexSubImage header
-** When a glTexSubImage1D call is made, the yoffset and height fields
-** are unexamined by the server and are considered to be padding.
-*/
-#define __GLX_TEXSUBIMAGE_HDR \
- CARD32 target B32; \
- CARD32 level B32; \
- CARD32 xoffset B32; \
- CARD32 yoffset B32; \
- CARD32 width B32; \
- CARD32 height B32; \
- CARD32 format B32; \
- CARD32 type B32; \
- CARD32 nullImage \
-
-#define __GLX_TEXSUBIMAGE_HDR_SIZE 36
-
-#define __GLX_TEXSUBIMAGE_CMD_HDR_SIZE \
- (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_TEXSUBIMAGE_HDR_SIZE)
-
-#define __GLX_TEXSUBIMAGE_CMD_DISPATCH_HDR_SIZE \
- (__GLX_PIXEL_HDR_SIZE + __GLX_TEXSUBIMAGE_HDR_SIZE)
-
-typedef struct {
- __GLX_RENDER_HDR;
- __GLX_PIXEL_HDR;
- __GLX_TEXSUBIMAGE_HDR;
-} __GLXtexSubImageHeader;
-
-typedef struct {
- __GLX_RENDER_LARGE_HDR;
- __GLX_PIXEL_HDR;
- __GLX_TEXSUBIMAGE_HDR;
-} __GLXtexSubImageLargeHeader;
-
-typedef struct {
- __GLX_PIXEL_HDR;
- __GLX_TEXSUBIMAGE_HDR;
-} __GLXdispatchTexSubImageHeader;
-
-/*
-** Data that is specific to a glTexSubImage3D and 4D calls. The
-** data is sent in the following order:
-** Render or RenderLarge header
-** Pixel 3D header
-** TexSubImage 3D header
-** When a glTexSubImage3D call is made, the woffset and size4d fields
-** are unexamined by the server and are considered to be padding.
-*/
-#define __GLX_TEXSUBIMAGE_3D_HDR \
- CARD32 target B32; \
- CARD32 level B32; \
- CARD32 xoffset B32; \
- CARD32 yoffset B32; \
- CARD32 zoffset B32; \
- CARD32 woffset B32; \
- CARD32 width B32; \
- CARD32 height B32; \
- CARD32 depth B32; \
- CARD32 size4d B32; \
- CARD32 format B32; \
- CARD32 type B32; \
- CARD32 nullImage \
-
-#define __GLX_TEXSUBIMAGE_3D_HDR_SIZE 52
-
-#define __GLX_TEXSUBIMAGE_3D_CMD_HDR_SIZE \
- (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_3D_HDR_SIZE + \
- __GLX_TEXSUBIMAGE_3D_HDR_SIZE)
-
-#define __GLX_TEXSUBIMAGE_3D_CMD_DISPATCH_HDR_SIZE \
- (__GLX_PIXEL_3D_HDR_SIZE + __GLX_TEXSUBIMAGE_3D_HDR_SIZE)
-
-typedef struct {
- __GLX_RENDER_HDR;
- __GLX_PIXEL_3D_HDR;
- __GLX_TEXSUBIMAGE_3D_HDR;
-} __GLXtexSubImage3DHeader;
-
-typedef struct {
- __GLX_RENDER_LARGE_HDR;
- __GLX_PIXEL_3D_HDR;
- __GLX_TEXSUBIMAGE_3D_HDR;
-} __GLXtexSubImage3DLargeHeader;
-
-typedef struct {
- __GLX_PIXEL_3D_HDR;
- __GLX_TEXSUBIMAGE_3D_HDR;
-} __GLXdispatchTexSubImage3DHeader;
-
-/**
- * Data that is specific to a \c glCompressedTexImage1D or
- * \c glCompressedTexImage2D call. The data is sent in the following
- * order:
- * - Render or RenderLarge header
- * - CompressedTexImage header
- *
- * When a \c glCompressedTexImage1D call is made, the \c height field is
- * not examined by the server and is considered padding.
- */
-
-#define __GLX_COMPRESSED_TEXIMAGE_HDR \
- CARD32 target B32; \
- CARD32 level B32; \
- CARD32 internalFormat B32; \
- CARD32 width B32; \
- CARD32 height B32; \
- CARD32 border B32; \
- CARD32 imageSize B32
-
-#define __GLX_COMPRESSED_TEXIMAGE_HDR_SIZE 28
-
-#define __GLX_COMPRESSED_TEXIMAGE_CMD_HDR_SIZE \
- (__GLX_RENDER_HDR_SIZE + __GLX_COMPRESSED_TEXIMAGE_HDR_SIZE)
-
-#define __GLX_COMPRESSED_TEXIMAGE_DISPATCH_HDR_SIZE \
- (__GLX_COMPRESSED_TEXIMAGE_HDR_SIZE)
-
-typedef struct {
- __GLX_RENDER_HDR;
- __GLX_COMPRESSED_TEXIMAGE_HDR;
-} __GLXcompressedTexImageHeader;
-
-typedef struct {
- __GLX_RENDER_LARGE_HDR;
- __GLX_COMPRESSED_TEXIMAGE_HDR;
-} __GLXcompressedTexImageLargeHeader;
-
-typedef struct {
- __GLX_COMPRESSED_TEXIMAGE_HDR;
-} __GLXdispatchCompressedTexImageHeader;
-
-/**
- * Data that is specifi to a \c glCompressedTexSubImage1D or
- * \c glCompressedTexSubImage2D call. The data is sent in the following
- * order:
- * - Render or RenderLarge header
- * - CompressedTexSubImage header
- *
- * When a \c glCompressedTexSubImage1D call is made, the \c yoffset and
- * \c height fields are not examined by the server and are considered padding.
- */
-
-#define __GLX_COMPRESSED_TEXSUBIMAGE_HDR \
- CARD32 target B32; \
- CARD32 level B32; \
- CARD32 xoffset B32; \
- CARD32 yoffset B32; \
- CARD32 width B32; \
- CARD32 height B32; \
- CARD32 format B32; \
- CARD32 imageSize B32
-
-#define __GLX_COMPRESSED_TEXSUBIMAGE_HDR_SIZE 32
-
-#define __GLX_COMPRESSED_TEXSUBIMAGE_CMD_HDR_SIZE \
- (__GLX_RENDER_HDR_SIZE + __GLX_COMPRESSED_TEXSUBIMAGE_HDR_SIZE)
-
-#define __GLX_COMPRESSED_TEXSUBIMAGE_DISPATCH_HDR_SIZE \
- (__GLX_COMPRESSED_TEXSUBIMAGE_HDR_SIZE)
-
-typedef struct {
- __GLX_RENDER_HDR;
- __GLX_COMPRESSED_TEXSUBIMAGE_HDR;
-} __GLXcompressedTexSubImageHeader;
-
-typedef struct {
- __GLX_RENDER_LARGE_HDR;
- __GLX_COMPRESSED_TEXSUBIMAGE_HDR;
-} __GLXcompressedTexSubImageLargeHeader;
-
-typedef struct {
- __GLX_COMPRESSED_TEXSUBIMAGE_HDR;
-} __GLXdispatchCompressedTexSubImageHeader;
-
-/**
- * Data that is specific to a \c glCompressedTexImage3D call. The data is
- * sent in the following order:
- * - Render or RenderLarge header
- * - CompressedTexImage3D header
- */
-
-#define __GLX_COMPRESSED_TEXIMAGE_3D_HDR \
- CARD32 target B32; \
- CARD32 level B32; \
- CARD32 internalFormat B32; \
- CARD32 width B32; \
- CARD32 height B32; \
- CARD32 depth B32; \
- CARD32 border B32; \
- CARD32 imageSize B32
-
-#define __GLX_COMPRESSED_TEXIMAGE_3D_HDR_SIZE 32
-
-#define __GLX_COMPRESSED_TEXIMAGE_3D_CMD_HDR_SIZE \
- (__GLX_RENDER_HDR_SIZE + __GLX_COMPRESSED_TEXIMAGE_3D_HDR_SIZE)
-
-#define __GLX_COMPRESSED_TEXIMAGE_3D_DISPATCH_HDR_SIZE \
- (__GLX_COMPRESSED_TEXIMAGE_3D_HDR_SIZE)
-
-typedef struct {
- __GLX_RENDER_HDR;
- __GLX_COMPRESSED_TEXIMAGE_3D_HDR;
-} __GLXcompressedTexImage3DHeader;
-
-typedef struct {
- __GLX_RENDER_LARGE_HDR;
- __GLX_COMPRESSED_TEXIMAGE_3D_HDR;
-} __GLXcompressedTexImage3DLargeHeader;
-
-typedef struct {
- __GLX_COMPRESSED_TEXIMAGE_3D_HDR;
-} __GLXdispatchCompressedTexImage3DHeader;
-
-/**
- * Data that is specifi to a \c glCompressedTexSubImage3D call. The data is
- * sent in the following order:
- * - Render or RenderLarge header
- * - CompressedTexSubImage3D header
- */
-
-#define __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR \
- CARD32 target B32; \
- CARD32 level B32; \
- CARD32 xoffset B32; \
- CARD32 yoffset B32; \
- CARD32 zoffset B32; \
- CARD32 width B32; \
- CARD32 height B32; \
- CARD32 depth B32; \
- CARD32 format B32; \
- CARD32 imageSize B32
-
-#define __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR_SIZE 32
-
-#define __GLX_COMPRESSED_TEXSUBIMAGE_3D_CMD_HDR_SIZE \
- (__GLX_RENDER_HDR_SIZE + __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR_SIZE)
-
-#define __GLX_COMPRESSED_TEXSUBIMAGE_3D_DISPATCH_HDR_SIZE \
- (__GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR_SIZE)
-
-typedef struct {
- __GLX_RENDER_HDR;
- __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR;
-} __GLXcompressedTexSubImage3DHeader;
-
-typedef struct {
- __GLX_RENDER_LARGE_HDR;
- __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR;
-} __GLXcompressedTexSubImage3DLargeHeader;
-
-typedef struct {
- __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR;
-} __GLXdispatchCompressedTexSubImage3DHeader;
-
-/*
-** Data that is specific to a glDrawPixels call. The data is sent in the
-** following order:
-** Render or RenderLarge header
-** Pixel header
-** DrawPixels header
-*/
-#define __GLX_DRAWPIXELS_HDR \
- CARD32 width B32; \
- CARD32 height B32; \
- CARD32 format B32; \
- CARD32 type B32
-
-#define __GLX_DRAWPIXELS_HDR_SIZE 16
-
-#define __GLX_DRAWPIXELS_CMD_HDR_SIZE \
- (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_DRAWPIXELS_HDR_SIZE)
-
-#define __GLX_DRAWPIXELS_CMD_DISPATCH_HDR_SIZE \
- (__GLX_PIXEL_HDR_SIZE + __GLX_DRAWPIXELS_HDR_SIZE)
-
-typedef struct {
- __GLX_RENDER_HDR;
- __GLX_PIXEL_HDR;
- __GLX_DRAWPIXELS_HDR;
-} __GLXdrawPixelsHeader;
-
-typedef struct {
- __GLX_RENDER_LARGE_HDR;
- __GLX_PIXEL_HDR;
- __GLX_DRAWPIXELS_HDR;
-} __GLXdrawPixelsLargeHeader;
-
-typedef struct {
- __GLX_PIXEL_HDR;
- __GLX_DRAWPIXELS_HDR;
-} __GLXdispatchDrawPixelsHeader;
-
-/*
-** Data that is specific to a glConvolutionFilter1D or glConvolutionFilter2D
-** call. The data is sent in the following order:
-** Render or RenderLarge header
-** Pixel header
-** ConvolutionFilter header
-** When a glConvolutionFilter1D call the height field is unexamined by the server.
-*/
-#define __GLX_CONV_FILT_HDR \
- CARD32 target B32; \
- CARD32 internalformat B32; \
- CARD32 width B32; \
- CARD32 height B32; \
- CARD32 format B32; \
- CARD32 type B32
-
-#define __GLX_CONV_FILT_HDR_SIZE 24
-
-#define __GLX_CONV_FILT_CMD_HDR_SIZE \
- (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_CONV_FILT_HDR_SIZE)
-
-#define __GLX_CONV_FILT_CMD_DISPATCH_HDR_SIZE \
- (__GLX_PIXEL_HDR_SIZE + __GLX_CONV_FILT_HDR_SIZE)
-typedef struct {
- __GLX_RENDER_HDR;
- __GLX_PIXEL_HDR;
- __GLX_CONV_FILT_HDR;
-} __GLXConvolutionFilterHeader;
-
-typedef struct {
- __GLX_RENDER_LARGE_HDR;
- __GLX_PIXEL_HDR;
- __GLX_CONV_FILT_HDR;
-} __GLXConvolutionFilterLargeHeader;
-
-typedef struct {
- __GLX_PIXEL_HDR;
- __GLX_CONV_FILT_HDR;
-} __GLXdispatchConvolutionFilterHeader;
-
-/*
-** Data that is specific to a glDrawArraysEXT call. The data is sent in the
-** following order:
-** Render or RenderLarge header
-** Draw Arrays header
-** a variable number of Component headers
-** vertex data for each component type
-*/
-
-#define __GLX_DRAWARRAYS_HDR \
- CARD32 numVertexes B32; \
- CARD32 numComponents B32; \
- CARD32 primType B32
-
-#define __GLX_DRAWARRAYS_HDR_SIZE 12
-
-#define __GLX_DRAWARRAYS_CMD_HDR_SIZE \
- (__GLX_RENDER_HDR_SIZE + __GLX_DRAWARRAYS_HDR_SIZE)
-
-typedef struct {
- __GLX_RENDER_HDR;
- __GLX_DRAWARRAYS_HDR;
-} __GLXdrawArraysHeader;
-
-typedef struct {
- __GLX_RENDER_LARGE_HDR;
- __GLX_DRAWARRAYS_HDR;
-} __GLXdrawArraysLargeHeader;
-
-typedef struct {
- __GLX_DRAWARRAYS_HDR;
-} __GLXdispatchDrawArraysHeader;
-
-#define __GLX_COMPONENT_HDR \
- CARD32 datatype B32; \
- INT32 numVals B32; \
- CARD32 component B32
-
-typedef struct {
- __GLX_COMPONENT_HDR;
-} __GLXdispatchDrawArraysComponentHeader;
-
-#define __GLX_COMPONENT_HDR_SIZE 12
-
-/*
-** Data that is specific to a glColorTable call
-** The data is sent in the following order:
-** Render or RenderLarge header
-** Pixel header
-** ColorTable header
-*/
-
-#define __GLX_COLOR_TABLE_HDR \
- CARD32 target B32; \
- CARD32 internalformat B32; \
- CARD32 width B32; \
- CARD32 format B32; \
- CARD32 type B32
-
-#define __GLX_COLOR_TABLE_HDR_SIZE 20
-
-#define __GLX_COLOR_TABLE_CMD_HDR_SIZE \
- (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_COLOR_TABLE_HDR_SIZE)
-
-typedef struct {
- __GLX_RENDER_HDR;
- __GLX_PIXEL_HDR;
- __GLX_COLOR_TABLE_HDR;
-} __GLXColorTableHeader;
-
-typedef struct {
- __GLX_RENDER_LARGE_HDR;
- __GLX_PIXEL_HDR;
- __GLX_COLOR_TABLE_HDR;
-} __GLXColorTableLargeHeader;
-
-typedef struct {
- __GLX_PIXEL_HDR;
- __GLX_COLOR_TABLE_HDR;
-} __GLXdispatchColorTableHeader;
-
-/*
-** Data that is specific to a glColorSubTable call
-** The data is sent in the following order:
-** Render or RenderLarge header
-** Pixel header
-** ColorTable header
-*/
-
-#define __GLX_COLOR_SUBTABLE_HDR \
- CARD32 target B32; \
- CARD32 start B32; \
- CARD32 count B32; \
- CARD32 format B32; \
- CARD32 type B32
-
-#define __GLX_COLOR_SUBTABLE_HDR_SIZE 20
-
-#define __GLX_COLOR_SUBTABLE_CMD_HDR_SIZE \
- (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + \
- __GLX_COLOR_SUBTABLE_HDR_SIZE)
-
-typedef struct {
- __GLX_RENDER_HDR;
- __GLX_PIXEL_HDR;
- __GLX_COLOR_SUBTABLE_HDR;
-} __GLXColorSubTableHeader;
-
-typedef struct {
- __GLX_RENDER_LARGE_HDR;
- __GLX_PIXEL_HDR;
- __GLX_COLOR_SUBTABLE_HDR;
-} __GLXColorSubTableLargeHeader;
-
-typedef struct {
- __GLX_PIXEL_HDR;
- __GLX_COLOR_SUBTABLE_HDR;
-} __GLXdispatchColorSubTableHeader;
-
-#define GLX_WINDOW_TYPE 1
-#define GLX_PIXMAP_TYPE 2
-#define GLX_VIDEO_SOURCE_TYPE 3
-#define GLX_PBUFFER_TYPE 4
-/* 5 is for DM_PBUFFER */
-#define GLX_GLXWINDOW_TYPE 6
-
-/*****************************************************************************/
-
-/*
-** Restore these definitions back to the typedefs in glx.h
-*/
-#undef GLXContextID
-#undef GLXPixmap
-#undef GLXDrawable
-#undef GLXPbuffer
-#undef GLXWindow
-#undef GLXFBConfigID
-#undef GLXFBConfigIDSGIX
-#undef GLXPbufferSGIX
-
-
-/* Opcodes for GLX commands */
-
-#define X_GLXRender 1
-#define X_GLXRenderLarge 2
-#define X_GLXCreateContext 3
-#define X_GLXDestroyContext 4
-#define X_GLXMakeCurrent 5
-#define X_GLXIsDirect 6
-#define X_GLXQueryVersion 7
-#define X_GLXWaitGL 8
-#define X_GLXWaitX 9
-#define X_GLXCopyContext 10
-#define X_GLXSwapBuffers 11
-#define X_GLXUseXFont 12
-#define X_GLXCreateGLXPixmap 13
-#define X_GLXGetVisualConfigs 14
-#define X_GLXDestroyGLXPixmap 15
-#define X_GLXVendorPrivate 16
-#define X_GLXVendorPrivateWithReply 17
-#define X_GLXQueryExtensionsString 18
-#define X_GLXQueryServerString 19
-#define X_GLXClientInfo 20
-#define X_GLXGetFBConfigs 21
-#define X_GLXCreatePixmap 22
-#define X_GLXDestroyPixmap 23
-#define X_GLXCreateNewContext 24
-#define X_GLXQueryContext 25
-#define X_GLXMakeContextCurrent 26
-#define X_GLXCreatePbuffer 27
-#define X_GLXDestroyPbuffer 28
-#define X_GLXGetDrawableAttributes 29
-#define X_GLXChangeDrawableAttributes 30
-#define X_GLXCreateWindow 31
-#define X_GLXDestroyWindow 32
-#define X_GLXSetClientInfoARB 33
-#define X_GLXCreateContextAtrribsARB 34
-#define X_GLXSetConfigInfo2ARB 35
-
-/* Opcodes for single commands (part of GLX command space) */
-
-#define X_GLsop_NewList 101
-#define X_GLsop_EndList 102
-#define X_GLsop_DeleteLists 103
-#define X_GLsop_GenLists 104
-#define X_GLsop_FeedbackBuffer 105
-#define X_GLsop_SelectBuffer 106
-#define X_GLsop_RenderMode 107
-#define X_GLsop_Finish 108
-#define X_GLsop_Flush 142
-#define X_GLsop_PixelStoref 109
-#define X_GLsop_PixelStorei 110
-#define X_GLsop_ReadPixels 111
-#define X_GLsop_GetBooleanv 112
-#define X_GLsop_GetClipPlane 113
-#define X_GLsop_GetDoublev 114
-#define X_GLsop_GetError 115
-#define X_GLsop_GetFloatv 116
-#define X_GLsop_GetIntegerv 117
-#define X_GLsop_GetLightfv 118
-#define X_GLsop_GetLightiv 119
-#define X_GLsop_GetMapdv 120
-#define X_GLsop_GetMapfv 121
-#define X_GLsop_GetMapiv 122
-#define X_GLsop_GetMaterialfv 123
-#define X_GLsop_GetMaterialiv 124
-#define X_GLsop_GetPixelMapfv 125
-#define X_GLsop_GetPixelMapuiv 126
-#define X_GLsop_GetPixelMapusv 127
-#define X_GLsop_GetPolygonStipple 128
-#define X_GLsop_GetString 129
-#define X_GLsop_GetTexEnvfv 130
-#define X_GLsop_GetTexEnviv 131
-#define X_GLsop_GetTexGendv 132
-#define X_GLsop_GetTexGenfv 133
-#define X_GLsop_GetTexGeniv 134
-#define X_GLsop_GetTexImage 135
-#define X_GLsop_GetTexParameterfv 136
-#define X_GLsop_GetTexParameteriv 137
-#define X_GLsop_GetTexLevelParameterfv 138
-#define X_GLsop_GetTexLevelParameteriv 139
-#define X_GLsop_IsEnabled 140
-#define X_GLsop_IsList 141
-#define X_GLsop_AreTexturesResident 143
-#define X_GLsop_DeleteTextures 144
-#define X_GLsop_GenTextures 145
-#define X_GLsop_IsTexture 146
-#define X_GLsop_GetColorTable 147
-#define X_GLsop_GetColorTableParameterfv 148
-#define X_GLsop_GetColorTableParameteriv 149
-#define X_GLsop_GetConvolutionFilter 150
-#define X_GLsop_GetConvolutionParameterfv 151
-#define X_GLsop_GetConvolutionParameteriv 152
-#define X_GLsop_GetSeparableFilter 153
-#define X_GLsop_GetHistogram 154
-#define X_GLsop_GetHistogramParameterfv 155
-#define X_GLsop_GetHistogramParameteriv 156
-#define X_GLsop_GetMinmax 157
-#define X_GLsop_GetMinmaxParameterfv 158
-#define X_GLsop_GetMinmaxParameteriv 159
-#define X_GLsop_GetCompressedTexImage 160
-
-
-/* Opcodes for rendering commands */
-
-#define X_GLrop_CallList 1
-#define X_GLrop_CallLists 2
-#define X_GLrop_ListBase 3
-#define X_GLrop_Begin 4
-#define X_GLrop_Bitmap 5
-#define X_GLrop_Color3bv 6
-#define X_GLrop_Color3dv 7
-#define X_GLrop_Color3fv 8
-#define X_GLrop_Color3iv 9
-#define X_GLrop_Color3sv 10
-#define X_GLrop_Color3ubv 11
-#define X_GLrop_Color3uiv 12
-#define X_GLrop_Color3usv 13
-#define X_GLrop_Color4bv 14
-#define X_GLrop_Color4dv 15
-#define X_GLrop_Color4fv 16
-#define X_GLrop_Color4iv 17
-#define X_GLrop_Color4sv 18
-#define X_GLrop_Color4ubv 19
-#define X_GLrop_Color4uiv 20
-#define X_GLrop_Color4usv 21
-#define X_GLrop_EdgeFlagv 22
-#define X_GLrop_End 23
-#define X_GLrop_Indexdv 24
-#define X_GLrop_Indexfv 25
-#define X_GLrop_Indexiv 26
-#define X_GLrop_Indexsv 27
-#define X_GLrop_Normal3bv 28
-#define X_GLrop_Normal3dv 29
-#define X_GLrop_Normal3fv 30
-#define X_GLrop_Normal3iv 31
-#define X_GLrop_Normal3sv 32
-#define X_GLrop_RasterPos2dv 33
-#define X_GLrop_RasterPos2fv 34
-#define X_GLrop_RasterPos2iv 35
-#define X_GLrop_RasterPos2sv 36
-#define X_GLrop_RasterPos3dv 37
-#define X_GLrop_RasterPos3fv 38
-#define X_GLrop_RasterPos3iv 39
-#define X_GLrop_RasterPos3sv 40
-#define X_GLrop_RasterPos4dv 41
-#define X_GLrop_RasterPos4fv 42
-#define X_GLrop_RasterPos4iv 43
-#define X_GLrop_RasterPos4sv 44
-#define X_GLrop_Rectdv 45
-#define X_GLrop_Rectfv 46
-#define X_GLrop_Rectiv 47
-#define X_GLrop_Rectsv 48
-#define X_GLrop_TexCoord1dv 49
-#define X_GLrop_TexCoord1fv 50
-#define X_GLrop_TexCoord1iv 51
-#define X_GLrop_TexCoord1sv 52
-#define X_GLrop_TexCoord2dv 53
-#define X_GLrop_TexCoord2fv 54
-#define X_GLrop_TexCoord2iv 55
-#define X_GLrop_TexCoord2sv 56
-#define X_GLrop_TexCoord3dv 57
-#define X_GLrop_TexCoord3fv 58
-#define X_GLrop_TexCoord3iv 59
-#define X_GLrop_TexCoord3sv 60
-#define X_GLrop_TexCoord4dv 61
-#define X_GLrop_TexCoord4fv 62
-#define X_GLrop_TexCoord4iv 63
-#define X_GLrop_TexCoord4sv 64
-#define X_GLrop_Vertex2dv 65
-#define X_GLrop_Vertex2fv 66
-#define X_GLrop_Vertex2iv 67
-#define X_GLrop_Vertex2sv 68
-#define X_GLrop_Vertex3dv 69
-#define X_GLrop_Vertex3fv 70
-#define X_GLrop_Vertex3iv 71
-#define X_GLrop_Vertex3sv 72
-#define X_GLrop_Vertex4dv 73
-#define X_GLrop_Vertex4fv 74
-#define X_GLrop_Vertex4iv 75
-#define X_GLrop_Vertex4sv 76
-#define X_GLrop_ClipPlane 77
-#define X_GLrop_ColorMaterial 78
-#define X_GLrop_CullFace 79
-#define X_GLrop_Fogf 80
-#define X_GLrop_Fogfv 81
-#define X_GLrop_Fogi 82
-#define X_GLrop_Fogiv 83
-#define X_GLrop_FrontFace 84
-#define X_GLrop_Hint 85
-#define X_GLrop_Lightf 86
-#define X_GLrop_Lightfv 87
-#define X_GLrop_Lighti 88
-#define X_GLrop_Lightiv 89
-#define X_GLrop_LightModelf 90
-#define X_GLrop_LightModelfv 91
-#define X_GLrop_LightModeli 92
-#define X_GLrop_LightModeliv 93
-#define X_GLrop_LineStipple 94
-#define X_GLrop_LineWidth 95
-#define X_GLrop_Materialf 96
-#define X_GLrop_Materialfv 97
-#define X_GLrop_Materiali 98
-#define X_GLrop_Materialiv 99
-#define X_GLrop_PointSize 100
-#define X_GLrop_PolygonMode 101
-#define X_GLrop_PolygonStipple 102
-#define X_GLrop_Scissor 103
-#define X_GLrop_ShadeModel 104
-#define X_GLrop_TexParameterf 105
-#define X_GLrop_TexParameterfv 106
-#define X_GLrop_TexParameteri 107
-#define X_GLrop_TexParameteriv 108
-#define X_GLrop_TexImage1D 109
-#define X_GLrop_TexImage2D 110
-#define X_GLrop_TexEnvf 111
-#define X_GLrop_TexEnvfv 112
-#define X_GLrop_TexEnvi 113
-#define X_GLrop_TexEnviv 114
-#define X_GLrop_TexGend 115
-#define X_GLrop_TexGendv 116
-#define X_GLrop_TexGenf 117
-#define X_GLrop_TexGenfv 118
-#define X_GLrop_TexGeni 119
-#define X_GLrop_TexGeniv 120
-#define X_GLrop_InitNames 121
-#define X_GLrop_LoadName 122
-#define X_GLrop_PassThrough 123
-#define X_GLrop_PopName 124
-#define X_GLrop_PushName 125
-#define X_GLrop_DrawBuffer 126
-#define X_GLrop_Clear 127
-#define X_GLrop_ClearAccum 128
-#define X_GLrop_ClearIndex 129
-#define X_GLrop_ClearColor 130
-#define X_GLrop_ClearStencil 131
-#define X_GLrop_ClearDepth 132
-#define X_GLrop_StencilMask 133
-#define X_GLrop_ColorMask 134
-#define X_GLrop_DepthMask 135
-#define X_GLrop_IndexMask 136
-#define X_GLrop_Accum 137
-#define X_GLrop_Disable 138
-#define X_GLrop_Enable 139
-#define X_GLrop_PopAttrib 141
-#define X_GLrop_PushAttrib 142
-#define X_GLrop_Map1d 143
-#define X_GLrop_Map1f 144
-#define X_GLrop_Map2d 145
-#define X_GLrop_Map2f 146
-#define X_GLrop_MapGrid1d 147
-#define X_GLrop_MapGrid1f 148
-#define X_GLrop_MapGrid2d 149
-#define X_GLrop_MapGrid2f 150
-#define X_GLrop_EvalCoord1dv 151
-#define X_GLrop_EvalCoord1fv 152
-#define X_GLrop_EvalCoord2dv 153
-#define X_GLrop_EvalCoord2fv 154
-#define X_GLrop_EvalMesh1 155
-#define X_GLrop_EvalPoint1 156
-#define X_GLrop_EvalMesh2 157
-#define X_GLrop_EvalPoint2 158
-#define X_GLrop_AlphaFunc 159
-#define X_GLrop_BlendFunc 160
-#define X_GLrop_LogicOp 161
-#define X_GLrop_StencilFunc 162
-#define X_GLrop_StencilOp 163
-#define X_GLrop_DepthFunc 164
-#define X_GLrop_PixelZoom 165
-#define X_GLrop_PixelTransferf 166
-#define X_GLrop_PixelTransferi 167
-#define X_GLrop_PixelMapfv 168
-#define X_GLrop_PixelMapuiv 169
-#define X_GLrop_PixelMapusv 170
-#define X_GLrop_ReadBuffer 171
-#define X_GLrop_CopyPixels 172
-#define X_GLrop_DrawPixels 173
-#define X_GLrop_DepthRange 174
-#define X_GLrop_Frustum 175
-#define X_GLrop_LoadIdentity 176
-#define X_GLrop_LoadMatrixf 177
-#define X_GLrop_LoadMatrixd 178
-#define X_GLrop_MatrixMode 179
-#define X_GLrop_MultMatrixf 180
-#define X_GLrop_MultMatrixd 181
-#define X_GLrop_Ortho 182
-#define X_GLrop_PopMatrix 183
-#define X_GLrop_PushMatrix 184
-#define X_GLrop_Rotated 185
-#define X_GLrop_Rotatef 186
-#define X_GLrop_Scaled 187
-#define X_GLrop_Scalef 188
-#define X_GLrop_Translated 189
-#define X_GLrop_Translatef 190
-#define X_GLrop_Viewport 191
-#define X_GLrop_DrawArrays 193
-#define X_GLrop_PolygonOffset 192
-#define X_GLrop_CopyTexImage1D 4119
-#define X_GLrop_CopyTexImage2D 4120
-#define X_GLrop_CopyTexSubImage1D 4121
-#define X_GLrop_CopyTexSubImage2D 4122
-#define X_GLrop_TexSubImage1D 4099
-#define X_GLrop_TexSubImage2D 4100
-#define X_GLrop_BindTexture 4117
-#define X_GLrop_PrioritizeTextures 4118
-#define X_GLrop_Indexubv 194
-#define X_GLrop_BlendColor 4096
-#define X_GLrop_BlendEquation 4097
-#define X_GLrop_ColorTable 2053
-#define X_GLrop_ColorTableParameterfv 2054
-#define X_GLrop_ColorTableParameteriv 2055
-#define X_GLrop_CopyColorTable 2056
-#define X_GLrop_ColorSubTable 195
-#define X_GLrop_CopyColorSubTable 196
-#define X_GLrop_ConvolutionFilter1D 4101
-#define X_GLrop_ConvolutionFilter2D 4102
-#define X_GLrop_ConvolutionParameterf 4103
-#define X_GLrop_ConvolutionParameterfv 4104
-#define X_GLrop_ConvolutionParameteri 4105
-#define X_GLrop_ConvolutionParameteriv 4106
-#define X_GLrop_CopyConvolutionFilter1D 4107
-#define X_GLrop_CopyConvolutionFilter2D 4108
-#define X_GLrop_SeparableFilter2D 4109
-#define X_GLrop_Histogram 4110
-#define X_GLrop_Minmax 4111
-#define X_GLrop_ResetHistogram 4112
-#define X_GLrop_ResetMinmax 4113
-#define X_GLrop_TexImage3D 4114
-#define X_GLrop_TexSubImage3D 4115
-#define X_GLrop_CopyTexSubImage3D 4123
-#define X_GLrop_DrawArraysEXT 4116
-
-/* Added for core GL version 1.3 */
-
-#define X_GLrop_ActiveTextureARB 197
-#define X_GLrop_MultiTexCoord1dvARB 198
-#define X_GLrop_MultiTexCoord1fvARB 199
-#define X_GLrop_MultiTexCoord1ivARB 200
-#define X_GLrop_MultiTexCoord1svARB 201
-#define X_GLrop_MultiTexCoord2dvARB 202
-#define X_GLrop_MultiTexCoord2fvARB 203
-#define X_GLrop_MultiTexCoord2ivARB 204
-#define X_GLrop_MultiTexCoord2svARB 205
-#define X_GLrop_MultiTexCoord3dvARB 206
-#define X_GLrop_MultiTexCoord3fvARB 207
-#define X_GLrop_MultiTexCoord3ivARB 208
-#define X_GLrop_MultiTexCoord3svARB 209
-#define X_GLrop_MultiTexCoord4dvARB 210
-#define X_GLrop_MultiTexCoord4fvARB 211
-#define X_GLrop_MultiTexCoord4ivARB 212
-#define X_GLrop_MultiTexCoord4svARB 213
-#define X_GLrop_CompressedTexImage1D 214
-#define X_GLrop_CompressedTexImage2D 215
-#define X_GLrop_CompressedTexImage3D 216
-#define X_GLrop_CompressedTexSubImage1D 217
-#define X_GLrop_CompressedTexSubImage2D 218
-#define X_GLrop_CompressedTexSubImage3D 219
-#define X_GLrop_SampleCoverageARB 229
-
-/* Added for core GL version 1.4 */
-
-#define X_GLrop_WindowPos3fARB 230
-#define X_GLrop_FogCoordfv 4124
-#define X_GLrop_FogCoorddv 4125
-#define X_GLrop_PointParameterfARB 2065
-#define X_GLrop_PointParameterfvARB 2066
-#define X_GLrop_SecondaryColor3bv 4126
-#define X_GLrop_SecondaryColor3sv 4127
-#define X_GLrop_SecondaryColor3iv 4128
-#define X_GLrop_SecondaryColor3fv 4129
-#define X_GLrop_SecondaryColor3dv 4130
-#define X_GLrop_SecondaryColor3ubv 4131
-#define X_GLrop_SecondaryColor3usv 4132
-#define X_GLrop_SecondaryColor3uiv 4133
-#define X_GLrop_BlendFuncSeparate 4134
-#define X_GLrop_PointParameteri 4221
-#define X_GLrop_PointParameteriv 4222
-
-/* Added for core GL version 1.5 */
-/* XXX opcodes not defined in the spec */
-
-/* Opcodes for Vendor Private commands */
-
-
-#define X_GLvop_GetConvolutionFilterEXT 1
-#define X_GLvop_GetConvolutionParameterfvEXT 2
-#define X_GLvop_GetConvolutionParameterivEXT 3
-#define X_GLvop_GetSeparableFilterEXT 4
-#define X_GLvop_GetHistogramEXT 5
-#define X_GLvop_GetHistogramParameterfvEXT 6
-#define X_GLvop_GetHistogramParameterivEXT 7
-#define X_GLvop_GetMinmaxEXT 8
-#define X_GLvop_GetMinmaxParameterfvEXT 9
-#define X_GLvop_GetMinmaxParameterivEXT 10
-#define X_GLvop_AreTexturesResidentEXT 11
-#define X_GLvop_DeleteTexturesEXT 12
-#define X_GLvop_GenTexturesEXT 13
-#define X_GLvop_IsTextureEXT 14
-#define X_GLvop_GetCombinerInputParameterfvNV 1270
-#define X_GLvop_GetCombinerInputParameterivNV 1271
-#define X_GLvop_GetCombinerOutputParameterfvNV 1272
-#define X_GLvop_GetCombinerOutputParameterivNV 1273
-#define X_GLvop_GetFinalCombinerOutputParameterfvNV 1274
-#define X_GLvop_GetFinalCombinerOutputParameterivNV 1275
-#define X_GLvop_DeleteFenceNV 1276
-#define X_GLvop_GenFencesNV 1277
-#define X_GLvop_IsFenceNV 1278
-#define X_GLvop_TestFenceNV 1279
-#define X_GLvop_GetFenceivNV 1280
-#define X_GLvop_AreProgramsResidentNV 1293
-#define X_GLvop_DeleteProgramARB 1294
-#define X_GLvop_GenProgramsARB 1295
-#define X_GLvop_GetProgramEnvParameterfvARB 1296
-#define X_GLvop_GetProgramEnvParameterdvARB 1297
-#define X_GLvop_GetProgramEnvParameterivNV 1298
-#define X_GLvop_GetProgramStringNV 1299
-#define X_GLvop_GetTrackMatrixivNV 1300
-#define X_GLvop_GetVertexAttribdvARB 1301
-#define X_GLvop_GetVertexAttribfvARB 1302
-#define X_GLvop_GetVertexAttribivARB 1303
-#define X_GLvop_IsProgramARB 1304
-#define X_GLvop_GetProgramLocalParameterfvARB 1305
-#define X_GLvop_GetProgramLocalParameterdvARB 1306
-#define X_GLvop_GetProgramivARB 1307
-#define X_GLvop_GetProgramStringARB 1308
-#define X_GLvop_GetProgramNamedParameter4fvNV 1310
-#define X_GLvop_GetProgramNamedParameter4dvNV 1311
-#define X_GLvop_SampleMaskSGIS 2048
-#define X_GLvop_SamplePatternSGIS 2049
-#define X_GLvop_GetDetailTexFuncSGIS 4096
-#define X_GLvop_GetSharpenTexFuncSGIS 4097
-#define X_GLvop_GetColorTableSGI 4098
-#define X_GLvop_GetColorTableParameterfvSGI 4099
-#define X_GLvop_GetColorTableParameterivSGI 4100
-#define X_GLvop_GetTexFilterFuncSGIS 4101
-#define X_GLvop_GetInstrumentsSGIX 4102
-#define X_GLvop_InstrumentsBufferSGIX 4103
-#define X_GLvop_PollInstrumentsSGIX 4104
-#define X_GLvop_FlushRasterSGIX 4105
-
-/* Opcodes for GLX vendor private commands */
-
-#define X_GLXvop_QueryContextInfoEXT 1024
-#define X_GLXvop_BindTexImageEXT 1330
-#define X_GLXvop_ReleaseTexImageEXT 1331
-#define X_GLXvop_SwapIntervalSGI 65536
-#define X_GLXvop_MakeCurrentReadSGI 65537
-#define X_GLXvop_CreateGLXVideoSourceSGIX 65538
-#define X_GLXvop_DestroyGLXVideoSourceSGIX 65539
-#define X_GLXvop_GetFBConfigsSGIX 65540
-#define X_GLXvop_CreateContextWithConfigSGIX 65541
-#define X_GLXvop_CreateGLXPixmapWithConfigSGIX 65542
-#define X_GLXvop_CreateGLXPbufferSGIX 65543
-#define X_GLXvop_DestroyGLXPbufferSGIX 65544
-#define X_GLXvop_ChangeDrawableAttributesSGIX 65545
-#define X_GLXvop_GetDrawableAttributesSGIX 65546
-#define X_GLXvop_JoinSwapGroupSGIX 65547
-#define X_GLXvop_BindSwapBarrierSGIX 65548
-#define X_GLXvop_QueryMaxSwapBarriersSGIX 65549
-#define X_GLXvop_QueryHyperpipeNetworkSGIX 65550
-#define X_GLXvop_QueryHyperpipeConfigSGIX 65551
-#define X_GLXvop_HyperpipeConfigSGIX 65552
-#define X_GLXvop_DestroyHyperpipeConfigSGIX 65553
-
-/* ARB extension opcodes */
-
-/* 1. GL_ARB_multitexture - see GL 1.2 opcodes */
-/* 5. GL_ARB_multisample - see GL 1.3 opcodes */
-/* 12. GL_ARB_texture_compression - see GL 1.3 opcodes */
-/* 14. GL_ARB_point_parameters - see GL 1.4 opcodees */
-
-/* 15. GL_ARB_vertex_blend */
-#define X_GLrop_WeightbvARB 220
-#define X_GLrop_WeightubvARB 221
-#define X_GLrop_WeightsvARB 222
-#define X_GLrop_WeightusvARB 223
-#define X_GLrop_WeightivARB 224
-#define X_GLrop_WeightuivARB 225
-#define X_GLrop_VertexBlendARB 226
-#define X_GLrop_WeightfvARB 227
-#define X_GLrop_WeightdvARB 228
-
-/* 16. GL_ARB_matrix_palette */
-/* XXX opcodes not defined in the spec */
-
-/* 25. GL_ARB_window_pos - see GL 1.4 opcodes */
-
-/* 26. GL_ARB_vertex_program */
-#define X_GLrop_BindProgramARB 4180
-#define X_GLrop_ProgramEnvParameter4fvARB 4184
-#define X_GLrop_ProgramEnvParameter4dvARB 4185
-#define X_GLrop_VertexAttrib1svARB 4189
-#define X_GLrop_VertexAttrib2svARB 4190
-#define X_GLrop_VertexAttrib3svARB 4191
-#define X_GLrop_VertexAttrib4svARB 4192
-#define X_GLrop_VertexAttrib1fvARB 4193
-#define X_GLrop_VertexAttrib2fvARB 4194
-#define X_GLrop_VertexAttrib3fvARB 4195
-#define X_GLrop_VertexAttrib4fvARB 4196
-#define X_GLrop_VertexAttrib1dvARB 4197
-#define X_GLrop_VertexAttrib2dvARB 4198
-#define X_GLrop_VertexAttrib3dvARB 4199
-#define X_GLrop_ProgramLocalParameter4fvARB 4215
-#define X_GLrop_ProgramLocalParameter4dvARB 4216
-#define X_GLrop_ProgramStringARB 4217
-#define X_GLrop_VertexAttrib4dvARB 4200
-#define X_GLrop_VertexAttrib4NubvARB 4201
-#define X_GLrop_VertexAttrib4bvARB 4230
-#define X_GLrop_VertexAttrib4ivARB 4231
-#define X_GLrop_VertexAttrib4ubvARB 4232
-#define X_GLrop_VertexAttrib4usvARB 4233
-#define X_GLrop_VertexAttrib4uivARB 4234
-#define X_GLrop_VertexAttrib4NbvARB 4235
-#define X_GLrop_VertexAttrib4NsvARB 4236
-#define X_GLrop_VertexAttrib4NivARB 4237
-#define X_GLrop_VertexAttrib4NusvARB 4238
-#define X_GLrop_VertexAttrib4NuivARB 4239
-
-/* 27. GL_ARB_fragment_program - see GL_ARB_vertex_program opcodes */
-
-/* 29. GL_ARB_occlusion_query */
-/* XXX opcodes not defined in the spec */
-
-
-/* New extension opcodes */
-
-/* 145. GL_EXT_secondary_color - see GL 1.4 opcodes */
-
-/* 188. GL_EXT_vertex_weighting */
-#define X_GLrop_VertexWeightfvEXT 4135
-
-/* 191. GL_NV_register_combiners */
-#define X_GLrop_CombinerParameterfNV 4136
-#define X_GLrop_CombinerParameterfvNV 4137
-#define X_GLrop_CombinerParameteriNV 4138
-#define X_GLrop_CombinerParameterivNV 4139
-#define X_GLrop_CombinerInputNV 4140
-#define X_GLrop_CombinerOutputNV 4141
-#define X_GLrop_FinalCombinerInputNV 4142
-
-/* 222. GL_NV_fence */
-#define X_GLrop_SetFenceNV 4143
-#define X_GLrop_FinishFenceNV 4144
-
-/* 227. GL_NV_register_combiners2 */
-/* XXX opcodes not defined in the spec */
-
-/* 233. GL_NV_vertex_program - see also GL_ARB_vertex_program opcodes */
-#define X_GLrop_ExecuteProgramNV 4181
-#define X_GLrop_RequestResidentProgramsNV 4182
-#define X_GLrop_LoadProgamNV 4183
-#define X_GLrop_ProgramParameters4fvNV 4186
-#define X_GLrop_ProgramParameters4dvNV 4187
-#define X_GLrop_TrackMatrixNV 4188
-#define X_GLrop_VertexAttribs1svNV 4202
-#define X_GLrop_VertexAttribs2svNV 4203
-#define X_GLrop_VertexAttribs3svNV 4204
-#define X_GLrop_VertexAttribs4svNV 4205
-#define X_GLrop_VertexAttribs1fvNV 4206
-#define X_GLrop_VertexAttribs2fvNV 4207
-#define X_GLrop_VertexAttribs3fvNV 4208
-#define X_GLrop_VertexAttribs4fvNV 4209
-#define X_GLrop_VertexAttribs1dvNV 4210
-#define X_GLrop_VertexAttribs2dvNV 4211
-#define X_GLrop_VertexAttribs3dvNV 4212
-#define X_GLrop_VertexAttribs4dvNV 4213
-#define X_GLrop_VertexAttribs4ubvNV 4214
-
-/* 261. GL_NV_occlusion_query */
-/* XXX opcodes not defined in the spec */
-
-/* 262. GL_NV_point_sprite - see GL 1.4 opcodes */
-
-/* 268. GL_EXT_stencil_two_side */
-#define X_GLrop_ActiveStencilFaceEXT 4220
-
-/* 282. GL_NV_fragment_program - see also GL_NV_vertex_program and GL_ARB_vertex_program opcodes */
-#define X_GLrop_ProgramNamedParameter4fvNV 4218
-#define X_GLrop_ProgramNamedParameter4dvNV 4219
-
-/* 285. GL_NV_primitive_restart */
-/* XXX opcodes not defined in the spec */
-
-/* 297. GL_EXT_depth_bounds_test */
-#define X_GLrop_DepthBoundsEXT 4229
-
-/* 299. GL_EXT_blend_equation_separate */
-#define X_GLrop_BlendEquationSeparateEXT 4228
-
-/* 310. GL_EXT_framebuffer_object */
-#define X_GLvop_IsRenderbufferEXT 1422
-#define X_GLvop_GenRenderbuffersEXT 1423
-#define X_GLvop_GetRenderbufferParameterivEXT 1424
-#define X_GLvop_IsFramebufferEXT 1425
-#define X_GLvop_GenFramebuffersEXT 1426
-#define X_GLvop_CheckFramebufferStatusEXT 1427
-#define X_GLvop_GetFramebufferAttachmentParameterivEXT 1428
-
-#endif /* _GLX_glxproto_h_ */
+#ifndef _GLX_glxproto_h_
+#define _GLX_glxproto_h_
+
+/*
+ * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
+ * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
+ *
+ * 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 including the dates of first publication and
+ * either this permission notice or a reference to
+ * http://oss.sgi.com/projects/FreeB/
+ * 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
+ * SILICON GRAPHICS, INC. 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.
+ *
+ * Except as contained in this notice, the name of Silicon Graphics, Inc.
+ * shall not be used in advertising or otherwise to promote the sale, use or
+ * other dealings in this Software without prior written authorization from
+ * Silicon Graphics, Inc.
+ */
+
+#include <GL/glxmd.h>
+
+/*****************************************************************************/
+
+/*
+** Errrors.
+*/
+#define GLXBadContext 0
+#define GLXBadContextState 1
+#define GLXBadDrawable 2
+#define GLXBadPixmap 3
+#define GLXBadContextTag 4
+#define GLXBadCurrentWindow 5
+#define GLXBadRenderRequest 6
+#define GLXBadLargeRequest 7
+#define GLXUnsupportedPrivateRequest 8
+#define GLXBadFBConfig 9
+#define GLXBadPbuffer 10
+#define GLXBadCurrentDrawable 11
+#define GLXBadWindow 12
+#define GLXBadProfileARB 13
+
+#define __GLX_NUMBER_ERRORS 14
+
+/*
+** Events.
+** __GLX_NUMBER_EVENTS is set to 17 to account for the BufferClobberSGIX
+** event - this helps initialization if the server supports the pbuffer
+** extension and the client doesn't.
+*/
+#define GLX_PbufferClobber 0
+#define GLX_BufferSwapComplete 1
+
+#define __GLX_NUMBER_EVENTS 17
+
+#define GLX_EXTENSION_NAME "GLX"
+#define GLX_EXTENSION_ALIAS "SGI-GLX"
+
+#define __GLX_MAX_CONTEXT_PROPS 3
+
+#ifndef GLX_VENDOR
+#define GLX_VENDOR 0x1
+#endif
+#ifndef GLX_VERSION
+#define GLX_VERSION 0x2
+#endif
+#ifndef GLX_EXTENSIONS
+#define GLX_EXTENSIONS 0x3
+#endif
+
+/*****************************************************************************/
+
+/*
+** For the structure definitions in this file, we must redefine these types in
+** terms of Xmd.h types, which may include bitfields. All of these are
+** undef'ed at the end of this file, restoring the definitions in glx.h.
+*/
+#define GLXContextID CARD32
+#define GLXPixmap CARD32
+#define GLXDrawable CARD32
+#define GLXPbuffer CARD32
+#define GLXWindow CARD32
+#define GLXFBConfigID CARD32
+#define GLXFBConfigIDSGIX CARD32
+#define GLXPbufferSGIX CARD32
+
+/*
+** ContextTag is not exposed to the API.
+*/
+typedef CARD32 GLXContextTag;
+
+/*****************************************************************************/
+
+/*
+** Sizes of basic wire types.
+*/
+#define __GLX_SIZE_INT8 1
+#define __GLX_SIZE_INT16 2
+#define __GLX_SIZE_INT32 4
+#define __GLX_SIZE_CARD8 1
+#define __GLX_SIZE_CARD16 2
+#define __GLX_SIZE_CARD32 4
+#define __GLX_SIZE_FLOAT32 4
+#define __GLX_SIZE_FLOAT64 8
+
+/*****************************************************************************/
+
+/* Requests */
+
+/*
+** Render command request. A bunch of rendering commands are packed into
+** a single X extension request.
+*/
+typedef struct GLXRender {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextTag contextTag B32;
+} xGLXRenderReq;
+#define sz_xGLXRenderReq 8
+
+/*
+** The maximum size that a GLXRender command can be. The value must fit
+** in 16 bits and should be a multiple of 4.
+*/
+#define __GLX_MAX_RENDER_CMD_SIZE 64000
+
+/*
+** Large render command request. A single large rendering command
+** is output in multiple X extension requests. The first packet
+** contains an opcode dependent header (see below) that describes
+** the data that follows.
+*/
+typedef struct GLXRenderLarge {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextTag contextTag B32;
+ CARD16 requestNumber B16;
+ CARD16 requestTotal B16;
+ CARD32 dataBytes B32;
+} xGLXRenderLargeReq;
+#define sz_xGLXRenderLargeReq 16
+
+/*
+** GLX single request. Commands that go over as single GLX protocol
+** requests use this structure. The glxCode will be one of the X_GLsop
+** opcodes.
+*/
+typedef struct GLXSingle {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextTag contextTag B32;
+} xGLXSingleReq;
+#define sz_xGLXSingleReq 8
+
+/*
+** glXQueryVersion request
+*/
+typedef struct GLXQueryVersion {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 majorVersion B32;
+ CARD32 minorVersion B32;
+} xGLXQueryVersionReq;
+#define sz_xGLXQueryVersionReq 12
+
+/*
+** glXIsDirect request
+*/
+typedef struct GLXIsDirect {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextID context B32;
+} xGLXIsDirectReq;
+#define sz_xGLXIsDirectReq 8
+
+/*
+** glXCreateContext request
+*/
+typedef struct GLXCreateContext {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextID context B32;
+ CARD32 visual B32;
+ CARD32 screen B32;
+ GLXContextID shareList B32;
+ BOOL isDirect;
+ CARD8 reserved1;
+ CARD16 reserved2 B16;
+} xGLXCreateContextReq;
+#define sz_xGLXCreateContextReq 24
+
+/*
+** glXDestroyContext request
+*/
+typedef struct GLXDestroyContext {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextID context B32;
+} xGLXDestroyContextReq;
+#define sz_xGLXDestroyContextReq 8
+
+/*
+** glXMakeCurrent request
+*/
+typedef struct GLXMakeCurrent {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXDrawable drawable B32;
+ GLXContextID context B32;
+ GLXContextTag oldContextTag B32;
+} xGLXMakeCurrentReq;
+#define sz_xGLXMakeCurrentReq 16
+
+/*
+** glXWaitGL request
+*/
+typedef struct GLXWaitGL {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextTag contextTag B32;
+} xGLXWaitGLReq;
+#define sz_xGLXWaitGLReq 8
+
+/*
+** glXWaitX request
+*/
+typedef struct GLXWaitX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextTag contextTag B32;
+} xGLXWaitXReq;
+#define sz_xGLXWaitXReq 8
+
+/*
+** glXCopyContext request
+*/
+typedef struct GLXCopyContext {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextID source B32;
+ GLXContextID dest B32;
+ CARD32 mask B32;
+ GLXContextTag contextTag B32;
+} xGLXCopyContextReq;
+#define sz_xGLXCopyContextReq 20
+
+/*
+** glXSwapBuffers request
+*/
+typedef struct GLXSwapBuffers {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextTag contextTag B32;
+ GLXDrawable drawable B32;
+} xGLXSwapBuffersReq;
+#define sz_xGLXSwapBuffersReq 12
+
+/*
+** glXUseXFont request
+*/
+typedef struct GLXUseXFont {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextTag contextTag B32;
+ CARD32 font B32;
+ CARD32 first B32;
+ CARD32 count B32;
+ CARD32 listBase B32;
+} xGLXUseXFontReq;
+#define sz_xGLXUseXFontReq 24
+
+/*
+** glXCreateGLXPixmap request
+*/
+typedef struct GLXCreateGLXPixmap {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 screen B32;
+ CARD32 visual B32;
+ CARD32 pixmap B32;
+ GLXPixmap glxpixmap B32;
+} xGLXCreateGLXPixmapReq;
+#define sz_xGLXCreateGLXPixmapReq 20
+
+/*
+** glXDestroyGLXPixmap request
+*/
+typedef struct GLXDestroyGLXPixmap {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXPixmap glxpixmap B32;
+} xGLXDestroyGLXPixmapReq;
+#define sz_xGLXDestroyGLXPixmapReq 8
+
+/*
+** glXGetVisualConfigs request
+*/
+typedef struct GLXGetVisualConfigs {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 screen B32;
+} xGLXGetVisualConfigsReq;
+#define sz_xGLXGetVisualConfigsReq 8
+
+/*
+** glXVendorPrivate request.
+*/
+typedef struct GLXVendorPrivate {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ GLXContextTag contextTag B32;
+ /*
+ ** More data may follow; this is just the header.
+ */
+} xGLXVendorPrivateReq;
+#define sz_xGLXVendorPrivateReq 12
+
+/*
+** glXVendorPrivateWithReply request
+*/
+typedef struct GLXVendorPrivateWithReply {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ GLXContextTag contextTag B32;
+ /*
+ ** More data may follow; this is just the header.
+ */
+} xGLXVendorPrivateWithReplyReq;
+#define sz_xGLXVendorPrivateWithReplyReq 12
+
+/*
+** glXQueryExtensionsString request
+*/
+typedef struct GLXQueryExtensionsString {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 screen B32;
+} xGLXQueryExtensionsStringReq;
+#define sz_xGLXQueryExtensionsStringReq 8
+
+/*
+** glXQueryServerString request
+*/
+typedef struct GLXQueryServerString {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 screen B32;
+ CARD32 name B32;
+} xGLXQueryServerStringReq;
+#define sz_xGLXQueryServerStringReq 12
+
+/*
+** glXClientInfo request
+*/
+typedef struct GLXClientInfo {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 major B32;
+ CARD32 minor B32;
+ CARD32 numbytes B32;
+} xGLXClientInfoReq;
+#define sz_xGLXClientInfoReq 16
+
+/*** Start of GLX 1.3 requests */
+
+/*
+** glXGetFBConfigs request
+*/
+typedef struct GLXGetFBConfigs {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 screen B32;
+} xGLXGetFBConfigsReq;
+#define sz_xGLXGetFBConfigsReq 8
+
+/*
+** glXCreatePixmap request
+*/
+typedef struct GLXCreatePixmap {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 screen B32;
+ GLXFBConfigID fbconfig B32;
+ CARD32 pixmap B32;
+ GLXPixmap glxpixmap B32;
+ CARD32 numAttribs B32;
+ /* followed by attribute list */
+} xGLXCreatePixmapReq;
+#define sz_xGLXCreatePixmapReq 24
+
+/*
+** glXDestroyPixmap request
+*/
+typedef struct GLXDestroyPixmap {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXPixmap glxpixmap B32;
+} xGLXDestroyPixmapReq;
+#define sz_xGLXDestroyPixmapReq 8
+
+/*
+** glXCreateNewContext request
+*/
+typedef struct GLXCreateNewContext {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextID context B32;
+ GLXFBConfigID fbconfig B32;
+ CARD32 screen B32;
+ CARD32 renderType;
+ GLXContextID shareList B32;
+ BOOL isDirect;
+ CARD8 reserved1;
+ CARD16 reserved2 B16;
+} xGLXCreateNewContextReq;
+#define sz_xGLXCreateNewContextReq 28
+
+/*
+** glXQueryContext request
+*/
+typedef struct GLXQueryContext {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextID context B32;
+} xGLXQueryContextReq;
+#define sz_xGLXQueryContextReq 8
+
+/*
+** glXMakeContextCurrent request
+*/
+typedef struct GLXMakeContextCurrent {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextTag oldContextTag B32;
+ GLXDrawable drawable B32;
+ GLXDrawable readdrawable B32;
+ GLXContextID context B32;
+} xGLXMakeContextCurrentReq;
+#define sz_xGLXMakeContextCurrentReq 20
+
+/*
+** glXCreatePbuffer request
+*/
+typedef struct GLXCreatePbuffer {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 screen B32;
+ GLXFBConfigID fbconfig B32;
+ GLXPbuffer pbuffer B32;
+ CARD32 numAttribs B32;
+ /* followed by attribute list */
+} xGLXCreatePbufferReq;
+#define sz_xGLXCreatePbufferReq 20
+
+/*
+** glXDestroyPbuffer request
+*/
+typedef struct GLXDestroyPbuffer {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXPbuffer pbuffer B32;
+} xGLXDestroyPbufferReq;
+#define sz_xGLXDestroyPbufferReq 8
+
+/*
+** glXGetDrawableAttributes request
+*/
+typedef struct GLXGetDrawableAttributes {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXDrawable drawable B32;
+} xGLXGetDrawableAttributesReq;
+#define sz_xGLXGetDrawableAttributesReq 8
+
+/*
+** glXChangeDrawableAttributes request
+*/
+typedef struct GLXChangeDrawableAttributes {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXDrawable drawable B32;
+ CARD32 numAttribs B32;
+ /* followed by attribute list */
+} xGLXChangeDrawableAttributesReq;
+#define sz_xGLXChangeDrawableAttributesReq 12
+
+/*
+** glXCreateWindow request
+*/
+typedef struct GLXCreateWindow {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 screen B32;
+ GLXFBConfigID fbconfig B32;
+ CARD32 window B32;
+ GLXWindow glxwindow B32;
+ CARD32 numAttribs B32;
+ /* followed by attribute list */
+} xGLXCreateWindowReq;
+#define sz_xGLXCreateWindowReq 24
+
+/*
+** glXDestroyWindow request
+*/
+typedef struct GLXDestroyWindow {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXWindow glxwindow B32;
+} xGLXDestroyWindowReq;
+#define sz_xGLXDestroyWindowReq 8
+
+/* Replies */
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 error B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXGetErrorReply;
+#define sz_xGLXGetErrorReply 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ GLXContextTag contextTag B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXMakeCurrentReply;
+#define sz_xGLXMakeCurrentReply 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXReadPixelsReply;
+#define sz_xGLXReadPixelsReply 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 width B32;
+ CARD32 height B32;
+ CARD32 depth B32;
+ CARD32 pad6 B32;
+} xGLXGetTexImageReply;
+#define sz_xGLXGetTexImageReply 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 width B32;
+ CARD32 height B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXGetSeparableFilterReply;
+#define sz_xGLXGetSeparableFilterReply 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 width B32;
+ CARD32 height B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXGetConvolutionFilterReply;
+#define sz_xGLXGetConvolutionFilterReply 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 width B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXGetHistogramReply;
+#define sz_xGLXGetHistogramReply 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXGetMinmaxReply;
+#define sz_xGLXGetMinmaxReply 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 retval B32;
+ CARD32 size B32;
+ CARD32 newMode B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXRenderModeReply;
+#define sz_xGLXRenderModeReply 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 majorVersion B32;
+ CARD32 minorVersion B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXQueryVersionReply;
+#define sz_xGLXQueryVersionReply 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 numVisuals B32;
+ CARD32 numProps B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXGetVisualConfigsReply;
+#define sz_xGLXGetVisualConfigsReply 32
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ BOOL isDirect;
+ CARD8 pad1;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+} xGLXIsDirectReply;
+#define sz_xGLXIsDirectReply 32
+
+/*
+** This reply structure is used for all single replies. Single replies
+** ship either 1 piece of data or N pieces of data. In these cases
+** size indicates how much data is to be returned.
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 retval B32;
+ CARD32 size B32;
+ CARD32 pad3 B32; /* NOTE: may hold a single value */
+ CARD32 pad4 B32; /* NOTE: may hold half a double */
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXSingleReply;
+#define sz_xGLXSingleReply 32
+
+/*
+** This reply structure is used for all Vendor Private replies. Vendor
+** Private replies can ship up to 24 bytes within the header or can
+** be variable sized, in which case, the reply length field indicates
+** the number of words of data which follow the header.
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 retval B32;
+ CARD32 size B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXVendorPrivReply;
+#define sz_xGLXVendorPrivReply 32
+
+/*
+** QueryExtensionsStringReply
+** n indicates the number of bytes to be returned.
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 n B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXQueryExtensionsStringReply;
+#define sz_xGLXQueryExtensionsStringReply 32
+
+/*
+** QueryServerString Reply struct
+** n indicates the number of bytes to be returned.
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 n B32;
+ CARD32 pad3 B32; /* NOTE: may hold a single value */
+ CARD32 pad4 B32; /* NOTE: may hold half a double */
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXQueryServerStringReply;
+#define sz_xGLXQueryServerStringReply 32
+
+/*** Start of GLX 1.3 replies */
+
+/*
+** glXGetFBConfigs reply
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 numFBConfigs B32;
+ CARD32 numAttribs B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXGetFBConfigsReply;
+#define sz_xGLXGetFBConfigsReply 32
+
+/*
+** glXQueryContext reply
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 n B32; /* number of attribute/value pairs */
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXQueryContextReply;
+#define sz_xGLXQueryContextReply 32
+
+/*
+** glXMakeContextCurrent reply
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ GLXContextTag contextTag B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXMakeContextCurrentReply;
+#define sz_xGLXMakeContextCurrentReply 32
+
+/*
+** glXCreateGLXPbuffer reply
+** This is used only in the direct rendering case on SGIs - otherwise
+** CreateGLXPbuffer has no reply. It is not part of GLX 1.3.
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 success;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXCreateGLXPbufferReply;
+#define sz_xGLXCreateGLXPbufferReply 32
+
+/*
+** glXGetDrawableAttributes reply
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 numAttribs B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXGetDrawableAttributesReply;
+#define sz_xGLXGetDrawableAttributesReply 32
+
+/*
+** glXGetColorTable reply
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 width B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXGetColorTableReply;
+#define sz_xGLXGetColorTableReply 32
+
+/************************************************************************/
+
+/* GLX extension requests and replies */
+
+/*
+** glXQueryContextInfoEXT request
+*/
+typedef struct GLXQueryContextInfoEXT {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ GLXContextID context B32;
+} xGLXQueryContextInfoEXTReq;
+#define sz_xGLXQueryContextInfoEXTReq 16
+
+/*
+** glXQueryContextInfoEXT reply
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 n B32; /* number of attribute/value pairs */
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXQueryContextInfoEXTReply;
+#define sz_xGLXQueryContextInfoEXTReply 32
+
+/*
+** glXMakeCurrentReadSGI request
+*/
+typedef struct GLXMakeCurrentReadSGI {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ GLXContextTag oldContextTag B32;
+ GLXDrawable drawable B32;
+ GLXDrawable readable B32;
+ GLXContextID context B32;
+} xGLXMakeCurrentReadSGIReq;
+#define sz_xGLXMakeCurrentReadSGIReq 24
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ GLXContextTag contextTag B32;
+ CARD32 writeVid B32;
+ CARD32 writeType B32;
+ CARD32 readVid B32;
+ CARD32 readType B32;
+ CARD32 pad6 B32;
+} xGLXMakeCurrentReadSGIReply;
+#define sz_xGLXMakeCurrentReadSGIReply 32
+
+/*
+** glXGetFBConfigsSGIX request
+*/
+typedef struct GLXGetFBConfigsSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ CARD32 screen B32;
+} xGLXGetFBConfigsSGIXReq;
+#define sz_xGLXGetFBConfigsSGIXReq 16
+
+/*
+** glXCreateContextWithConfigSGIX request
+*/
+
+typedef struct GLXCreateContextWithConfigSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ GLXContextID context B32;
+ GLXFBConfigID fbconfig B32;
+ CARD32 screen B32;
+ CARD32 renderType;
+ GLXContextID shareList B32;
+ BOOL isDirect;
+ CARD8 reserved1;
+ CARD16 reserved2 B16;
+} xGLXCreateContextWithConfigSGIXReq;
+#define sz_xGLXCreateContextWithConfigSGIXReq 36
+
+/*
+** glXCreatePixmapWithConfigSGIX request
+*/
+
+typedef struct GLXCreateGLXPixmapWithConfigSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ CARD32 screen B32;
+ GLXFBConfigID fbconfig B32;
+ CARD32 pixmap B32;
+ GLXPixmap glxpixmap B32;
+} xGLXCreateGLXPixmapWithConfigSGIXReq;
+#define sz_xGLXCreateGLXPixmapWithConfigSGIXReq 28
+
+/*
+** glXCreateGLXPbufferSGIX request
+*/
+typedef struct GLXCreateGLXPbufferSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ CARD32 screen B32;
+ GLXFBConfigID fbconfig B32;
+ GLXPbuffer pbuffer B32;
+ CARD32 width B32;
+ CARD32 height B32;
+ /* followed by attribute list */
+} xGLXCreateGLXPbufferSGIXReq;
+#define sz_xGLXCreateGLXPbufferSGIXReq 32
+
+/*
+** glXDestroyGLXPbufferSGIX request
+*/
+typedef struct GLXDestroyGLXPbuffer {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ GLXPbuffer pbuffer B32;
+} xGLXDestroyGLXPbufferSGIXReq;
+#define sz_xGLXDestroyGLXPbufferSGIXReq 16
+
+/*
+** glXChangeDrawableAttributesSGIX request
+*/
+typedef struct GLXChangeDrawableAttributesSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ GLXDrawable drawable B32;
+ CARD32 numAttribs B32;
+ /* followed by attribute list */
+} xGLXChangeDrawableAttributesSGIXReq;
+#define sz_xGLXChangeDrawableAttributesSGIXReq 20
+
+/*
+** glXGetDrawableAttributesSGIX request
+*/
+typedef struct GLXGetDrawableAttributesSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ GLXDrawable drawable B32;
+} xGLXGetDrawableAttributesSGIXReq;
+#define sz_xGLXGetDrawableAttributesSGIXReq 16
+
+/*
+** glXGetDrawableAttributesSGIX reply
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 numAttribs B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXGetDrawableAttributesSGIXReply;
+#define sz_xGLXGetDrawableAttributesSGIXReply 32
+
+/*
+** glXJoinSwapGroupSGIX request
+*/
+typedef struct GLXJoinSwapGroupSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 unused B32; /* corresponds to contextTag in hdr */
+ GLXDrawable drawable B32;
+ GLXDrawable member B32;
+} xGLXJoinSwapGroupSGIXReq;
+#define sz_xGLXJoinSwapGroupSGIXReq 20
+
+/*
+** glXBindSwapBarrierSGIX request
+*/
+typedef struct GLXBindSwapBarrierSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 unused B32; /* corresponds to contextTag in hdr */
+ GLXDrawable drawable B32;
+ CARD32 barrier B32;
+} xGLXBindSwapBarrierSGIXReq;
+#define sz_xGLXBindSwapBarrierSGIXReq 20
+
+/*
+** glXQueryMaxSwapBarriersSGIX request
+*/
+typedef struct GLXQueryMaxSwapBarriersSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 unused B32; /* corresponds to contextTag in hdr */
+ CARD32 screen B32;
+} xGLXQueryMaxSwapBarriersSGIXReq;
+#define sz_xGLXQueryMaxSwapBarriersSGIXReq 16
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 max B32;
+ CARD32 size B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXQueryMaxSwapBarriersSGIXReply;
+#define sz_xGLXQueryMaxSwapBarriersSGIXReply 32
+
+/*
+** glXQueryHyperpipeNetworkSGIX request
+*/
+typedef struct GLXQueryHyperpipeNetworkSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ CARD32 screen B32;
+} xGLXQueryHyperpipeNetworkSGIXReq;
+#define sz_xGLXQueryHyperpipeNetworkSGIXReq 16
+
+/*
+** glXQueryHyperpipeNetworkSGIX reply
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 n B32;
+ CARD32 npipes B32; /* NOTE: may hold a single value */
+ CARD32 pad4 B32; /* NOTE: may hold half a double */
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXQueryHyperpipeNetworkSGIXReply;
+#define sz_xGLXQueryHyperpipeNetworkSGIXReply 32
+
+/*
+** glXDestroyHyperpipeConfigSGIX request
+*/
+typedef struct GLXDestroyHyperpipeConfigSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ CARD32 screen B32;
+ CARD32 hpId B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xGLXDestroyHyperpipeConfigSGIXReq;
+#define sz_xGLXDestroyHyperpipeConfigSGIXReq 32
+
+/*
+** glXDestroyHyperpipeConfigSGIX reply
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 n B32;
+ CARD32 success B32; /* NOTE: may hold a single value */
+ CARD32 pad4 B32; /* NOTE: may hold half a double */
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXDestroyHyperpipeConfigSGIXReply;
+#define sz_xGLXDestroyHyperpipeConfigSGIXReply 32
+
+/*
+** glXQueryHyperpipeConfigSGIX request
+*/
+typedef struct GLXQueryHyperpipeConfigSGIX {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ CARD32 screen B32;
+ CARD32 hpId B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+} xGLXQueryHyperpipeConfigSGIXReq;
+#define sz_xGLXQueryHyperpipeConfigSGIXReq 32
+
+/*
+** glXQueryHyperpipeConfigSGIX reply
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 n B32;
+ CARD32 npipes B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXQueryHyperpipeConfigSGIXReply;
+#define sz_xGLXQueryHyperpipeConfigSGIXReply 32
+
+/*
+** glXHyperpipeConfigSGIX request
+*/
+typedef struct {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 vendorCode B32; /* vendor-specific opcode */
+ CARD32 pad1 B32; /* unused; corresponds to contextTag in header */
+ CARD32 screen B32;
+ CARD32 npipes B32;
+ CARD32 networkId B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ /* followed by attribute list */
+} xGLXHyperpipeConfigSGIXReq;
+#define sz_xGLXHyperpipeConfigSGIXReq 32
+
+/*
+** glXHyperpipeConfigSGIX reply
+*/
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 unused; /* not used */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 n B32;
+ CARD32 npipes B32;
+ CARD32 hpId B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGLXHyperpipeConfigSGIXReply;
+#define sz_xGLXHyperpipeConfigSGIXReply 32
+
+/**
+ * \name Protocol structures for GLX_ARB_create_context and
+ * GLX_ARB_create_context_profile
+ */
+/*@{*/
+/**
+ * Protocol header for glXSetClientInfoARB
+ *
+ * This structure is follwed by \c numVersions * 2 \c CARD32 values listing
+ * the OpenGL versions supported by the client. The pairs of values are an
+ * OpenGL major version followed by a minor version. For example,
+ *
+ * CARD32 versions[4] = { 2, 1, 3, 0 };
+ *
+ * says that the client supports OpenGL 2.1 and OpenGL 3.0.
+ *
+ * These are followed by \c numGLExtensionBytes bytes of \c STRING8 containing
+ * the OpenGL extension string supported by the client and up to 3 bytes of
+ * padding.
+ *
+ * The list of OpenGL extensions is followed by \c numGLXExtensionBytes bytes
+ * of \c STRING8 containing the GLX extension string supported by the client
+ * and up to 3 bytes of padding.
+ *
+ * This protocol replaces \c GLXClientInfo.
+ *
+ * \sa GLXClientInfo, GLXSetClientInfo2ARB
+ */
+typedef struct GLXSetClientInfoARB {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 major B32;
+ CARD32 minor B32;
+ CARD32 numVersions B32;
+ CARD32 numGLExtensionBytes B32;
+ CARD32 numGLXExtensionBytes B32;
+ /*
+ ** More data may follow; this is just the header.
+ */
+} xGLXSetClientInfoARBReq;
+#define sz_xGLXSetClientInfoARBReq 24
+
+/**
+ * Protocol head for glXCreateContextAttribsARB
+ *
+ * This protocol replaces \c GLXCreateContext, \c GLXCreateNewContext, and
+ * \c GLXCreateContextWithConfigSGIX.
+ */
+typedef struct GLXCreateContextAttribsARB {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ GLXContextID context B32;
+ GLXFBConfigID fbconfig B32;
+ CARD32 screen;
+ GLXContextID shareList B32;
+ BOOL isDirect;
+ CARD8 reserved1;
+ CARD16 reserved2 B16;
+ CARD32 numAttribs B32;
+ /* followed by attribute list */
+} xGLXCreateContextAttribsARBReq;
+#define sz_xGLXCreateContextAttribsARBReq 28
+
+/**
+ * Protocol header for glXSetClientInfo2ARB
+ *
+ * The glXSetClientInfo2ARB protocol differs from glXSetClientInfoARB in that
+ * the list of OpenGL versions supported by the client is 3 \c CARD32 values
+ * per version: major version, minor version, and supported profile mask.
+ *
+ * This protocol replaces \c GLXClientInfo and \c GLXSetClientInfoARB.
+ *
+ * \sa GLXClientInfo, GLXSetClientInfoARB
+ */
+typedef struct GLXSetClientInfo2ARB {
+ CARD8 reqType;
+ CARD8 glxCode;
+ CARD16 length B16;
+ CARD32 major B32;
+ CARD32 minor B32;
+ CARD32 numVersions B32;
+ CARD32 numGLExtensionBytes B32;
+ CARD32 numGLXExtensionBytes B32;
+ /*
+ ** More data may follow; this is just the header.
+ */
+} xGLXSetClientInfo2ARBReq;
+#define sz_xGLXSetClientInfo2ARBReq 24
+/*@}*/
+
+/************************************************************************/
+
+/*
+** Events
+*/
+
+typedef struct {
+ BYTE type;
+ BYTE pad;
+ CARD16 sequenceNumber B16;
+ CARD16 event_type B16; /*** was clobber_class */
+ CARD16 draw_type B16;
+ CARD32 drawable B32;
+ CARD32 buffer_mask B32; /*** was mask */
+ CARD16 aux_buffer B16;
+ CARD16 x B16;
+ CARD16 y B16;
+ CARD16 width B16;
+ CARD16 height B16;
+ CARD16 count B16;
+ CARD32 unused2 B32;
+} xGLXPbufferClobberEvent;
+
+typedef struct {
+ BYTE type;
+ BYTE pad;
+ CARD16 sequenceNumber B16;
+ CARD16 event_type B16;
+ CARD32 drawable;
+ CARD32 ust_hi B32;
+ CARD32 ust_lo B32;
+ CARD32 msc_hi B32;
+ CARD32 msc_lo B32;
+ CARD32 sbc_hi B32;
+ CARD32 sbc_lo B32;
+} xGLXBufferSwapComplete;
+
+typedef struct {
+ BYTE type;
+ BYTE pad;
+ CARD16 sequenceNumber B16;
+ CARD16 event_type B16;
+ CARD16 pad2;
+ CARD32 drawable;
+ CARD32 ust_hi B32;
+ CARD32 ust_lo B32;
+ CARD32 msc_hi B32;
+ CARD32 msc_lo B32;
+ CARD32 sbc B32;
+} xGLXBufferSwapComplete2;
+
+/************************************************************************/
+
+/*
+** Size of the standard X request header.
+*/
+#define __GLX_SINGLE_HDR_SIZE sz_xGLXSingleReq
+#define __GLX_VENDPRIV_HDR_SIZE sz_xGLXVendorPrivateReq
+
+#define __GLX_RENDER_HDR \
+ CARD16 length B16; \
+ CARD16 opcode B16
+
+#define __GLX_RENDER_HDR_SIZE 4
+
+typedef struct {
+ __GLX_RENDER_HDR;
+} __GLXrenderHeader;
+
+#define __GLX_RENDER_LARGE_HDR \
+ CARD32 length B32; \
+ CARD32 opcode B32
+
+#define __GLX_RENDER_LARGE_HDR_SIZE 8
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+} __GLXrenderLargeHeader;
+
+/*
+** The glBitmap, glPolygonStipple, glTexImage[12]D, glTexSubImage[12]D
+** and glDrawPixels calls all have a pixel header transmitted after the
+** Render or RenderLarge header and before their own opcode specific
+** headers.
+*/
+#define __GLX_PIXEL_HDR \
+ BOOL swapBytes; \
+ BOOL lsbFirst; \
+ CARD8 reserved0; \
+ CARD8 reserved1; \
+ CARD32 rowLength B32; \
+ CARD32 skipRows B32; \
+ CARD32 skipPixels B32; \
+ CARD32 alignment B32
+
+#define __GLX_PIXEL_HDR_SIZE 20
+
+typedef struct {
+ __GLX_PIXEL_HDR;
+} __GLXpixelHeader;
+
+/*
+** glTexImage[34]D and glTexSubImage[34]D calls
+** all have a pixel header transmitted after the Render or RenderLarge
+** header and before their own opcode specific headers.
+*/
+#define __GLX_PIXEL_3D_HDR \
+ BOOL swapBytes; \
+ BOOL lsbFirst; \
+ CARD8 reserved0; \
+ CARD8 reserved1; \
+ CARD32 rowLength B32; \
+ CARD32 imageHeight B32; \
+ CARD32 imageDepth B32; \
+ CARD32 skipRows B32; \
+ CARD32 skipImages B32; \
+ CARD32 skipVolumes B32; \
+ CARD32 skipPixels B32; \
+ CARD32 alignment B32
+
+#define __GLX_PIXEL_3D_HDR_SIZE 36
+
+/*
+** Data that is specific to a glBitmap call. The data is sent in the
+** following order:
+** Render or RenderLarge header
+** Pixel header
+** Bitmap header
+*/
+#define __GLX_BITMAP_HDR \
+ CARD32 width B32; \
+ CARD32 height B32; \
+ FLOAT32 xorig F32; \
+ FLOAT32 yorig F32; \
+ FLOAT32 xmove F32; \
+ FLOAT32 ymove F32
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_BITMAP_HDR;
+} __GLXbitmapHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_BITMAP_HDR;
+} __GLXbitmapLargeHeader;
+
+typedef struct {
+ __GLX_PIXEL_HDR;
+ __GLX_BITMAP_HDR;
+} __GLXdispatchBitmapHeader;
+
+#define __GLX_BITMAP_HDR_SIZE 24
+
+#define __GLX_BITMAP_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_BITMAP_HDR_SIZE)
+
+#define __GLX_BITMAP_CMD_DISPATCH_HDR_SIZE \
+ (__GLX_PIXEL_HDR_SIZE + __GLX_BITMAP_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_PIXEL_HDR;
+} __GLXpolygonStippleHeader;
+
+#define __GLX_POLYGONSTIPPLE_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE)
+
+/*
+** Data that is specific to a glTexImage1D or glTexImage2D call. The
+** data is sent in the following order:
+** Render or RenderLarge header
+** Pixel header
+** TexImage header
+** When a glTexImage1D call the height field is unexamined by the server.
+*/
+#define __GLX_TEXIMAGE_HDR \
+ CARD32 target B32; \
+ CARD32 level B32; \
+ CARD32 components B32; \
+ CARD32 width B32; \
+ CARD32 height B32; \
+ CARD32 border B32; \
+ CARD32 format B32; \
+ CARD32 type B32
+
+#define __GLX_TEXIMAGE_HDR_SIZE 32
+
+#define __GLX_TEXIMAGE_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_TEXIMAGE_HDR_SIZE)
+
+#define __GLX_TEXIMAGE_CMD_DISPATCH_HDR_SIZE \
+ (__GLX_PIXEL_HDR_SIZE + __GLX_TEXIMAGE_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_TEXIMAGE_HDR;
+} __GLXtexImageHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_TEXIMAGE_HDR;
+} __GLXtexImageLargeHeader;
+
+typedef struct {
+ __GLX_PIXEL_HDR;
+ __GLX_TEXIMAGE_HDR;
+} __GLXdispatchTexImageHeader;
+
+/*
+** Data that is specific to a glTexImage3D or glTexImage4D call. The
+** data is sent in the following order:
+** Render or RenderLarge header
+** Pixel 3D header
+** TexImage 3D header
+** When a glTexImage3D call the size4d and woffset fields are unexamined
+** by the server.
+** Could be used by all TexImage commands and perhaps should be in the
+** future.
+*/
+#define __GLX_TEXIMAGE_3D_HDR \
+ CARD32 target B32; \
+ CARD32 level B32; \
+ CARD32 internalformat B32; \
+ CARD32 width B32; \
+ CARD32 height B32; \
+ CARD32 depth B32; \
+ CARD32 size4d B32; \
+ CARD32 border B32; \
+ CARD32 format B32; \
+ CARD32 type B32; \
+ CARD32 nullimage B32
+
+#define __GLX_TEXIMAGE_3D_HDR_SIZE 44
+
+#define __GLX_TEXIMAGE_3D_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_3D_HDR_SIZE + \
+ __GLX_TEXIMAGE_3D_HDR_SIZE)
+
+#define __GLX_TEXIMAGE_3D_CMD_DISPATCH_HDR_SIZE \
+ (__GLX_PIXEL_3D_HDR_SIZE + __GLX_TEXIMAGE_3D_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_PIXEL_3D_HDR;
+ __GLX_TEXIMAGE_3D_HDR;
+} __GLXtexImage3DHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_PIXEL_3D_HDR;
+ __GLX_TEXIMAGE_3D_HDR;
+} __GLXtexImage3DLargeHeader;
+
+typedef struct {
+ __GLX_PIXEL_3D_HDR;
+ __GLX_TEXIMAGE_3D_HDR;
+} __GLXdispatchTexImage3DHeader;
+
+/*
+** Data that is specific to a glTexSubImage1D or glTexSubImage2D call. The
+** data is sent in the following order:
+** Render or RenderLarge header
+** Pixel header
+** TexSubImage header
+** When a glTexSubImage1D call is made, the yoffset and height fields
+** are unexamined by the server and are considered to be padding.
+*/
+#define __GLX_TEXSUBIMAGE_HDR \
+ CARD32 target B32; \
+ CARD32 level B32; \
+ CARD32 xoffset B32; \
+ CARD32 yoffset B32; \
+ CARD32 width B32; \
+ CARD32 height B32; \
+ CARD32 format B32; \
+ CARD32 type B32; \
+ CARD32 nullImage \
+
+#define __GLX_TEXSUBIMAGE_HDR_SIZE 36
+
+#define __GLX_TEXSUBIMAGE_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_TEXSUBIMAGE_HDR_SIZE)
+
+#define __GLX_TEXSUBIMAGE_CMD_DISPATCH_HDR_SIZE \
+ (__GLX_PIXEL_HDR_SIZE + __GLX_TEXSUBIMAGE_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_TEXSUBIMAGE_HDR;
+} __GLXtexSubImageHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_TEXSUBIMAGE_HDR;
+} __GLXtexSubImageLargeHeader;
+
+typedef struct {
+ __GLX_PIXEL_HDR;
+ __GLX_TEXSUBIMAGE_HDR;
+} __GLXdispatchTexSubImageHeader;
+
+/*
+** Data that is specific to a glTexSubImage3D and 4D calls. The
+** data is sent in the following order:
+** Render or RenderLarge header
+** Pixel 3D header
+** TexSubImage 3D header
+** When a glTexSubImage3D call is made, the woffset and size4d fields
+** are unexamined by the server and are considered to be padding.
+*/
+#define __GLX_TEXSUBIMAGE_3D_HDR \
+ CARD32 target B32; \
+ CARD32 level B32; \
+ CARD32 xoffset B32; \
+ CARD32 yoffset B32; \
+ CARD32 zoffset B32; \
+ CARD32 woffset B32; \
+ CARD32 width B32; \
+ CARD32 height B32; \
+ CARD32 depth B32; \
+ CARD32 size4d B32; \
+ CARD32 format B32; \
+ CARD32 type B32; \
+ CARD32 nullImage \
+
+#define __GLX_TEXSUBIMAGE_3D_HDR_SIZE 52
+
+#define __GLX_TEXSUBIMAGE_3D_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_3D_HDR_SIZE + \
+ __GLX_TEXSUBIMAGE_3D_HDR_SIZE)
+
+#define __GLX_TEXSUBIMAGE_3D_CMD_DISPATCH_HDR_SIZE \
+ (__GLX_PIXEL_3D_HDR_SIZE + __GLX_TEXSUBIMAGE_3D_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_PIXEL_3D_HDR;
+ __GLX_TEXSUBIMAGE_3D_HDR;
+} __GLXtexSubImage3DHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_PIXEL_3D_HDR;
+ __GLX_TEXSUBIMAGE_3D_HDR;
+} __GLXtexSubImage3DLargeHeader;
+
+typedef struct {
+ __GLX_PIXEL_3D_HDR;
+ __GLX_TEXSUBIMAGE_3D_HDR;
+} __GLXdispatchTexSubImage3DHeader;
+
+/**
+ * Data that is specific to a \c glCompressedTexImage1D or
+ * \c glCompressedTexImage2D call. The data is sent in the following
+ * order:
+ * - Render or RenderLarge header
+ * - CompressedTexImage header
+ *
+ * When a \c glCompressedTexImage1D call is made, the \c height field is
+ * not examined by the server and is considered padding.
+ */
+
+#define __GLX_COMPRESSED_TEXIMAGE_HDR \
+ CARD32 target B32; \
+ CARD32 level B32; \
+ CARD32 internalFormat B32; \
+ CARD32 width B32; \
+ CARD32 height B32; \
+ CARD32 border B32; \
+ CARD32 imageSize B32
+
+#define __GLX_COMPRESSED_TEXIMAGE_HDR_SIZE 28
+
+#define __GLX_COMPRESSED_TEXIMAGE_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_COMPRESSED_TEXIMAGE_HDR_SIZE)
+
+#define __GLX_COMPRESSED_TEXIMAGE_DISPATCH_HDR_SIZE \
+ (__GLX_COMPRESSED_TEXIMAGE_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_COMPRESSED_TEXIMAGE_HDR;
+} __GLXcompressedTexImageHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_COMPRESSED_TEXIMAGE_HDR;
+} __GLXcompressedTexImageLargeHeader;
+
+typedef struct {
+ __GLX_COMPRESSED_TEXIMAGE_HDR;
+} __GLXdispatchCompressedTexImageHeader;
+
+/**
+ * Data that is specifi to a \c glCompressedTexSubImage1D or
+ * \c glCompressedTexSubImage2D call. The data is sent in the following
+ * order:
+ * - Render or RenderLarge header
+ * - CompressedTexSubImage header
+ *
+ * When a \c glCompressedTexSubImage1D call is made, the \c yoffset and
+ * \c height fields are not examined by the server and are considered padding.
+ */
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_HDR \
+ CARD32 target B32; \
+ CARD32 level B32; \
+ CARD32 xoffset B32; \
+ CARD32 yoffset B32; \
+ CARD32 width B32; \
+ CARD32 height B32; \
+ CARD32 format B32; \
+ CARD32 imageSize B32
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_HDR_SIZE 32
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_COMPRESSED_TEXSUBIMAGE_HDR_SIZE)
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_DISPATCH_HDR_SIZE \
+ (__GLX_COMPRESSED_TEXSUBIMAGE_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_COMPRESSED_TEXSUBIMAGE_HDR;
+} __GLXcompressedTexSubImageHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_COMPRESSED_TEXSUBIMAGE_HDR;
+} __GLXcompressedTexSubImageLargeHeader;
+
+typedef struct {
+ __GLX_COMPRESSED_TEXSUBIMAGE_HDR;
+} __GLXdispatchCompressedTexSubImageHeader;
+
+/**
+ * Data that is specific to a \c glCompressedTexImage3D call. The data is
+ * sent in the following order:
+ * - Render or RenderLarge header
+ * - CompressedTexImage3D header
+ */
+
+#define __GLX_COMPRESSED_TEXIMAGE_3D_HDR \
+ CARD32 target B32; \
+ CARD32 level B32; \
+ CARD32 internalFormat B32; \
+ CARD32 width B32; \
+ CARD32 height B32; \
+ CARD32 depth B32; \
+ CARD32 border B32; \
+ CARD32 imageSize B32
+
+#define __GLX_COMPRESSED_TEXIMAGE_3D_HDR_SIZE 32
+
+#define __GLX_COMPRESSED_TEXIMAGE_3D_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_COMPRESSED_TEXIMAGE_3D_HDR_SIZE)
+
+#define __GLX_COMPRESSED_TEXIMAGE_3D_DISPATCH_HDR_SIZE \
+ (__GLX_COMPRESSED_TEXIMAGE_3D_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_COMPRESSED_TEXIMAGE_3D_HDR;
+} __GLXcompressedTexImage3DHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_COMPRESSED_TEXIMAGE_3D_HDR;
+} __GLXcompressedTexImage3DLargeHeader;
+
+typedef struct {
+ __GLX_COMPRESSED_TEXIMAGE_3D_HDR;
+} __GLXdispatchCompressedTexImage3DHeader;
+
+/**
+ * Data that is specifi to a \c glCompressedTexSubImage3D call. The data is
+ * sent in the following order:
+ * - Render or RenderLarge header
+ * - CompressedTexSubImage3D header
+ */
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR \
+ CARD32 target B32; \
+ CARD32 level B32; \
+ CARD32 xoffset B32; \
+ CARD32 yoffset B32; \
+ CARD32 zoffset B32; \
+ CARD32 width B32; \
+ CARD32 height B32; \
+ CARD32 depth B32; \
+ CARD32 format B32; \
+ CARD32 imageSize B32
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR_SIZE 32
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_3D_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR_SIZE)
+
+#define __GLX_COMPRESSED_TEXSUBIMAGE_3D_DISPATCH_HDR_SIZE \
+ (__GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR;
+} __GLXcompressedTexSubImage3DHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR;
+} __GLXcompressedTexSubImage3DLargeHeader;
+
+typedef struct {
+ __GLX_COMPRESSED_TEXSUBIMAGE_3D_HDR;
+} __GLXdispatchCompressedTexSubImage3DHeader;
+
+/*
+** Data that is specific to a glDrawPixels call. The data is sent in the
+** following order:
+** Render or RenderLarge header
+** Pixel header
+** DrawPixels header
+*/
+#define __GLX_DRAWPIXELS_HDR \
+ CARD32 width B32; \
+ CARD32 height B32; \
+ CARD32 format B32; \
+ CARD32 type B32
+
+#define __GLX_DRAWPIXELS_HDR_SIZE 16
+
+#define __GLX_DRAWPIXELS_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_DRAWPIXELS_HDR_SIZE)
+
+#define __GLX_DRAWPIXELS_CMD_DISPATCH_HDR_SIZE \
+ (__GLX_PIXEL_HDR_SIZE + __GLX_DRAWPIXELS_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_DRAWPIXELS_HDR;
+} __GLXdrawPixelsHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_DRAWPIXELS_HDR;
+} __GLXdrawPixelsLargeHeader;
+
+typedef struct {
+ __GLX_PIXEL_HDR;
+ __GLX_DRAWPIXELS_HDR;
+} __GLXdispatchDrawPixelsHeader;
+
+/*
+** Data that is specific to a glConvolutionFilter1D or glConvolutionFilter2D
+** call. The data is sent in the following order:
+** Render or RenderLarge header
+** Pixel header
+** ConvolutionFilter header
+** When a glConvolutionFilter1D call the height field is unexamined by the server.
+*/
+#define __GLX_CONV_FILT_HDR \
+ CARD32 target B32; \
+ CARD32 internalformat B32; \
+ CARD32 width B32; \
+ CARD32 height B32; \
+ CARD32 format B32; \
+ CARD32 type B32
+
+#define __GLX_CONV_FILT_HDR_SIZE 24
+
+#define __GLX_CONV_FILT_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_CONV_FILT_HDR_SIZE)
+
+#define __GLX_CONV_FILT_CMD_DISPATCH_HDR_SIZE \
+ (__GLX_PIXEL_HDR_SIZE + __GLX_CONV_FILT_HDR_SIZE)
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_CONV_FILT_HDR;
+} __GLXConvolutionFilterHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_CONV_FILT_HDR;
+} __GLXConvolutionFilterLargeHeader;
+
+typedef struct {
+ __GLX_PIXEL_HDR;
+ __GLX_CONV_FILT_HDR;
+} __GLXdispatchConvolutionFilterHeader;
+
+/*
+** Data that is specific to a glDrawArraysEXT call. The data is sent in the
+** following order:
+** Render or RenderLarge header
+** Draw Arrays header
+** a variable number of Component headers
+** vertex data for each component type
+*/
+
+#define __GLX_DRAWARRAYS_HDR \
+ CARD32 numVertexes B32; \
+ CARD32 numComponents B32; \
+ CARD32 primType B32
+
+#define __GLX_DRAWARRAYS_HDR_SIZE 12
+
+#define __GLX_DRAWARRAYS_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_DRAWARRAYS_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_DRAWARRAYS_HDR;
+} __GLXdrawArraysHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_DRAWARRAYS_HDR;
+} __GLXdrawArraysLargeHeader;
+
+typedef struct {
+ __GLX_DRAWARRAYS_HDR;
+} __GLXdispatchDrawArraysHeader;
+
+#define __GLX_COMPONENT_HDR \
+ CARD32 datatype B32; \
+ INT32 numVals B32; \
+ CARD32 component B32
+
+typedef struct {
+ __GLX_COMPONENT_HDR;
+} __GLXdispatchDrawArraysComponentHeader;
+
+#define __GLX_COMPONENT_HDR_SIZE 12
+
+/*
+** Data that is specific to a glColorTable call
+** The data is sent in the following order:
+** Render or RenderLarge header
+** Pixel header
+** ColorTable header
+*/
+
+#define __GLX_COLOR_TABLE_HDR \
+ CARD32 target B32; \
+ CARD32 internalformat B32; \
+ CARD32 width B32; \
+ CARD32 format B32; \
+ CARD32 type B32
+
+#define __GLX_COLOR_TABLE_HDR_SIZE 20
+
+#define __GLX_COLOR_TABLE_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + __GLX_COLOR_TABLE_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_COLOR_TABLE_HDR;
+} __GLXColorTableHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_COLOR_TABLE_HDR;
+} __GLXColorTableLargeHeader;
+
+typedef struct {
+ __GLX_PIXEL_HDR;
+ __GLX_COLOR_TABLE_HDR;
+} __GLXdispatchColorTableHeader;
+
+/*
+** Data that is specific to a glColorSubTable call
+** The data is sent in the following order:
+** Render or RenderLarge header
+** Pixel header
+** ColorTable header
+*/
+
+#define __GLX_COLOR_SUBTABLE_HDR \
+ CARD32 target B32; \
+ CARD32 start B32; \
+ CARD32 count B32; \
+ CARD32 format B32; \
+ CARD32 type B32
+
+#define __GLX_COLOR_SUBTABLE_HDR_SIZE 20
+
+#define __GLX_COLOR_SUBTABLE_CMD_HDR_SIZE \
+ (__GLX_RENDER_HDR_SIZE + __GLX_PIXEL_HDR_SIZE + \
+ __GLX_COLOR_SUBTABLE_HDR_SIZE)
+
+typedef struct {
+ __GLX_RENDER_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_COLOR_SUBTABLE_HDR;
+} __GLXColorSubTableHeader;
+
+typedef struct {
+ __GLX_RENDER_LARGE_HDR;
+ __GLX_PIXEL_HDR;
+ __GLX_COLOR_SUBTABLE_HDR;
+} __GLXColorSubTableLargeHeader;
+
+typedef struct {
+ __GLX_PIXEL_HDR;
+ __GLX_COLOR_SUBTABLE_HDR;
+} __GLXdispatchColorSubTableHeader;
+
+#define GLX_WINDOW_TYPE 1
+#define GLX_PIXMAP_TYPE 2
+#define GLX_VIDEO_SOURCE_TYPE 3
+#define GLX_PBUFFER_TYPE 4
+/* 5 is for DM_PBUFFER */
+#define GLX_GLXWINDOW_TYPE 6
+
+/*****************************************************************************/
+
+/*
+** Restore these definitions back to the typedefs in glx.h
+*/
+#undef GLXContextID
+#undef GLXPixmap
+#undef GLXDrawable
+#undef GLXPbuffer
+#undef GLXWindow
+#undef GLXFBConfigID
+#undef GLXFBConfigIDSGIX
+#undef GLXPbufferSGIX
+
+
+/* Opcodes for GLX commands */
+
+#define X_GLXRender 1
+#define X_GLXRenderLarge 2
+#define X_GLXCreateContext 3
+#define X_GLXDestroyContext 4
+#define X_GLXMakeCurrent 5
+#define X_GLXIsDirect 6
+#define X_GLXQueryVersion 7
+#define X_GLXWaitGL 8
+#define X_GLXWaitX 9
+#define X_GLXCopyContext 10
+#define X_GLXSwapBuffers 11
+#define X_GLXUseXFont 12
+#define X_GLXCreateGLXPixmap 13
+#define X_GLXGetVisualConfigs 14
+#define X_GLXDestroyGLXPixmap 15
+#define X_GLXVendorPrivate 16
+#define X_GLXVendorPrivateWithReply 17
+#define X_GLXQueryExtensionsString 18
+#define X_GLXQueryServerString 19
+#define X_GLXClientInfo 20
+#define X_GLXGetFBConfigs 21
+#define X_GLXCreatePixmap 22
+#define X_GLXDestroyPixmap 23
+#define X_GLXCreateNewContext 24
+#define X_GLXQueryContext 25
+#define X_GLXMakeContextCurrent 26
+#define X_GLXCreatePbuffer 27
+#define X_GLXDestroyPbuffer 28
+#define X_GLXGetDrawableAttributes 29
+#define X_GLXChangeDrawableAttributes 30
+#define X_GLXCreateWindow 31
+#define X_GLXDestroyWindow 32
+#define X_GLXSetClientInfoARB 33
+#define X_GLXCreateContextAtrribsARB 34
+#define X_GLXSetConfigInfo2ARB 35
+
+/* Opcodes for single commands (part of GLX command space) */
+
+#define X_GLsop_NewList 101
+#define X_GLsop_EndList 102
+#define X_GLsop_DeleteLists 103
+#define X_GLsop_GenLists 104
+#define X_GLsop_FeedbackBuffer 105
+#define X_GLsop_SelectBuffer 106
+#define X_GLsop_RenderMode 107
+#define X_GLsop_Finish 108
+#define X_GLsop_Flush 142
+#define X_GLsop_PixelStoref 109
+#define X_GLsop_PixelStorei 110
+#define X_GLsop_ReadPixels 111
+#define X_GLsop_GetBooleanv 112
+#define X_GLsop_GetClipPlane 113
+#define X_GLsop_GetDoublev 114
+#define X_GLsop_GetError 115
+#define X_GLsop_GetFloatv 116
+#define X_GLsop_GetIntegerv 117
+#define X_GLsop_GetLightfv 118
+#define X_GLsop_GetLightiv 119
+#define X_GLsop_GetMapdv 120
+#define X_GLsop_GetMapfv 121
+#define X_GLsop_GetMapiv 122
+#define X_GLsop_GetMaterialfv 123
+#define X_GLsop_GetMaterialiv 124
+#define X_GLsop_GetPixelMapfv 125
+#define X_GLsop_GetPixelMapuiv 126
+#define X_GLsop_GetPixelMapusv 127
+#define X_GLsop_GetPolygonStipple 128
+#define X_GLsop_GetString 129
+#define X_GLsop_GetTexEnvfv 130
+#define X_GLsop_GetTexEnviv 131
+#define X_GLsop_GetTexGendv 132
+#define X_GLsop_GetTexGenfv 133
+#define X_GLsop_GetTexGeniv 134
+#define X_GLsop_GetTexImage 135
+#define X_GLsop_GetTexParameterfv 136
+#define X_GLsop_GetTexParameteriv 137
+#define X_GLsop_GetTexLevelParameterfv 138
+#define X_GLsop_GetTexLevelParameteriv 139
+#define X_GLsop_IsEnabled 140
+#define X_GLsop_IsList 141
+#define X_GLsop_AreTexturesResident 143
+#define X_GLsop_DeleteTextures 144
+#define X_GLsop_GenTextures 145
+#define X_GLsop_IsTexture 146
+#define X_GLsop_GetColorTable 147
+#define X_GLsop_GetColorTableParameterfv 148
+#define X_GLsop_GetColorTableParameteriv 149
+#define X_GLsop_GetConvolutionFilter 150
+#define X_GLsop_GetConvolutionParameterfv 151
+#define X_GLsop_GetConvolutionParameteriv 152
+#define X_GLsop_GetSeparableFilter 153
+#define X_GLsop_GetHistogram 154
+#define X_GLsop_GetHistogramParameterfv 155
+#define X_GLsop_GetHistogramParameteriv 156
+#define X_GLsop_GetMinmax 157
+#define X_GLsop_GetMinmaxParameterfv 158
+#define X_GLsop_GetMinmaxParameteriv 159
+#define X_GLsop_GetCompressedTexImage 160
+
+
+/* Opcodes for rendering commands */
+
+#define X_GLrop_CallList 1
+#define X_GLrop_CallLists 2
+#define X_GLrop_ListBase 3
+#define X_GLrop_Begin 4
+#define X_GLrop_Bitmap 5
+#define X_GLrop_Color3bv 6
+#define X_GLrop_Color3dv 7
+#define X_GLrop_Color3fv 8
+#define X_GLrop_Color3iv 9
+#define X_GLrop_Color3sv 10
+#define X_GLrop_Color3ubv 11
+#define X_GLrop_Color3uiv 12
+#define X_GLrop_Color3usv 13
+#define X_GLrop_Color4bv 14
+#define X_GLrop_Color4dv 15
+#define X_GLrop_Color4fv 16
+#define X_GLrop_Color4iv 17
+#define X_GLrop_Color4sv 18
+#define X_GLrop_Color4ubv 19
+#define X_GLrop_Color4uiv 20
+#define X_GLrop_Color4usv 21
+#define X_GLrop_EdgeFlagv 22
+#define X_GLrop_End 23
+#define X_GLrop_Indexdv 24
+#define X_GLrop_Indexfv 25
+#define X_GLrop_Indexiv 26
+#define X_GLrop_Indexsv 27
+#define X_GLrop_Normal3bv 28
+#define X_GLrop_Normal3dv 29
+#define X_GLrop_Normal3fv 30
+#define X_GLrop_Normal3iv 31
+#define X_GLrop_Normal3sv 32
+#define X_GLrop_RasterPos2dv 33
+#define X_GLrop_RasterPos2fv 34
+#define X_GLrop_RasterPos2iv 35
+#define X_GLrop_RasterPos2sv 36
+#define X_GLrop_RasterPos3dv 37
+#define X_GLrop_RasterPos3fv 38
+#define X_GLrop_RasterPos3iv 39
+#define X_GLrop_RasterPos3sv 40
+#define X_GLrop_RasterPos4dv 41
+#define X_GLrop_RasterPos4fv 42
+#define X_GLrop_RasterPos4iv 43
+#define X_GLrop_RasterPos4sv 44
+#define X_GLrop_Rectdv 45
+#define X_GLrop_Rectfv 46
+#define X_GLrop_Rectiv 47
+#define X_GLrop_Rectsv 48
+#define X_GLrop_TexCoord1dv 49
+#define X_GLrop_TexCoord1fv 50
+#define X_GLrop_TexCoord1iv 51
+#define X_GLrop_TexCoord1sv 52
+#define X_GLrop_TexCoord2dv 53
+#define X_GLrop_TexCoord2fv 54
+#define X_GLrop_TexCoord2iv 55
+#define X_GLrop_TexCoord2sv 56
+#define X_GLrop_TexCoord3dv 57
+#define X_GLrop_TexCoord3fv 58
+#define X_GLrop_TexCoord3iv 59
+#define X_GLrop_TexCoord3sv 60
+#define X_GLrop_TexCoord4dv 61
+#define X_GLrop_TexCoord4fv 62
+#define X_GLrop_TexCoord4iv 63
+#define X_GLrop_TexCoord4sv 64
+#define X_GLrop_Vertex2dv 65
+#define X_GLrop_Vertex2fv 66
+#define X_GLrop_Vertex2iv 67
+#define X_GLrop_Vertex2sv 68
+#define X_GLrop_Vertex3dv 69
+#define X_GLrop_Vertex3fv 70
+#define X_GLrop_Vertex3iv 71
+#define X_GLrop_Vertex3sv 72
+#define X_GLrop_Vertex4dv 73
+#define X_GLrop_Vertex4fv 74
+#define X_GLrop_Vertex4iv 75
+#define X_GLrop_Vertex4sv 76
+#define X_GLrop_ClipPlane 77
+#define X_GLrop_ColorMaterial 78
+#define X_GLrop_CullFace 79
+#define X_GLrop_Fogf 80
+#define X_GLrop_Fogfv 81
+#define X_GLrop_Fogi 82
+#define X_GLrop_Fogiv 83
+#define X_GLrop_FrontFace 84
+#define X_GLrop_Hint 85
+#define X_GLrop_Lightf 86
+#define X_GLrop_Lightfv 87
+#define X_GLrop_Lighti 88
+#define X_GLrop_Lightiv 89
+#define X_GLrop_LightModelf 90
+#define X_GLrop_LightModelfv 91
+#define X_GLrop_LightModeli 92
+#define X_GLrop_LightModeliv 93
+#define X_GLrop_LineStipple 94
+#define X_GLrop_LineWidth 95
+#define X_GLrop_Materialf 96
+#define X_GLrop_Materialfv 97
+#define X_GLrop_Materiali 98
+#define X_GLrop_Materialiv 99
+#define X_GLrop_PointSize 100
+#define X_GLrop_PolygonMode 101
+#define X_GLrop_PolygonStipple 102
+#define X_GLrop_Scissor 103
+#define X_GLrop_ShadeModel 104
+#define X_GLrop_TexParameterf 105
+#define X_GLrop_TexParameterfv 106
+#define X_GLrop_TexParameteri 107
+#define X_GLrop_TexParameteriv 108
+#define X_GLrop_TexImage1D 109
+#define X_GLrop_TexImage2D 110
+#define X_GLrop_TexEnvf 111
+#define X_GLrop_TexEnvfv 112
+#define X_GLrop_TexEnvi 113
+#define X_GLrop_TexEnviv 114
+#define X_GLrop_TexGend 115
+#define X_GLrop_TexGendv 116
+#define X_GLrop_TexGenf 117
+#define X_GLrop_TexGenfv 118
+#define X_GLrop_TexGeni 119
+#define X_GLrop_TexGeniv 120
+#define X_GLrop_InitNames 121
+#define X_GLrop_LoadName 122
+#define X_GLrop_PassThrough 123
+#define X_GLrop_PopName 124
+#define X_GLrop_PushName 125
+#define X_GLrop_DrawBuffer 126
+#define X_GLrop_Clear 127
+#define X_GLrop_ClearAccum 128
+#define X_GLrop_ClearIndex 129
+#define X_GLrop_ClearColor 130
+#define X_GLrop_ClearStencil 131
+#define X_GLrop_ClearDepth 132
+#define X_GLrop_StencilMask 133
+#define X_GLrop_ColorMask 134
+#define X_GLrop_DepthMask 135
+#define X_GLrop_IndexMask 136
+#define X_GLrop_Accum 137
+#define X_GLrop_Disable 138
+#define X_GLrop_Enable 139
+#define X_GLrop_PopAttrib 141
+#define X_GLrop_PushAttrib 142
+#define X_GLrop_Map1d 143
+#define X_GLrop_Map1f 144
+#define X_GLrop_Map2d 145
+#define X_GLrop_Map2f 146
+#define X_GLrop_MapGrid1d 147
+#define X_GLrop_MapGrid1f 148
+#define X_GLrop_MapGrid2d 149
+#define X_GLrop_MapGrid2f 150
+#define X_GLrop_EvalCoord1dv 151
+#define X_GLrop_EvalCoord1fv 152
+#define X_GLrop_EvalCoord2dv 153
+#define X_GLrop_EvalCoord2fv 154
+#define X_GLrop_EvalMesh1 155
+#define X_GLrop_EvalPoint1 156
+#define X_GLrop_EvalMesh2 157
+#define X_GLrop_EvalPoint2 158
+#define X_GLrop_AlphaFunc 159
+#define X_GLrop_BlendFunc 160
+#define X_GLrop_LogicOp 161
+#define X_GLrop_StencilFunc 162
+#define X_GLrop_StencilOp 163
+#define X_GLrop_DepthFunc 164
+#define X_GLrop_PixelZoom 165
+#define X_GLrop_PixelTransferf 166
+#define X_GLrop_PixelTransferi 167
+#define X_GLrop_PixelMapfv 168
+#define X_GLrop_PixelMapuiv 169
+#define X_GLrop_PixelMapusv 170
+#define X_GLrop_ReadBuffer 171
+#define X_GLrop_CopyPixels 172
+#define X_GLrop_DrawPixels 173
+#define X_GLrop_DepthRange 174
+#define X_GLrop_Frustum 175
+#define X_GLrop_LoadIdentity 176
+#define X_GLrop_LoadMatrixf 177
+#define X_GLrop_LoadMatrixd 178
+#define X_GLrop_MatrixMode 179
+#define X_GLrop_MultMatrixf 180
+#define X_GLrop_MultMatrixd 181
+#define X_GLrop_Ortho 182
+#define X_GLrop_PopMatrix 183
+#define X_GLrop_PushMatrix 184
+#define X_GLrop_Rotated 185
+#define X_GLrop_Rotatef 186
+#define X_GLrop_Scaled 187
+#define X_GLrop_Scalef 188
+#define X_GLrop_Translated 189
+#define X_GLrop_Translatef 190
+#define X_GLrop_Viewport 191
+#define X_GLrop_DrawArrays 193
+#define X_GLrop_PolygonOffset 192
+#define X_GLrop_CopyTexImage1D 4119
+#define X_GLrop_CopyTexImage2D 4120
+#define X_GLrop_CopyTexSubImage1D 4121
+#define X_GLrop_CopyTexSubImage2D 4122
+#define X_GLrop_TexSubImage1D 4099
+#define X_GLrop_TexSubImage2D 4100
+#define X_GLrop_BindTexture 4117
+#define X_GLrop_PrioritizeTextures 4118
+#define X_GLrop_Indexubv 194
+#define X_GLrop_BlendColor 4096
+#define X_GLrop_BlendEquation 4097
+#define X_GLrop_ColorTable 2053
+#define X_GLrop_ColorTableParameterfv 2054
+#define X_GLrop_ColorTableParameteriv 2055
+#define X_GLrop_CopyColorTable 2056
+#define X_GLrop_ColorSubTable 195
+#define X_GLrop_CopyColorSubTable 196
+#define X_GLrop_ConvolutionFilter1D 4101
+#define X_GLrop_ConvolutionFilter2D 4102
+#define X_GLrop_ConvolutionParameterf 4103
+#define X_GLrop_ConvolutionParameterfv 4104
+#define X_GLrop_ConvolutionParameteri 4105
+#define X_GLrop_ConvolutionParameteriv 4106
+#define X_GLrop_CopyConvolutionFilter1D 4107
+#define X_GLrop_CopyConvolutionFilter2D 4108
+#define X_GLrop_SeparableFilter2D 4109
+#define X_GLrop_Histogram 4110
+#define X_GLrop_Minmax 4111
+#define X_GLrop_ResetHistogram 4112
+#define X_GLrop_ResetMinmax 4113
+#define X_GLrop_TexImage3D 4114
+#define X_GLrop_TexSubImage3D 4115
+#define X_GLrop_CopyTexSubImage3D 4123
+#define X_GLrop_DrawArraysEXT 4116
+
+/* Added for core GL version 1.3 */
+
+#define X_GLrop_ActiveTextureARB 197
+#define X_GLrop_MultiTexCoord1dvARB 198
+#define X_GLrop_MultiTexCoord1fvARB 199
+#define X_GLrop_MultiTexCoord1ivARB 200
+#define X_GLrop_MultiTexCoord1svARB 201
+#define X_GLrop_MultiTexCoord2dvARB 202
+#define X_GLrop_MultiTexCoord2fvARB 203
+#define X_GLrop_MultiTexCoord2ivARB 204
+#define X_GLrop_MultiTexCoord2svARB 205
+#define X_GLrop_MultiTexCoord3dvARB 206
+#define X_GLrop_MultiTexCoord3fvARB 207
+#define X_GLrop_MultiTexCoord3ivARB 208
+#define X_GLrop_MultiTexCoord3svARB 209
+#define X_GLrop_MultiTexCoord4dvARB 210
+#define X_GLrop_MultiTexCoord4fvARB 211
+#define X_GLrop_MultiTexCoord4ivARB 212
+#define X_GLrop_MultiTexCoord4svARB 213
+#define X_GLrop_CompressedTexImage1D 214
+#define X_GLrop_CompressedTexImage2D 215
+#define X_GLrop_CompressedTexImage3D 216
+#define X_GLrop_CompressedTexSubImage1D 217
+#define X_GLrop_CompressedTexSubImage2D 218
+#define X_GLrop_CompressedTexSubImage3D 219
+#define X_GLrop_SampleCoverageARB 229
+
+/* Added for core GL version 1.4 */
+
+#define X_GLrop_WindowPos3fARB 230
+#define X_GLrop_FogCoordfv 4124
+#define X_GLrop_FogCoorddv 4125
+#define X_GLrop_PointParameterfARB 2065
+#define X_GLrop_PointParameterfvARB 2066
+#define X_GLrop_SecondaryColor3bv 4126
+#define X_GLrop_SecondaryColor3sv 4127
+#define X_GLrop_SecondaryColor3iv 4128
+#define X_GLrop_SecondaryColor3fv 4129
+#define X_GLrop_SecondaryColor3dv 4130
+#define X_GLrop_SecondaryColor3ubv 4131
+#define X_GLrop_SecondaryColor3usv 4132
+#define X_GLrop_SecondaryColor3uiv 4133
+#define X_GLrop_BlendFuncSeparate 4134
+#define X_GLrop_PointParameteri 4221
+#define X_GLrop_PointParameteriv 4222
+
+/* Added for core GL version 1.5 */
+/* XXX opcodes not defined in the spec */
+
+/* Opcodes for Vendor Private commands */
+
+
+#define X_GLvop_GetConvolutionFilterEXT 1
+#define X_GLvop_GetConvolutionParameterfvEXT 2
+#define X_GLvop_GetConvolutionParameterivEXT 3
+#define X_GLvop_GetSeparableFilterEXT 4
+#define X_GLvop_GetHistogramEXT 5
+#define X_GLvop_GetHistogramParameterfvEXT 6
+#define X_GLvop_GetHistogramParameterivEXT 7
+#define X_GLvop_GetMinmaxEXT 8
+#define X_GLvop_GetMinmaxParameterfvEXT 9
+#define X_GLvop_GetMinmaxParameterivEXT 10
+#define X_GLvop_AreTexturesResidentEXT 11
+#define X_GLvop_DeleteTexturesEXT 12
+#define X_GLvop_GenTexturesEXT 13
+#define X_GLvop_IsTextureEXT 14
+#define X_GLvop_GetCombinerInputParameterfvNV 1270
+#define X_GLvop_GetCombinerInputParameterivNV 1271
+#define X_GLvop_GetCombinerOutputParameterfvNV 1272
+#define X_GLvop_GetCombinerOutputParameterivNV 1273
+#define X_GLvop_GetFinalCombinerOutputParameterfvNV 1274
+#define X_GLvop_GetFinalCombinerOutputParameterivNV 1275
+#define X_GLvop_DeleteFenceNV 1276
+#define X_GLvop_GenFencesNV 1277
+#define X_GLvop_IsFenceNV 1278
+#define X_GLvop_TestFenceNV 1279
+#define X_GLvop_GetFenceivNV 1280
+#define X_GLvop_AreProgramsResidentNV 1293
+#define X_GLvop_DeleteProgramARB 1294
+#define X_GLvop_GenProgramsARB 1295
+#define X_GLvop_GetProgramEnvParameterfvARB 1296
+#define X_GLvop_GetProgramEnvParameterdvARB 1297
+#define X_GLvop_GetProgramEnvParameterivNV 1298
+#define X_GLvop_GetProgramStringNV 1299
+#define X_GLvop_GetTrackMatrixivNV 1300
+#define X_GLvop_GetVertexAttribdvARB 1301
+#define X_GLvop_GetVertexAttribfvARB 1302
+#define X_GLvop_GetVertexAttribivARB 1303
+#define X_GLvop_IsProgramARB 1304
+#define X_GLvop_GetProgramLocalParameterfvARB 1305
+#define X_GLvop_GetProgramLocalParameterdvARB 1306
+#define X_GLvop_GetProgramivARB 1307
+#define X_GLvop_GetProgramStringARB 1308
+#define X_GLvop_GetProgramNamedParameter4fvNV 1310
+#define X_GLvop_GetProgramNamedParameter4dvNV 1311
+#define X_GLvop_SampleMaskSGIS 2048
+#define X_GLvop_SamplePatternSGIS 2049
+#define X_GLvop_GetDetailTexFuncSGIS 4096
+#define X_GLvop_GetSharpenTexFuncSGIS 4097
+#define X_GLvop_GetColorTableSGI 4098
+#define X_GLvop_GetColorTableParameterfvSGI 4099
+#define X_GLvop_GetColorTableParameterivSGI 4100
+#define X_GLvop_GetTexFilterFuncSGIS 4101
+#define X_GLvop_GetInstrumentsSGIX 4102
+#define X_GLvop_InstrumentsBufferSGIX 4103
+#define X_GLvop_PollInstrumentsSGIX 4104
+#define X_GLvop_FlushRasterSGIX 4105
+
+/* Opcodes for GLX vendor private commands */
+
+#define X_GLXvop_QueryContextInfoEXT 1024
+#define X_GLXvop_BindTexImageEXT 1330
+#define X_GLXvop_ReleaseTexImageEXT 1331
+#define X_GLXvop_SwapIntervalSGI 65536
+#define X_GLXvop_MakeCurrentReadSGI 65537
+#define X_GLXvop_CreateGLXVideoSourceSGIX 65538
+#define X_GLXvop_DestroyGLXVideoSourceSGIX 65539
+#define X_GLXvop_GetFBConfigsSGIX 65540
+#define X_GLXvop_CreateContextWithConfigSGIX 65541
+#define X_GLXvop_CreateGLXPixmapWithConfigSGIX 65542
+#define X_GLXvop_CreateGLXPbufferSGIX 65543
+#define X_GLXvop_DestroyGLXPbufferSGIX 65544
+#define X_GLXvop_ChangeDrawableAttributesSGIX 65545
+#define X_GLXvop_GetDrawableAttributesSGIX 65546
+#define X_GLXvop_JoinSwapGroupSGIX 65547
+#define X_GLXvop_BindSwapBarrierSGIX 65548
+#define X_GLXvop_QueryMaxSwapBarriersSGIX 65549
+#define X_GLXvop_QueryHyperpipeNetworkSGIX 65550
+#define X_GLXvop_QueryHyperpipeConfigSGIX 65551
+#define X_GLXvop_HyperpipeConfigSGIX 65552
+#define X_GLXvop_DestroyHyperpipeConfigSGIX 65553
+
+/* ARB extension opcodes */
+
+/* 1. GL_ARB_multitexture - see GL 1.2 opcodes */
+/* 5. GL_ARB_multisample - see GL 1.3 opcodes */
+/* 12. GL_ARB_texture_compression - see GL 1.3 opcodes */
+/* 14. GL_ARB_point_parameters - see GL 1.4 opcodees */
+
+/* 15. GL_ARB_vertex_blend */
+#define X_GLrop_WeightbvARB 220
+#define X_GLrop_WeightubvARB 221
+#define X_GLrop_WeightsvARB 222
+#define X_GLrop_WeightusvARB 223
+#define X_GLrop_WeightivARB 224
+#define X_GLrop_WeightuivARB 225
+#define X_GLrop_VertexBlendARB 226
+#define X_GLrop_WeightfvARB 227
+#define X_GLrop_WeightdvARB 228
+
+/* 16. GL_ARB_matrix_palette */
+/* XXX opcodes not defined in the spec */
+
+/* 25. GL_ARB_window_pos - see GL 1.4 opcodes */
+
+/* 26. GL_ARB_vertex_program */
+#define X_GLrop_BindProgramARB 4180
+#define X_GLrop_ProgramEnvParameter4fvARB 4184
+#define X_GLrop_ProgramEnvParameter4dvARB 4185
+#define X_GLrop_VertexAttrib1svARB 4189
+#define X_GLrop_VertexAttrib2svARB 4190
+#define X_GLrop_VertexAttrib3svARB 4191
+#define X_GLrop_VertexAttrib4svARB 4192
+#define X_GLrop_VertexAttrib1fvARB 4193
+#define X_GLrop_VertexAttrib2fvARB 4194
+#define X_GLrop_VertexAttrib3fvARB 4195
+#define X_GLrop_VertexAttrib4fvARB 4196
+#define X_GLrop_VertexAttrib1dvARB 4197
+#define X_GLrop_VertexAttrib2dvARB 4198
+#define X_GLrop_VertexAttrib3dvARB 4199
+#define X_GLrop_ProgramLocalParameter4fvARB 4215
+#define X_GLrop_ProgramLocalParameter4dvARB 4216
+#define X_GLrop_ProgramStringARB 4217
+#define X_GLrop_VertexAttrib4dvARB 4200
+#define X_GLrop_VertexAttrib4NubvARB 4201
+#define X_GLrop_VertexAttrib4bvARB 4230
+#define X_GLrop_VertexAttrib4ivARB 4231
+#define X_GLrop_VertexAttrib4ubvARB 4232
+#define X_GLrop_VertexAttrib4usvARB 4233
+#define X_GLrop_VertexAttrib4uivARB 4234
+#define X_GLrop_VertexAttrib4NbvARB 4235
+#define X_GLrop_VertexAttrib4NsvARB 4236
+#define X_GLrop_VertexAttrib4NivARB 4237
+#define X_GLrop_VertexAttrib4NusvARB 4238
+#define X_GLrop_VertexAttrib4NuivARB 4239
+
+/* 27. GL_ARB_fragment_program - see GL_ARB_vertex_program opcodes */
+
+/* 29. GL_ARB_occlusion_query */
+/* XXX opcodes not defined in the spec */
+
+
+/* New extension opcodes */
+
+/* 145. GL_EXT_secondary_color - see GL 1.4 opcodes */
+
+/* 188. GL_EXT_vertex_weighting */
+#define X_GLrop_VertexWeightfvEXT 4135
+
+/* 191. GL_NV_register_combiners */
+#define X_GLrop_CombinerParameterfNV 4136
+#define X_GLrop_CombinerParameterfvNV 4137
+#define X_GLrop_CombinerParameteriNV 4138
+#define X_GLrop_CombinerParameterivNV 4139
+#define X_GLrop_CombinerInputNV 4140
+#define X_GLrop_CombinerOutputNV 4141
+#define X_GLrop_FinalCombinerInputNV 4142
+
+/* 222. GL_NV_fence */
+#define X_GLrop_SetFenceNV 4143
+#define X_GLrop_FinishFenceNV 4144
+
+/* 227. GL_NV_register_combiners2 */
+/* XXX opcodes not defined in the spec */
+
+/* 233. GL_NV_vertex_program - see also GL_ARB_vertex_program opcodes */
+#define X_GLrop_ExecuteProgramNV 4181
+#define X_GLrop_RequestResidentProgramsNV 4182
+#define X_GLrop_LoadProgamNV 4183
+#define X_GLrop_ProgramParameters4fvNV 4186
+#define X_GLrop_ProgramParameters4dvNV 4187
+#define X_GLrop_TrackMatrixNV 4188
+#define X_GLrop_VertexAttribs1svNV 4202
+#define X_GLrop_VertexAttribs2svNV 4203
+#define X_GLrop_VertexAttribs3svNV 4204
+#define X_GLrop_VertexAttribs4svNV 4205
+#define X_GLrop_VertexAttribs1fvNV 4206
+#define X_GLrop_VertexAttribs2fvNV 4207
+#define X_GLrop_VertexAttribs3fvNV 4208
+#define X_GLrop_VertexAttribs4fvNV 4209
+#define X_GLrop_VertexAttribs1dvNV 4210
+#define X_GLrop_VertexAttribs2dvNV 4211
+#define X_GLrop_VertexAttribs3dvNV 4212
+#define X_GLrop_VertexAttribs4dvNV 4213
+#define X_GLrop_VertexAttribs4ubvNV 4214
+
+/* 261. GL_NV_occlusion_query */
+/* XXX opcodes not defined in the spec */
+
+/* 262. GL_NV_point_sprite - see GL 1.4 opcodes */
+
+/* 268. GL_EXT_stencil_two_side */
+#define X_GLrop_ActiveStencilFaceEXT 4220
+
+/* 282. GL_NV_fragment_program - see also GL_NV_vertex_program and GL_ARB_vertex_program opcodes */
+#define X_GLrop_ProgramNamedParameter4fvNV 4218
+#define X_GLrop_ProgramNamedParameter4dvNV 4219
+
+/* 285. GL_NV_primitive_restart */
+/* XXX opcodes not defined in the spec */
+
+/* 297. GL_EXT_depth_bounds_test */
+#define X_GLrop_DepthBoundsEXT 4229
+
+/* 299. GL_EXT_blend_equation_separate */
+#define X_GLrop_BlendEquationSeparateEXT 4228
+
+/* 310. GL_EXT_framebuffer_object */
+#define X_GLvop_IsRenderbufferEXT 1422
+#define X_GLvop_GenRenderbuffersEXT 1423
+#define X_GLvop_GetRenderbufferParameterivEXT 1424
+#define X_GLvop_IsFramebufferEXT 1425
+#define X_GLvop_GenFramebuffersEXT 1426
+#define X_GLvop_CheckFramebufferStatusEXT 1427
+#define X_GLvop_GetFramebufferAttachmentParameterivEXT 1428
+
+#endif /* _GLX_glxproto_h_ */
diff --git a/libX11/src/FSWrap.c b/libX11/src/FSWrap.c
index 45a2c34e3..910e602f4 100644
--- a/libX11/src/FSWrap.c
+++ b/libX11/src/FSWrap.c
@@ -130,7 +130,7 @@ copy_string_list(
char **string_list_ret, **list_src, **list_dst, *dst;
int length, count;
- if (string_list == NULL || list_count == 0)
+ if (string_list == NULL || list_count <= 0)
return (char **) NULL;
string_list_ret = (char **) Xmalloc(sizeof(char *) * list_count);
diff --git a/libxcb/xcb-proto/src/glx.xml b/libxcb/xcb-proto/src/glx.xml
index 544b543a1..53c926737 100644
--- a/libxcb/xcb-proto/src/glx.xml
+++ b/libxcb/xcb-proto/src/glx.xml
@@ -89,6 +89,7 @@ The patch that fixed this server bug in X.org CVS is here:
<errorcopy name="BadPbuffer" number="10" ref="Generic" />
<errorcopy name="BadCurrentDrawable" number="11" ref="Generic" />
<errorcopy name="BadWindow" number="12" ref="Generic" />
+ <errorcopy name="GLXBadProfileARB" number="13" ref="Generic" />
<!-- Events -->
<event name="PbufferClobber" number="0">
@@ -348,7 +349,7 @@ The patch that fixed this server bug in X.org CVS is here:
<request name="CreatePixmap" opcode="22">
<field type="CARD32" name="screen" />
- <field type="CARD32" name="fbconfig" />
+ <field type="FBCONFIG" name="fbconfig" />
<field type="xproto:PIXMAP" name="pixmap" />
<field type="glx:PIXMAP" name="glx_pixmap" />
<field type="CARD32" name="num_attribs" />
@@ -366,13 +367,12 @@ The patch that fixed this server bug in X.org CVS is here:
<request name="CreateNewContext" opcode="24">
<field type="glx:CONTEXT" name="context" />
- <field type="CARD32" name="fbconfig" />
+ <field type="FBCONFIG" name="fbconfig" />
<field type="CARD32" name="screen" />
<field type="CARD32" name="render_type" />
- <field type="CARD32" name="share_list" />
+ <field type="glx:CONTEXT" name="share_list" />
<field type="BOOL" name="is_direct" />
- <field type="CARD8" name="reserved1" />
- <field type="CARD16" name="reserved2" />
+ <pad bytes="3" />
</request>
<request name="QueryContext" opcode="25">
@@ -463,6 +463,64 @@ The patch that fixed this server bug in X.org CVS is here:
<field type="glx:WINDOW" name="glxwindow" />
</request>
+ <!-- Start of GLX_ARB_create_context and GLX_ARB_create_context_profile
+ requests. -->
+ <request name="SetClientInfoARB" opcode="33">
+ <field type="CARD32" name="major_version" />
+ <field type="CARD32" name="minor_version" />
+ <field type="CARD32" name="num_versions" />
+ <field type="CARD32" name="gl_str_len" />
+ <field type="CARD32" name="glx_str_len" />
+ <list type="CARD32" name="gl_versions">
+ <op op="*">
+ <fieldref>num_versions</fieldref>
+ <value>2</value>
+ </op>
+ </list>
+ <list type="char" name="gl_extension_string">
+ <fieldref>gl_str_len</fieldref>
+ </list>
+ <list type="char" name="glx_extension_string">
+ <fieldref>glx_str_len</fieldref>
+ </list>
+ </request>
+
+ <request name="CreateContextAttribsARB" opcode="34">
+ <field type="glx:CONTEXT" name="context" />
+ <field type="FBCONFIG" name="fbconfig" />
+ <field type="CARD32" name="screen" />
+ <field type="glx:CONTEXT" name="share_list" />
+ <field type="BOOL" name="is_direct" />
+ <pad bytes="3" />
+ <field type="CARD32" name="num_attribs" />
+ <list type="CARD32" name="attribs">
+ <op op="*">
+ <fieldref>num_attribs</fieldref>
+ <value>2</value>
+ </op>
+ </list>
+ </request>
+
+ <request name="SetClientInfo2ARB" opcode="35">
+ <field type="CARD32" name="major_version" />
+ <field type="CARD32" name="minor_version" />
+ <field type="CARD32" name="num_versions" />
+ <field type="CARD32" name="gl_str_len" />
+ <field type="CARD32" name="glx_str_len" />
+ <list type="CARD32" name="gl_versions">
+ <op op="*">
+ <fieldref>num_versions</fieldref>
+ <value>3</value>
+ </op>
+ </list>
+ <list type="char" name="gl_extension_string">
+ <fieldref>gl_str_len</fieldref>
+ </list>
+ <list type="char" name="glx_extension_string">
+ <fieldref>glx_str_len</fieldref>
+ </list>
+ </request>
+
<!-- Requests for GL Non-rendering Commands (single ops) -->
<request name="NewList" opcode="101">
diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h
index 33b00c680..fc494f748 100644
--- a/mesalib/src/mesa/main/mtypes.h
+++ b/mesalib/src/mesa/main/mtypes.h
@@ -3051,6 +3051,7 @@ struct gl_matrix_stack
#define _NEW_PROGRAM_CONSTANTS (1 << 27)
#define _NEW_BUFFER_OBJECT (1 << 28)
#define _NEW_FRAG_CLAMP (1 << 29)
+#define _NEW_TRANSFORM_FEEDBACK (1 << 30) /**< gl_context::TransformFeedback */
#define _NEW_ALL ~0
/*@}*/
diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c
index 99905de3a..8a002b675 100644
--- a/mesalib/src/mesa/main/teximage.c
+++ b/mesalib/src/mesa/main/teximage.c
@@ -1636,7 +1636,8 @@ texture_error_check( struct gl_context *ctx,
/* additional checks for depth textures */
if (_mesa_base_tex_format(ctx, internalFormat) == GL_DEPTH_COMPONENT) {
- /* Only 1D, 2D, rect and array textures supported, not 3D or cubes */
+ /* Only 1D, 2D, rect, array and cube textures supported, not 3D
+ * Cubemaps are only supported for GL version > 3.0 or with EXT_gpu_shader4 */
if (target != GL_TEXTURE_1D &&
target != GL_PROXY_TEXTURE_1D &&
target != GL_TEXTURE_2D &&
@@ -1646,7 +1647,9 @@ texture_error_check( struct gl_context *ctx,
target != GL_TEXTURE_2D_ARRAY &&
target != GL_PROXY_TEXTURE_2D_ARRAY &&
target != GL_TEXTURE_RECTANGLE_ARB &&
- target != GL_PROXY_TEXTURE_RECTANGLE_ARB) {
+ target != GL_PROXY_TEXTURE_RECTANGLE_ARB &&
+ !((_mesa_is_cube_face(target) || target == GL_PROXY_TEXTURE_CUBE_MAP) &&
+ (ctx->VersionMajor >= 3 || ctx->Extensions.EXT_gpu_shader4))) {
if (!isProxy)
_mesa_error(ctx, GL_INVALID_ENUM,
"glTexImage(target/internalFormat)");
diff --git a/mesalib/src/mesa/main/transformfeedback.c b/mesalib/src/mesa/main/transformfeedback.c
index 11abd037d..799245d4e 100644
--- a/mesalib/src/mesa/main/transformfeedback.c
+++ b/mesalib/src/mesa/main/transformfeedback.c
@@ -376,6 +376,7 @@ _mesa_BeginTransformFeedback(GLenum mode)
return;
}
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM_FEEDBACK);
obj->Active = GL_TRUE;
ctx->TransformFeedback.Mode = mode;
@@ -398,6 +399,7 @@ _mesa_EndTransformFeedback(void)
return;
}
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM_FEEDBACK);
ctx->TransformFeedback.CurrentObject->Active = GL_FALSE;
assert(ctx->Driver.EndTransformFeedback);
@@ -415,6 +417,7 @@ bind_buffer_range(struct gl_context *ctx, GLuint index,
{
struct gl_transform_feedback_object *obj =
ctx->TransformFeedback.CurrentObject;
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM_FEEDBACK);
/* The general binding point */
_mesa_reference_buffer_object(ctx,
@@ -650,7 +653,9 @@ _mesa_TransformFeedbackVaryings(GLuint program, GLsizei count,
shProg->TransformFeedback.BufferMode = bufferMode;
- /* The varyings won't be used until shader link time */
+ /* No need to set _NEW_TRANSFORM_FEEDBACK (or invoke FLUSH_VERTICES) since
+ * the varyings won't be used until shader link time.
+ */
}
@@ -874,6 +879,7 @@ _mesa_PauseTransformFeedback(void)
return;
}
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM_FEEDBACK);
obj->Paused = GL_TRUE;
assert(ctx->Driver.PauseTransformFeedback);
@@ -899,6 +905,7 @@ _mesa_ResumeTransformFeedback(void)
return;
}
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM_FEEDBACK);
obj->Paused = GL_FALSE;
assert(ctx->Driver.ResumeTransformFeedback);
diff --git a/mesalib/src/mesa/swrast/s_texfilter.c b/mesalib/src/mesa/swrast/s_texfilter.c
index fb172f3a8..21b55a801 100644
--- a/mesalib/src/mesa/swrast/s_texfilter.c
+++ b/mesalib/src/mesa/swrast/s_texfilter.c
@@ -3437,7 +3437,8 @@ sample_depth_texture( struct gl_context *ctx,
tObj->Target == GL_TEXTURE_2D ||
tObj->Target == GL_TEXTURE_RECTANGLE_NV ||
tObj->Target == GL_TEXTURE_1D_ARRAY_EXT ||
- tObj->Target == GL_TEXTURE_2D_ARRAY_EXT);
+ tObj->Target == GL_TEXTURE_2D_ARRAY_EXT ||
+ tObj->Target == GL_TEXTURE_CUBE_MAP);
ambient = tObj->Sampler.CompareFailValue;
@@ -3684,7 +3685,10 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx,
return &sample_nearest_3d;
}
case GL_TEXTURE_CUBE_MAP:
- if (needLambda) {
+ if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) {
+ return &sample_depth_texture;
+ }
+ else if (needLambda) {
return &sample_lambda_cube;
}
else if (t->Sampler.MinFilter == GL_LINEAR) {
@@ -3709,7 +3713,10 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx,
return &sample_nearest_rect;
}
case GL_TEXTURE_1D_ARRAY_EXT:
- if (needLambda) {
+ if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) {
+ return &sample_depth_texture;
+ }
+ else if (needLambda) {
return &sample_lambda_1d_array;
}
else if (t->Sampler.MinFilter == GL_LINEAR) {
@@ -3720,7 +3727,10 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx,
return &sample_nearest_1d_array;
}
case GL_TEXTURE_2D_ARRAY_EXT:
- if (needLambda) {
+ if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) {
+ return &sample_depth_texture;
+ }
+ else if (needLambda) {
return &sample_lambda_2d_array;
}
else if (t->Sampler.MinFilter == GL_LINEAR) {
diff --git a/xkbcomp/compat.c b/xkbcomp/compat.c
index 759535a38..2b0014244 100644
--- a/xkbcomp/compat.c
+++ b/xkbcomp/compat.c
@@ -50,6 +50,7 @@ typedef struct _GroupCompatInfo
{
unsigned char fileID;
unsigned char merge;
+ Bool defined;
unsigned char real_mods;
unsigned short vmods;
} GroupCompatInfo;
@@ -280,8 +281,8 @@ AddGroupCompat(CompatInfo * info, unsigned group, GroupCompatInfo * newGC)
ACTION1("Using %s definition\n",
(merge == MergeAugment ? "old" : "new"));
}
- if (merge != MergeAugment)
- *gc = *newGC;
+ if(newGC->defined && (merge != MergeAugment || !gc->defined))
+ *gc = *newGC;
return True;
}
@@ -715,6 +716,7 @@ HandleGroupCompatDef(GroupCompatDef * def,
}
tmp.real_mods = val.uval & 0xff;
tmp.vmods = (val.uval >> 8) & 0xffff;
+ tmp.defined = True;
return AddGroupCompat(info, def->group - 1, &tmp);
}
diff --git a/xorg-server/Xext/saver.c b/xorg-server/Xext/saver.c
index 142758c87..18d5e468d 100644
--- a/xorg-server/Xext/saver.c
+++ b/xorg-server/Xext/saver.c
@@ -925,7 +925,7 @@ ScreenSaverSetAttributes (ClientPtr client)
goto bail;
}
/* over allocate for override redirect */
- values = malloc((len + 1) * sizeof (unsigned long));
+ pAttr->values = values = malloc((len + 1) * sizeof (unsigned long));
if (!values)
{
ret = BadAlloc;
@@ -945,7 +945,6 @@ ScreenSaverSetAttributes (ClientPtr client)
pAttr->pCursor = NullCursor;
pAttr->pBackgroundPixmap = NullPixmap;
pAttr->pBorderPixmap = NullPixmap;
- pAttr->values = values;
/*
* go through the mask, checking the values,
* looking up pixmaps and cursors and hold a reference
diff --git a/xorg-server/Xext/xvdisp.c b/xorg-server/Xext/xvdisp.c
index 364a90cf2..0795a1475 100644
--- a/xorg-server/Xext/xvdisp.c
+++ b/xorg-server/Xext/xvdisp.c
@@ -1238,7 +1238,7 @@ ProcXvDispatch(ClientPtr client)
UpdateCurrentTime();
- if (stuff->data > xvNumRequests) {
+ if (stuff->data >= xvNumRequests) {
SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest);
return BadRequest;
}
@@ -1542,7 +1542,7 @@ SProcXvDispatch(ClientPtr client)
UpdateCurrentTime();
- if (stuff->data > xvNumRequests) {
+ if (stuff->data >= xvNumRequests) {
SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest);
return BadRequest;
}
diff --git a/xorg-server/Xi/extinit.c b/xorg-server/Xi/extinit.c
index a2c807b46..b43f9bbc0 100644
--- a/xorg-server/Xi/extinit.c
+++ b/xorg-server/Xi/extinit.c
@@ -409,7 +409,7 @@ static int
ProcIDispatch(ClientPtr client)
{
REQUEST(xReq);
- if (stuff->data > ARRAY_SIZE(ProcIVector) || !ProcIVector[stuff->data])
+ if (stuff->data >= ARRAY_SIZE(ProcIVector) || !ProcIVector[stuff->data])
return BadRequest;
return (*ProcIVector[stuff->data])(client);
@@ -428,7 +428,7 @@ static int
SProcIDispatch(ClientPtr client)
{
REQUEST(xReq);
- if (stuff->data > ARRAY_SIZE(SProcIVector) || !SProcIVector[stuff->data])
+ if (stuff->data >= ARRAY_SIZE(SProcIVector) || !SProcIVector[stuff->data])
return BadRequest;
return (*SProcIVector[stuff->data])(client);
diff --git a/xorg-server/config/hal.c b/xorg-server/config/hal.c
index aa234ebb4..088c9939d 100644
--- a/xorg-server/config/hal.c
+++ b/xorg-server/config/hal.c
@@ -348,6 +348,7 @@ device_added(LibHalContext *hal_ctx, const char *udi)
if (!strcasecmp(tmp, ".options") && (!xkb_opts.options))
xkb_opts.options = strdup(tmp_val);
}
+ free(tmp_val);
}
}
}
diff --git a/xorg-server/configure.ac b/xorg-server/configure.ac
index e4fcba4a5..27bf7dbb2 100644
--- a/xorg-server/configure.ac
+++ b/xorg-server/configure.ac
@@ -25,7 +25,7 @@ dnl an unwitting cast of miscellaneous others
dnl
dnl Process this file with autoconf to create configure.
-AC_PREREQ(2.57)
+AC_PREREQ(2.60)
AC_INIT([xorg-server], 1.11.99.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
RELEASE_DATE="2011-11-20"
AC_CONFIG_SRCDIR([Makefile.am])
@@ -76,7 +76,6 @@ AC_PROG_LN_S
AC_LIBTOOL_WIN32_DLL
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
-AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG
AC_PROG_LEX
AC_PROG_YACC
@@ -213,34 +212,14 @@ AC_CHECK_FUNC([dlopen], [],
AC_SUBST(DLOPEN_LIBS)
dnl Checks for library functions.
-AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr \
- strtol getopt getopt_long vsnprintf walkcontext backtrace \
- getisax getzoneid shmctl64 strcasestr ffs vasprintf])
-AC_FUNC_ALLOCA
-AC_CHECK_FUNCS([strndup], [HAVE_STRNDUP=yes], [HAVE_STRNDUP=no])
-AM_CONDITIONAL(NEED_STRNDUP, [test x$HAVE_STRNDUP = xno])
-dnl Old HAS_* names used in os/*.c.
-AC_CHECK_FUNC([getdtablesize],
- AC_DEFINE(HAS_GETDTABLESIZE, 1, [Have the 'getdtablesize' function.]))
-AC_CHECK_FUNC([getifaddrs],
- AC_DEFINE(HAS_GETIFADDRS, 1, [Have the 'getifaddrs' function.]))
-AC_CHECK_FUNC([getpeereid],
- AC_DEFINE(HAS_GETPEEREID, 1, [Have the 'getpeereid' function.]))
-AC_CHECK_FUNC([getpeerucred],
- AC_DEFINE(HAS_GETPEERUCRED, 1, [Have the 'getpeerucred' function.]))
-AC_CHECK_FUNC([strlcat], HAVE_STRLCAT=yes, HAVE_STRLCAT=no)
-AM_CONDITIONAL(NEED_STRLCAT, [test x$HAVE_STRLCAT = xno])
-AC_CHECK_FUNC([strlcpy], AC_DEFINE(HAS_STRLCPY, 1, [Have the 'strlcpy' function]))
-
-AM_CONDITIONAL(NEED_VSNPRINTF, [test x$HAVE_VSNPRINTF = xno])
-
-dnl Check for mmap support for Xvfb
-AC_CHECK_FUNC([mmap], AC_DEFINE(HAS_MMAP, 1, [Have the 'mmap' function.]))
-
-dnl Find the math libary
+AC_CHECK_FUNCS([backtrace ffs \
+ getdtablesize getifaddrs getpeereid getpeerucred getzoneid \
+ mmap shmctl64 strncasecmp vasprintf vsnprintf walkcontext])
+AC_REPLACE_FUNCS([strcasecmp strcasestr strlcat strlcpy strndup])
+
+dnl Find the math libary, then check for cbrt function in it.
AC_CHECK_LIB(m, sqrt)
-AC_CHECK_LIB(m, cbrt, AC_DEFINE(HAVE_CBRT, 1, [Have the 'cbrt' function]))
+AC_CHECK_FUNCS([cbrt])
AC_CHECK_HEADERS([ndbm.h dbm.h rpcsvc/dbm.h])
@@ -1241,13 +1220,6 @@ XKB_LIB='$(top_builddir)/xkb/libxkb.la'
XKB_STUB_LIB='$(top_builddir)/xkb/libxkbstubs.la'
REQUIRED_MODULES="$REQUIRED_MODULES xkbfile"
-AC_CHECK_FUNC(strcasecmp, [], AC_DEFINE([NEED_STRCASECMP], 1,
- [Do not have 'strcasecmp'.]))
-AC_CHECK_FUNC(strncasecmp, [], AC_DEFINE([NEED_STRNCASECMP], 1,
- [Do not have 'strncasecmp'.]))
-AC_CHECK_FUNC(strcasestr, [], AC_DEFINE([NEED_STRCASESTR], 1,
- [Do not have 'strcasestr'.]))
-
PKG_CHECK_MODULES([XDMCP], [xdmcp], [have_libxdmcp="yes"], [have_libxdmcp="no"])
if test "x$have_libxdmcp" = xyes; then
AC_CHECK_LIB(Xdmcp, XdmcpWrap, [have_xdmcpwrap="yes"], [have_xdmcpwrap="no"], [$XDMCP_LIBS])
@@ -1558,7 +1530,8 @@ if test "x$XORG" = xyes; then
fi
if test x$have_visibility != xno; then
save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
+ proto_inc=`$PKG_CONFIG --cflags xproto`
+ CFLAGS="$CFLAGS $VISIBILITY_CFLAGS $proto_inc"
AC_TRY_COMPILE(
[#include <X11/Xfuncproto.h>
extern _X_HIDDEN int hidden_int;
diff --git a/xorg-server/hw/dmx/config/Makefile.am b/xorg-server/hw/dmx/config/Makefile.am
index 75181436e..06588e7a1 100644
--- a/xorg-server/hw/dmx/config/Makefile.am
+++ b/xorg-server/hw/dmx/config/Makefile.am
@@ -21,10 +21,7 @@ BUILT_SOURCES = parser.c parser.h scanner.c
MAINTAINERCLEANFILES = $(BUILT_SOURCES)
libdmxconfig_a_SOURCES = $(LIBSRCS)
-
-if NEED_STRLCAT
libdmxconfig_a_SOURCES += $(top_srcdir)/os/strlcpy.c
-endif
if GLX
GLX_DEFS = @GL_CFLAGS@
diff --git a/xorg-server/hw/kdrive/ephyr/hostx.c b/xorg-server/hw/kdrive/ephyr/hostx.c
index 47a6681c4..ebe4e52ed 100644
--- a/xorg-server/hw/kdrive/ephyr/hostx.c
+++ b/xorg-server/hw/kdrive/ephyr/hostx.c
@@ -332,6 +332,11 @@ hostx_set_title (char *title)
ephyrTitle = title;
}
+#ifdef __SUNPRO_C
+/* prevent "Function has no return statement" error for x_io_error_handler */
+#pragma does_not_return(exit)
+#endif
+
static int _X_NORETURN
x_io_error_handler (Display *dpy) {
ErrorF("Lost connection to X server: %s\n", strerror(errno));
diff --git a/xorg-server/hw/kdrive/src/kinput.c b/xorg-server/hw/kdrive/src/kinput.c
index 9c0b34fe1..968ebb159 100644
--- a/xorg-server/hw/kdrive/src/kinput.c
+++ b/xorg-server/hw/kdrive/src/kinput.c
@@ -2146,12 +2146,6 @@ KdCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
static void
KdCrossScreen(ScreenPtr pScreen, Bool entering)
{
-#ifndef XIPAQ
- if (entering)
- KdEnableScreen (pScreen);
- else
- KdDisableScreen (pScreen);
-#endif
}
int KdCurScreen; /* current event screen */
diff --git a/xorg-server/hw/vfb/InitOutput.c b/xorg-server/hw/vfb/InitOutput.c
index 3e5d05100..e1af5a471 100644
--- a/xorg-server/hw/vfb/InitOutput.c
+++ b/xorg-server/hw/vfb/InitOutput.c
@@ -48,12 +48,12 @@ from The Open Group.
#include "mipointer.h"
#include "micmap.h"
#include <sys/types.h>
-#ifdef HAS_MMAP
+#ifdef HAVE_MMAP
#include <sys/mman.h>
#ifndef MAP_FILE
#define MAP_FILE 0
#endif
-#endif /* HAS_MMAP */
+#endif /* HAVE_MMAP */
#include <sys/stat.h>
#include <errno.h>
#ifndef WIN32
@@ -93,7 +93,7 @@ typedef struct
unsigned int lineBias;
CloseScreenProcPtr closeScreen;
-#ifdef HAS_MMAP
+#ifdef HAVE_MMAP
int mmap_fd;
char mmap_file[MAXPATHLEN];
#endif
@@ -114,7 +114,7 @@ static vfbScreenInfo defaultScreenInfo = {
.lineBias = VFB_DEFAULT_LINEBIAS,
};
static Bool vfbPixmapDepths[33];
-#ifdef HAS_MMAP
+#ifdef HAVE_MMAP
static char *pfbdir = NULL;
#endif
typedef enum { NORMAL_MEMORY_FB, SHARED_MEMORY_FB, MMAPPED_FILE_FB } fbMemType;
@@ -158,7 +158,7 @@ ddxGiveUp(enum ExitCode error)
switch (fbmemtype)
{
-#ifdef HAS_MMAP
+#ifdef HAVE_MMAP
case MMAPPED_FILE_FB:
for (i = 0; i < vfbNumScreens; i++)
{
@@ -170,10 +170,10 @@ ddxGiveUp(enum ExitCode error)
}
}
break;
-#else /* HAS_MMAP */
+#else /* HAVE_MMAP */
case MMAPPED_FILE_FB:
break;
-#endif /* HAS_MMAP */
+#endif /* HAVE_MMAP */
#ifdef HAS_SHM
case SHARED_MEMORY_FB:
@@ -241,7 +241,7 @@ ddxUseMsg(void)
ErrorF("-blackpixel n pixel value for black\n");
ErrorF("-whitepixel n pixel value for white\n");
-#ifdef HAS_MMAP
+#ifdef HAVE_MMAP
ErrorF("-fbdir directory put framebuffers in mmap'ed files in directory\n");
#endif
@@ -280,7 +280,9 @@ ddxProcessArgument(int argc, char *argv[], int i)
int screenNum;
CHECK_FOR_REQUIRED_ARGUMENTS(2);
screenNum = atoi(argv[i+1]);
- if (screenNum < 0)
+ /* The protocol only has a CARD8 for number of screens in the
+ connection setup block, so don't allow more than that. */
+ if ((screenNum < 0) || (screenNum >= 255))
{
ErrorF("Invalid screen number %d\n", screenNum);
UseMsg();
@@ -368,7 +370,7 @@ ddxProcessArgument(int argc, char *argv[], int i)
return 2;
}
-#ifdef HAS_MMAP
+#ifdef HAVE_MMAP
if (strcmp (argv[i], "-fbdir") == 0) /* -fbdir directory */
{
CHECK_FOR_REQUIRED_ARGUMENTS(1);
@@ -376,7 +378,7 @@ ddxProcessArgument(int argc, char *argv[], int i)
fbmemtype = MMAPPED_FILE_FB;
return 2;
}
-#endif /* HAS_MMAP */
+#endif /* HAVE_MMAP */
#ifdef HAS_SHM
if (strcmp (argv[i], "-shmem") == 0) /* -shmem */
@@ -521,7 +523,7 @@ vfbSaveScreen(ScreenPtr pScreen, int on)
return TRUE;
}
-#ifdef HAS_MMAP
+#ifdef HAVE_MMAP
/* this flushes any changes to the screens out to the mmapped file */
static void
@@ -606,7 +608,7 @@ vfbAllocateMmappedFramebuffer(vfbScreenInfoPtr pvfb)
pvfb->pXWDHeader = NULL;
}
}
-#endif /* HAS_MMAP */
+#endif /* HAVE_MMAP */
#ifdef HAS_SHM
@@ -670,7 +672,7 @@ vfbAllocateFramebufferMemory(vfbScreenInfoPtr pvfb)
pvfb->pXWDHeader = NULL;
switch (fbmemtype)
{
-#ifdef HAS_MMAP
+#ifdef HAVE_MMAP
case MMAPPED_FILE_FB: vfbAllocateMmappedFramebuffer(pvfb); break;
#else
case MMAPPED_FILE_FB: break;
diff --git a/xorg-server/hw/xfree86/fbdevhw/fbdevhw.c b/xorg-server/hw/xfree86/fbdevhw/fbdevhw.c
index 2019741b2..309fa654a 100644
--- a/xorg-server/hw/xfree86/fbdevhw/fbdevhw.c
+++ b/xorg-server/hw/xfree86/fbdevhw/fbdevhw.c
@@ -506,20 +506,22 @@ fbdevHWSetVideoModes(ScrnInfoPtr pScrn)
pScrn->virtualY = pScrn->display->virtualY;
for (modename = pScrn->display->modes; *modename != NULL; modename++) {
- for (mode = pScrn->monitor->Modes; mode != NULL; mode = mode->next)
- if (0 == strcmp(mode->name,*modename))
- break;
+ for (mode = pScrn->monitor->Modes; mode != NULL; mode = mode->next) {
+ if (0 == strcmp(mode->name,*modename)) {
+ if (fbdevHWSetMode(pScrn, mode, TRUE))
+ break;
+
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "\tmode \"%s\" test failed\n", *modename);
+ }
+ }
+
if (NULL == mode) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"\tmode \"%s\" not found\n", *modename);
continue;
}
- if (!fbdevHWSetMode(pScrn, mode, TRUE)) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "\tmode \"%s\" test failed\n", *modename);
- continue;
- }
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"\tmode \"%s\" ok\n", *modename);
diff --git a/xorg-server/hw/xfree86/loader/loadmod.c b/xorg-server/hw/xfree86/loader/loadmod.c
index c697d74ed..5b9f8d1c3 100644
--- a/xorg-server/hw/xfree86/loader/loadmod.c
+++ b/xorg-server/hw/xfree86/loader/loadmod.c
@@ -911,7 +911,7 @@ doLoadModule(const char *module, const char *path, const char **subdirlist,
goto LoadModule_fail;
}
ret->handle = LoaderOpen(found, errmaj, errmin);
- if (ret->handle < 0)
+ if (ret->handle == NULL)
goto LoadModule_fail;
ret->path = strdup(found);
diff --git a/xorg-server/hw/xfree86/parser/scan.c b/xorg-server/hw/xfree86/parser/scan.c
index 9099227bb..156bc299a 100644
--- a/xorg-server/hw/xfree86/parser/scan.c
+++ b/xorg-server/hw/xfree86/parser/scan.c
@@ -852,6 +852,10 @@ OpenConfigDir(const char *path, const char *cmdline, const char *projroot,
/* match files named *.conf */
num = scandir(dirpath, &list, ConfigFilter, alphasort);
+ if (num < 0) {
+ list = NULL;
+ num = 0;
+ }
found = AddConfigDirFiles(dirpath, list, num);
if (!found) {
free(dirpath);
diff --git a/xorg-server/hw/xfree86/xaa/xaaGC.c b/xorg-server/hw/xfree86/xaa/xaaGC.c
index f9c1070f9..1bc35d9f3 100644
--- a/xorg-server/hw/xfree86/xaa/xaaGC.c
+++ b/xorg-server/hw/xfree86/xaa/xaaGC.c
@@ -1,649 +1,650 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <string.h>
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "migc.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "xaawrap.h"
-
-static void XAAValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDraw);
-static void XAAChangeGC(GCPtr pGC, unsigned long mask);
-static void XAACopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
-static void XAADestroyGC(GCPtr pGC);
-static void XAAChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects);
-static void XAADestroyClip(GCPtr pGC);
-static void XAACopyClip(GCPtr pgcDst, GCPtr pgcSrc);
-
-GCFuncs XAAGCFuncs = {
- XAAValidateGC, XAAChangeGC, XAACopyGC, XAADestroyGC,
- XAAChangeClip, XAADestroyClip, XAACopyClip
-};
-
-extern GCOps XAAPixmapOps;
-
-Bool
-XAACreateGC(GCPtr pGC)
-{
- ScreenPtr pScreen = pGC->pScreen;
- XAAGCPtr pGCPriv = (XAAGCPtr)dixLookupPrivate(&pGC->devPrivates,
- XAAGetGCKey());
- Bool ret;
-
- XAA_SCREEN_PROLOGUE(pScreen,CreateGC);
-
- if((ret = (*pScreen->CreateGC)(pGC))) {
- pGCPriv->wrapOps = NULL;
- pGCPriv->wrapFuncs = pGC->funcs;
- pGCPriv->XAAOps = &XAAFallbackOps;
- pGC->funcs = &XAAGCFuncs;
- }
-
- XAA_SCREEN_EPILOGUE(pScreen,CreateGC,XAACreateGC);
-
- return ret;
-}
-
-
-static void
-XAAValidateGC(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- XAA_GC_FUNC_PROLOGUE(pGC);
-
- (*pGC->funcs->ValidateGC)(pGC, changes, pDraw);
-
- if((changes & GCPlaneMask) &&
- ((pGC->planemask & infoRec->FullPlanemasks[pGC->depth - 1]) ==
- infoRec->FullPlanemasks[pGC->depth - 1]))
- {
- pGC->planemask = ~0;
- }
-
- if(pGC->depth != 32) {
- /* 0xffffffff is reserved for transparency */
- if(pGC->bgPixel == 0xffffffff)
- pGC->bgPixel = 0x7fffffff;
- if(pGC->fgPixel == 0xffffffff)
- pGC->fgPixel = 0x7fffffff;
- }
-
- if((pDraw->type == DRAWABLE_PIXMAP) && !IS_OFFSCREEN_PIXMAP(pDraw)){
- pGCPriv->flags = OPS_ARE_PIXMAP;
- pGCPriv->changes |= changes;
-
- /* make sure we're not using videomemory pixmaps to render
- onto system memory drawables */
-
- if((pGC->fillStyle == FillTiled) &&
- IS_OFFSCREEN_PIXMAP(pGC->tile.pixmap) &&
- !OFFSCREEN_PIXMAP_LOCKED(pGC->tile.pixmap)) {
-
- XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
- FBAreaPtr area = pPriv->offscreenArea;
-
- XAARemoveAreaCallback(area); /* clobbers pPriv->offscreenArea */
- xf86FreeOffscreenArea(area);
- }
- }
- else if(!infoRec->pScrn->vtSema && (pDraw->type == DRAWABLE_WINDOW)) {
- pGCPriv->flags = 0;
- pGCPriv->changes |= changes;
- }
- else {
- if(!(pGCPriv->flags & OPS_ARE_ACCEL)) {
- changes |= pGCPriv->changes;
- pGCPriv->changes = 0;
- }
- pGCPriv->flags = OPS_ARE_ACCEL;
-
-#if 1
- /* Ugh. If we can't use the blitter on offscreen pixmaps used
- as tiles, then we need to move them out as cfb can't handle
- tiles with non-zero origins */
-
- if((pGC->fillStyle == FillTiled) &&
- IS_OFFSCREEN_PIXMAP(pGC->tile.pixmap) &&
- (DO_PIXMAP_COPY != (*infoRec->TiledFillChooser)(pGC))) {
-
- XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
- FBAreaPtr area = pPriv->offscreenArea;
-
- XAARemoveAreaCallback(area); /* clobbers pPriv->offscreenArea */
- xf86FreeOffscreenArea(area);
- }
-#endif
- }
-
- XAA_GC_FUNC_EPILOGUE(pGC);
-
- if(!(pGCPriv->flags & OPS_ARE_ACCEL)) return;
-
- if((changes & GCTile) && !pGC->tileIsPixel && pGC->tile.pixmap){
- XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
-
- if(pixPriv->flags & DIRTY) {
- pixPriv->flags &= ~(DIRTY | REDUCIBILITY_MASK);
- pGC->tile.pixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- }
- }
- if((changes & GCStipple) && pGC->stipple){
- XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
-
- if(pixPriv->flags & DIRTY) {
- pixPriv->flags &= ~(DIRTY | REDUCIBILITY_MASK);
- pGC->stipple->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- }
- }
-
- /* If our Ops are still the default ones we need to allocate new ones */
- if(pGC->ops == &XAAFallbackOps) {
- if(!(pGCPriv->XAAOps = malloc(sizeof(GCOps)))) {
- pGCPriv->XAAOps = &XAAFallbackOps;
- return;
- }
- /* make a modifiable copy of the default ops */
- memcpy(pGCPriv->XAAOps, &XAAFallbackOps, sizeof(GCOps));
- pGC->ops = pGCPriv->XAAOps;
- changes = ~0;
- }
-
- if(!changes) return;
-
- if((changes & GCDashList) && infoRec->ComputeDash)
- infoRec->ComputeDash(pGC);
-
- if(changes & infoRec->FillSpansMask)
- (*infoRec->ValidateFillSpans)(pGC, changes, pDraw);
-
- if(changes & infoRec->SetSpansMask)
- (*infoRec->ValidateSetSpans)(pGC, changes, pDraw);
-
- if(changes & infoRec->PutImageMask)
- (*infoRec->ValidatePutImage)(pGC, changes, pDraw);
-
- if(changes & infoRec->CopyAreaMask)
- (*infoRec->ValidateCopyArea)(pGC, changes, pDraw);
-
- if(changes & infoRec->CopyPlaneMask)
- (*infoRec->ValidateCopyPlane)(pGC, changes, pDraw);
-
- if(changes & infoRec->PolyPointMask)
- (*infoRec->ValidatePolyPoint)(pGC, changes, pDraw);
-
- if(changes & infoRec->PolylinesMask)
- (*infoRec->ValidatePolylines)(pGC, changes, pDraw);
-
- if(changes & infoRec->PolySegmentMask)
- (*infoRec->ValidatePolySegment)(pGC, changes, pDraw);
-
- if(changes & infoRec->PolyRectangleMask)
- (*infoRec->ValidatePolyRectangle)(pGC, changes, pDraw);
-
- if(changes & infoRec->PolyArcMask)
- (*infoRec->ValidatePolyArc)(pGC, changes, pDraw);
-
- if(changes & infoRec->FillPolygonMask)
- (*infoRec->ValidateFillPolygon)(pGC, changes, pDraw);
-
- if(changes & infoRec->PolyFillRectMask)
- (*infoRec->ValidatePolyFillRect)(pGC, changes, pDraw);
-
- if(changes & infoRec->PolyFillArcMask)
- (*infoRec->ValidatePolyFillArc)(pGC, changes, pDraw);
-
- if(changes & infoRec->PolyGlyphBltMask)
- (*infoRec->ValidatePolyGlyphBlt)(pGC, changes, pDraw);
-
- if(changes & infoRec->ImageGlyphBltMask)
- (*infoRec->ValidateImageGlyphBlt)(pGC, changes, pDraw);
-
- if(changes & infoRec->PolyText8Mask)
- (*infoRec->ValidatePolyText8)(pGC, changes, pDraw);
-
- if(changes & infoRec->PolyText16Mask)
- (*infoRec->ValidatePolyText16)(pGC, changes, pDraw);
-
- if(changes & infoRec->ImageText8Mask)
- (*infoRec->ValidateImageText8)(pGC, changes, pDraw);
-
- if(changes & infoRec->ImageText16Mask)
- (*infoRec->ValidateImageText16)(pGC, changes, pDraw);
-
- if(changes & infoRec->PushPixelsMask)
- (*infoRec->ValidatePushPixels)(pGC, changes, pDraw);
-}
-
-
-static void
-XAADestroyGC(GCPtr pGC)
-{
- XAA_GC_FUNC_PROLOGUE (pGC);
-
- if(pGCPriv->XAAOps != &XAAFallbackOps)
- free(pGCPriv->XAAOps);
-
- free(pGCPriv->DashPattern);
-
- (*pGC->funcs->DestroyGC)(pGC);
- XAA_GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-XAAChangeGC (
- GCPtr pGC,
- unsigned long mask
-)
-{
- XAA_GC_FUNC_PROLOGUE (pGC);
- (*pGC->funcs->ChangeGC) (pGC, mask);
- XAA_GC_FUNC_EPILOGUE (pGC);
-
- /* we have to assume that shared memory pixmaps are dirty
- because we can't wrap all operations on them */
-
- if((mask & GCTile) && !pGC->tileIsPixel &&
- PIXMAP_IS_SHARED(pGC->tile.pixmap))
- {
- XAAPixmapPtr pPixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
- pPixPriv->flags |= DIRTY;
- }
-
- if((mask & GCStipple) && PIXMAP_IS_SHARED(pGC->stipple)){
- XAAPixmapPtr pPixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
- pPixPriv->flags |= DIRTY;
- }
-}
-
-static void
-XAACopyGC (
- GCPtr pGCSrc,
- unsigned long mask,
- GCPtr pGCDst)
-{
- XAA_GC_FUNC_PROLOGUE (pGCDst);
- (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
- XAA_GC_FUNC_EPILOGUE (pGCDst);
-}
-static void
-XAAChangeClip (
- GCPtr pGC,
- int type,
- pointer pvalue,
- int nrects )
-{
- XAA_GC_FUNC_PROLOGUE (pGC);
- (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
- XAA_GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-XAACopyClip(GCPtr pgcDst, GCPtr pgcSrc)
-{
- XAA_GC_FUNC_PROLOGUE (pgcDst);
- (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
- XAA_GC_FUNC_EPILOGUE (pgcDst);
-}
-
-static void
-XAADestroyClip(GCPtr pGC)
-{
- XAA_GC_FUNC_PROLOGUE (pGC);
- (* pGC->funcs->DestroyClip)(pGC);
- XAA_GC_FUNC_EPILOGUE (pGC);
-}
-
-/**** Pixmap Wrappers ****/
-
-
-
-static void
-XAAFillSpansPixmap(
- DrawablePtr pDraw,
- GC *pGC,
- int nInit,
- DDXPointPtr pptInit,
- int *pwidthInit,
- int fSorted
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAASetSpansPixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- char *pcharsrc,
- register DDXPointPtr ppt,
- int *pwidth,
- int nspans,
- int fSorted
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPutImagePixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int depth,
- int x, int y, int w, int h,
- int leftPad,
- int format,
- char *pImage
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
- leftPad, format, pImage);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static RegionPtr
-XAACopyAreaPixmap(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GC *pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- RegionPtr ret;
-
- if(infoRec->pScrn->vtSema &&
- ((pSrc->type == DRAWABLE_WINDOW) || IS_OFFSCREEN_PIXMAP(pSrc)))
- {
- if(infoRec->ReadPixmap && (pGC->alu == GXcopy) &&
- (pSrc->bitsPerPixel == pDst->bitsPerPixel) &&
- ((pGC->planemask & infoRec->FullPlanemasks[pSrc->depth - 1])
- == infoRec->FullPlanemasks[pSrc->depth - 1]))
- {
- XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pDst));
- pixPriv->flags |= DIRTY;
-
- return (XAABitBlt( pSrc, pDst, pGC,
- srcx, srcy, width, height, dstx, dsty,
- XAADoImageRead, 0L));
- } else
- if(infoRec->NeedToSync) {
- (*infoRec->Sync)(infoRec->pScrn);
- infoRec->NeedToSync = FALSE;
- }
- }
-
- {
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDst);
- ret = (*pGC->ops->CopyArea)(pSrc, pDst,
- pGC, srcx, srcy, width, height, dstx, dsty);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
- }
- return ret;
-}
-
-static RegionPtr
-XAACopyPlanePixmap(
- DrawablePtr pSrc,
- DrawablePtr pDst,
- GCPtr pGC,
- int srcx, int srcy,
- int width, int height,
- int dstx, int dsty,
- unsigned long bitPlane
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- RegionPtr ret;
-
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDst);
-
- if(infoRec->pScrn->vtSema &&
- ((pSrc->type == DRAWABLE_WINDOW) || IS_OFFSCREEN_PIXMAP(pSrc))){
- if(infoRec->NeedToSync) {
- (*infoRec->Sync)(infoRec->pScrn);
- infoRec->NeedToSync = FALSE;
- }
- }
-
- ret = (*pGC->ops->CopyPlane)(pSrc, pDst,
- pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
- return ret;
-}
-
-static void
-XAAPolyPointPixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int mode,
- int npt,
- xPoint *pptInit
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-
-static void
-XAAPolylinesPixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int mode,
- int npt,
- DDXPointPtr pptInit
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolySegmentPixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nseg,
- xSegment *pSeg
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolyRectanglePixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nRectsInit,
- xRectangle *pRectsInit
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolyArcPixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int narcs,
- xArc *parcs
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAFillPolygonPixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int shape,
- int mode,
- int count,
- DDXPointPtr ptsIn
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-
-static void
-XAAPolyFillRectPixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int nrectFill,
- xRectangle *prectInit
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-
-static void
-XAAPolyFillArcPixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int narcs,
- xArc *parcs
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static int
-XAAPolyText8Pixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars
-){
- int ret;
-
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
- return ret;
-}
-
-static int
-XAAPolyText16Pixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *chars
-){
- int ret;
-
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
- return ret;
-}
-
-static void
-XAAImageText8Pixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-static void
-XAAImageText16Pixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *chars
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-
-static void
-XAAImageGlyphBltPixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph,
- ppci, pglyphBase);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPolyGlyphBltPixmap(
- DrawablePtr pDraw,
- GCPtr pGC,
- int xInit, int yInit,
- unsigned int nglyph,
- CharInfoPtr *ppci,
- pointer pglyphBase
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph,
- ppci, pglyphBase);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-static void
-XAAPushPixelsPixmap(
- GCPtr pGC,
- PixmapPtr pBitMap,
- DrawablePtr pDraw,
- int dx, int dy, int xOrg, int yOrg
-){
- XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
- (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
- XAA_PIXMAP_OP_EPILOGUE(pGC);
-}
-
-GCOps XAAPixmapOps = {
- XAAFillSpansPixmap, XAASetSpansPixmap,
- XAAPutImagePixmap, XAACopyAreaPixmap,
- XAACopyPlanePixmap, XAAPolyPointPixmap,
- XAAPolylinesPixmap, XAAPolySegmentPixmap,
- XAAPolyRectanglePixmap, XAAPolyArcPixmap,
- XAAFillPolygonPixmap, XAAPolyFillRectPixmap,
- XAAPolyFillArcPixmap, XAAPolyText8Pixmap,
- XAAPolyText16Pixmap, XAAImageText8Pixmap,
- XAAImageText16Pixmap, XAAImageGlyphBltPixmap,
- XAAPolyGlyphBltPixmap, XAAPushPixelsPixmap,
-};
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <string.h>
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_OSproc.h"
+
+#include <X11/X.h>
+#include "scrnintstr.h"
+#include "xf86str.h"
+#include "xaa.h"
+#include "xaalocal.h"
+#include "migc.h"
+#include "gcstruct.h"
+#include "pixmapstr.h"
+#include "xaawrap.h"
+
+static void XAAValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDraw);
+static void XAAChangeGC(GCPtr pGC, unsigned long mask);
+static void XAACopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
+static void XAADestroyGC(GCPtr pGC);
+static void XAAChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects);
+static void XAADestroyClip(GCPtr pGC);
+static void XAACopyClip(GCPtr pgcDst, GCPtr pgcSrc);
+
+GCFuncs XAAGCFuncs = {
+ XAAValidateGC, XAAChangeGC, XAACopyGC, XAADestroyGC,
+ XAAChangeClip, XAADestroyClip, XAACopyClip
+};
+
+extern GCOps XAAPixmapOps;
+
+Bool
+XAACreateGC(GCPtr pGC)
+{
+ ScreenPtr pScreen = pGC->pScreen;
+ XAAGCPtr pGCPriv = (XAAGCPtr)dixLookupPrivate(&pGC->devPrivates,
+ XAAGetGCKey());
+ Bool ret;
+
+ XAA_SCREEN_PROLOGUE(pScreen,CreateGC);
+
+ if((ret = (*pScreen->CreateGC)(pGC))) {
+ pGCPriv->wrapOps = NULL;
+ pGCPriv->wrapFuncs = pGC->funcs;
+ pGCPriv->XAAOps = &XAAFallbackOps;
+ pGC->funcs = &XAAGCFuncs;
+ }
+
+ XAA_SCREEN_EPILOGUE(pScreen,CreateGC,XAACreateGC);
+
+ return ret;
+}
+
+
+static void
+XAAValidateGC(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ XAA_GC_FUNC_PROLOGUE(pGC);
+
+ (*pGC->funcs->ValidateGC)(pGC, changes, pDraw);
+
+ if((changes & GCPlaneMask) &&
+ ((pGC->planemask & infoRec->FullPlanemasks[pGC->depth - 1]) ==
+ infoRec->FullPlanemasks[pGC->depth - 1]))
+ {
+ pGC->planemask = ~0;
+ }
+
+ if(pGC->depth != 32) {
+ /* 0xffffffff is reserved for transparency */
+ if(pGC->bgPixel == 0xffffffff)
+ pGC->bgPixel = 0x7fffffff;
+ if(pGC->fgPixel == 0xffffffff)
+ pGC->fgPixel = 0x7fffffff;
+ }
+
+ if((pDraw->type == DRAWABLE_PIXMAP) && !IS_OFFSCREEN_PIXMAP(pDraw)){
+ pGCPriv->flags = OPS_ARE_PIXMAP;
+ pGCPriv->changes |= changes;
+
+ /* make sure we're not using videomemory pixmaps to render
+ onto system memory drawables */
+
+ if((pGC->fillStyle == FillTiled) &&
+ IS_OFFSCREEN_PIXMAP(pGC->tile.pixmap) &&
+ !OFFSCREEN_PIXMAP_LOCKED(pGC->tile.pixmap)) {
+
+ XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
+ FBAreaPtr area = pPriv->offscreenArea;
+
+ XAARemoveAreaCallback(area); /* clobbers pPriv->offscreenArea */
+ xf86FreeOffscreenArea(area);
+ }
+ }
+ else if(!infoRec->pScrn->vtSema && (pDraw->type == DRAWABLE_WINDOW)) {
+ pGCPriv->flags = 0;
+ pGCPriv->changes |= changes;
+ }
+ else {
+ if(!(pGCPriv->flags & OPS_ARE_ACCEL)) {
+ changes |= pGCPriv->changes;
+ pGCPriv->changes = 0;
+ }
+ pGCPriv->flags = OPS_ARE_ACCEL;
+
+#if 1
+ /* Ugh. If we can't use the blitter on offscreen pixmaps used
+ as tiles, then we need to move them out as cfb can't handle
+ tiles with non-zero origins */
+
+ if((pGC->fillStyle == FillTiled) &&
+ IS_OFFSCREEN_PIXMAP(pGC->tile.pixmap) &&
+ (DO_PIXMAP_COPY != (*infoRec->TiledFillChooser)(pGC))) {
+
+ XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
+ FBAreaPtr area = pPriv->offscreenArea;
+
+ XAARemoveAreaCallback(area); /* clobbers pPriv->offscreenArea */
+ xf86FreeOffscreenArea(area);
+ }
+#endif
+ }
+
+ XAA_GC_FUNC_EPILOGUE(pGC);
+
+ if(!(pGCPriv->flags & OPS_ARE_ACCEL)) return;
+
+ if((changes & GCTile) && !pGC->tileIsPixel && pGC->tile.pixmap){
+ XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
+
+ if(pixPriv->flags & DIRTY) {
+ pixPriv->flags &= ~(DIRTY | REDUCIBILITY_MASK);
+ pGC->tile.pixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+ }
+ }
+ if((changes & GCStipple) && pGC->stipple){
+ XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
+
+ if(pixPriv->flags & DIRTY) {
+ pixPriv->flags &= ~(DIRTY | REDUCIBILITY_MASK);
+ pGC->stipple->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+ }
+ }
+
+ /* If our Ops are still the default ones we need to allocate new ones */
+ if(pGC->ops == &XAAFallbackOps) {
+ if(!(pGCPriv->XAAOps = malloc(sizeof(GCOps)))) {
+ pGCPriv->XAAOps = &XAAFallbackOps;
+ return;
+ }
+ /* make a modifiable copy of the default ops */
+ memcpy(pGCPriv->XAAOps, &XAAFallbackOps, sizeof(GCOps));
+ pGC->ops = pGCPriv->XAAOps;
+ changes = ~0;
+ }
+
+ if(!changes) return;
+
+ if((changes & GCDashList) && infoRec->ComputeDash)
+ infoRec->ComputeDash(pGC);
+
+ if(changes & infoRec->FillSpansMask)
+ (*infoRec->ValidateFillSpans)(pGC, changes, pDraw);
+
+ if(changes & infoRec->SetSpansMask)
+ (*infoRec->ValidateSetSpans)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PutImageMask)
+ (*infoRec->ValidatePutImage)(pGC, changes, pDraw);
+
+ if(changes & infoRec->CopyAreaMask)
+ (*infoRec->ValidateCopyArea)(pGC, changes, pDraw);
+
+ if(changes & infoRec->CopyPlaneMask)
+ (*infoRec->ValidateCopyPlane)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PolyPointMask)
+ (*infoRec->ValidatePolyPoint)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PolylinesMask)
+ (*infoRec->ValidatePolylines)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PolySegmentMask)
+ (*infoRec->ValidatePolySegment)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PolyRectangleMask)
+ (*infoRec->ValidatePolyRectangle)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PolyArcMask)
+ (*infoRec->ValidatePolyArc)(pGC, changes, pDraw);
+
+ if(changes & infoRec->FillPolygonMask)
+ (*infoRec->ValidateFillPolygon)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PolyFillRectMask)
+ (*infoRec->ValidatePolyFillRect)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PolyFillArcMask)
+ (*infoRec->ValidatePolyFillArc)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PolyGlyphBltMask)
+ (*infoRec->ValidatePolyGlyphBlt)(pGC, changes, pDraw);
+
+ if(changes & infoRec->ImageGlyphBltMask)
+ (*infoRec->ValidateImageGlyphBlt)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PolyText8Mask)
+ (*infoRec->ValidatePolyText8)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PolyText16Mask)
+ (*infoRec->ValidatePolyText16)(pGC, changes, pDraw);
+
+ if(changes & infoRec->ImageText8Mask)
+ (*infoRec->ValidateImageText8)(pGC, changes, pDraw);
+
+ if(changes & infoRec->ImageText16Mask)
+ (*infoRec->ValidateImageText16)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PushPixelsMask)
+ (*infoRec->ValidatePushPixels)(pGC, changes, pDraw);
+}
+
+
+static void
+XAADestroyGC(GCPtr pGC)
+{
+ XAA_GC_FUNC_PROLOGUE (pGC);
+
+ if(pGCPriv->XAAOps != &XAAFallbackOps)
+ free(pGCPriv->XAAOps);
+
+ free(pGCPriv->DashPattern);
+ pGCPriv->flags = 0;
+
+ (*pGC->funcs->DestroyGC)(pGC);
+ XAA_GC_FUNC_EPILOGUE (pGC);
+}
+
+static void
+XAAChangeGC (
+ GCPtr pGC,
+ unsigned long mask
+)
+{
+ XAA_GC_FUNC_PROLOGUE (pGC);
+ (*pGC->funcs->ChangeGC) (pGC, mask);
+ XAA_GC_FUNC_EPILOGUE (pGC);
+
+ /* we have to assume that shared memory pixmaps are dirty
+ because we can't wrap all operations on them */
+
+ if((mask & GCTile) && !pGC->tileIsPixel &&
+ PIXMAP_IS_SHARED(pGC->tile.pixmap))
+ {
+ XAAPixmapPtr pPixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
+ pPixPriv->flags |= DIRTY;
+ }
+
+ if((mask & GCStipple) && PIXMAP_IS_SHARED(pGC->stipple)){
+ XAAPixmapPtr pPixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
+ pPixPriv->flags |= DIRTY;
+ }
+}
+
+static void
+XAACopyGC (
+ GCPtr pGCSrc,
+ unsigned long mask,
+ GCPtr pGCDst)
+{
+ XAA_GC_FUNC_PROLOGUE (pGCDst);
+ (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
+ XAA_GC_FUNC_EPILOGUE (pGCDst);
+}
+static void
+XAAChangeClip (
+ GCPtr pGC,
+ int type,
+ pointer pvalue,
+ int nrects )
+{
+ XAA_GC_FUNC_PROLOGUE (pGC);
+ (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
+ XAA_GC_FUNC_EPILOGUE (pGC);
+}
+
+static void
+XAACopyClip(GCPtr pgcDst, GCPtr pgcSrc)
+{
+ XAA_GC_FUNC_PROLOGUE (pgcDst);
+ (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
+ XAA_GC_FUNC_EPILOGUE (pgcDst);
+}
+
+static void
+XAADestroyClip(GCPtr pGC)
+{
+ XAA_GC_FUNC_PROLOGUE (pGC);
+ (* pGC->funcs->DestroyClip)(pGC);
+ XAA_GC_FUNC_EPILOGUE (pGC);
+}
+
+/**** Pixmap Wrappers ****/
+
+
+
+static void
+XAAFillSpansPixmap(
+ DrawablePtr pDraw,
+ GC *pGC,
+ int nInit,
+ DDXPointPtr pptInit,
+ int *pwidthInit,
+ int fSorted
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+static void
+XAASetSpansPixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ char *pcharsrc,
+ register DDXPointPtr ppt,
+ int *pwidth,
+ int nspans,
+ int fSorted
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+static void
+XAAPutImagePixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int depth,
+ int x, int y, int w, int h,
+ int leftPad,
+ int format,
+ char *pImage
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
+ leftPad, format, pImage);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+static RegionPtr
+XAACopyAreaPixmap(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GC *pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ RegionPtr ret;
+
+ if(infoRec->pScrn->vtSema &&
+ ((pSrc->type == DRAWABLE_WINDOW) || IS_OFFSCREEN_PIXMAP(pSrc)))
+ {
+ if(infoRec->ReadPixmap && (pGC->alu == GXcopy) &&
+ (pSrc->bitsPerPixel == pDst->bitsPerPixel) &&
+ ((pGC->planemask & infoRec->FullPlanemasks[pSrc->depth - 1])
+ == infoRec->FullPlanemasks[pSrc->depth - 1]))
+ {
+ XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pDst));
+ pixPriv->flags |= DIRTY;
+
+ return (XAABitBlt( pSrc, pDst, pGC,
+ srcx, srcy, width, height, dstx, dsty,
+ XAADoImageRead, 0L));
+ } else
+ if(infoRec->NeedToSync) {
+ (*infoRec->Sync)(infoRec->pScrn);
+ infoRec->NeedToSync = FALSE;
+ }
+ }
+
+ {
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDst);
+ ret = (*pGC->ops->CopyArea)(pSrc, pDst,
+ pGC, srcx, srcy, width, height, dstx, dsty);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+ }
+ return ret;
+}
+
+static RegionPtr
+XAACopyPlanePixmap(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GCPtr pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty,
+ unsigned long bitPlane
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ RegionPtr ret;
+
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDst);
+
+ if(infoRec->pScrn->vtSema &&
+ ((pSrc->type == DRAWABLE_WINDOW) || IS_OFFSCREEN_PIXMAP(pSrc))){
+ if(infoRec->NeedToSync) {
+ (*infoRec->Sync)(infoRec->pScrn);
+ infoRec->NeedToSync = FALSE;
+ }
+ }
+
+ ret = (*pGC->ops->CopyPlane)(pSrc, pDst,
+ pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static void
+XAAPolyPointPixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ xPoint *pptInit
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+
+static void
+XAAPolylinesPixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr pptInit
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+static void
+XAAPolySegmentPixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nseg,
+ xSegment *pSeg
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+static void
+XAAPolyRectanglePixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nRectsInit,
+ xRectangle *pRectsInit
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+static void
+XAAPolyArcPixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcs,
+ xArc *parcs
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+static void
+XAAFillPolygonPixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+
+static void
+XAAPolyFillRectPixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nrectFill,
+ xRectangle *prectInit
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+
+static void
+XAAPolyFillArcPixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcs,
+ xArc *parcs
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+static int
+XAAPolyText8Pixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ char *chars
+){
+ int ret;
+
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static int
+XAAPolyText16Pixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ unsigned short *chars
+){
+ int ret;
+
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static void
+XAAImageText8Pixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ char *chars
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+static void
+XAAImageText16Pixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ unsigned short *chars
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+
+static void
+XAAImageGlyphBltPixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph,
+ ppci, pglyphBase);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+static void
+XAAPolyGlyphBltPixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph,
+ ppci, pglyphBase);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+static void
+XAAPushPixelsPixmap(
+ GCPtr pGC,
+ PixmapPtr pBitMap,
+ DrawablePtr pDraw,
+ int dx, int dy, int xOrg, int yOrg
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+GCOps XAAPixmapOps = {
+ XAAFillSpansPixmap, XAASetSpansPixmap,
+ XAAPutImagePixmap, XAACopyAreaPixmap,
+ XAACopyPlanePixmap, XAAPolyPointPixmap,
+ XAAPolylinesPixmap, XAAPolySegmentPixmap,
+ XAAPolyRectanglePixmap, XAAPolyArcPixmap,
+ XAAFillPolygonPixmap, XAAPolyFillRectPixmap,
+ XAAPolyFillArcPixmap, XAAPolyText8Pixmap,
+ XAAPolyText16Pixmap, XAAImageText8Pixmap,
+ XAAImageText16Pixmap, XAAImageGlyphBltPixmap,
+ XAAPolyGlyphBltPixmap, XAAPushPixelsPixmap,
+};
diff --git a/xorg-server/hw/xfree86/xaa/xaaTables.c b/xorg-server/hw/xfree86/xaa/xaaTables.c
index c7fa28af3..dbeb4a269 100644
--- a/xorg-server/hw/xfree86/xaa/xaaTables.c
+++ b/xorg-server/hw/xfree86/xaa/xaaTables.c
@@ -1,3 +1,6 @@
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
#include "xaalocal.h"
/*
* This is a table of 24-bit values, indexed with an 8-bit byte value, then
diff --git a/xorg-server/hw/xnest/Display.c b/xorg-server/hw/xnest/Display.c
index 7acad755c..3176b60d7 100644
--- a/xorg-server/hw/xnest/Display.c
+++ b/xorg-server/hw/xnest/Display.c
@@ -55,6 +55,11 @@ Pixmap xnestScreenSaverPixmap;
XlibGC xnestBitmapGC;
unsigned long xnestEventMask;
+#ifdef __SUNPRO_C
+/* prevent "Function has no return statement" error for x_io_error_handler */
+#pragma does_not_return(exit)
+#endif
+
static int _X_NORETURN
x_io_error_handler (Display *dpy) {
ErrorF("Lost connection to X server: %s\n", strerror(errno));
diff --git a/xorg-server/hw/xwin/win.h b/xorg-server/hw/xwin/win.h
index e2e946fb5..ac26d0181 100644
--- a/xorg-server/hw/xwin/win.h
+++ b/xorg-server/hw/xwin/win.h
@@ -143,12 +143,12 @@
#undef HANDLE
#endif
-#ifdef HAS_MMAP
+#ifdef HAVE_MMAP
#include <sys/mman.h>
#ifndef MAP_FILE
#define MAP_FILE 0
#endif /* MAP_FILE */
-#endif /* HAS_MMAP */
+#endif /* HAVE_MMAP */
#include <X11/X.h>
#include <X11/Xproto.h>
diff --git a/xorg-server/include/dix-config.h.in b/xorg-server/include/dix-config.h.in
index e1d3a9eaa..3fb641367 100644
--- a/xorg-server/include/dix-config.h.in
+++ b/xorg-server/include/dix-config.h.in
@@ -51,27 +51,9 @@
/* Support XDM-AUTH*-1 */
#undef HASXDMAUTH
-/* Define to 1 if you have the `getdtablesize' function. */
-#undef HAS_GETDTABLESIZE
-
-/* Define to 1 if you have the `getifaddrs' function. */
-#undef HAS_GETIFADDRS
-
-/* Define to 1 if you have the `getpeereid' function. */
-#undef HAS_GETPEEREID
-
-/* Define to 1 if you have the `getpeerucred' function. */
-#undef HAS_GETPEERUCRED
-
-/* Define to 1 if you have the `mmap' function. */
-#undef HAS_MMAP
-
/* Support SHM */
#undef HAS_SHM
-/* Have the 'strlcpy' function */
-#undef HAS_STRLCPY
-
/* Define to 1 if you have the <asm/mtrr.h> header file. */
#undef HAVE_ASM_MTRR_H
@@ -81,7 +63,7 @@
/* Define to 1 if you have the <byteswap.h> header file. */
#undef HAVE_BYTESWAP_H
-/* Define to 1 if you have cbrt */
+/* Define to 1 if you have the `cbrt' function. */
#undef HAVE_CBRT
/* Define to 1 if you have the <dbm.h> header file. */
@@ -94,23 +76,26 @@
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
-/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
-#undef HAVE_DOPRNT
-
/* Have execinfo.h */
#undef HAVE_EXECINFO_H
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
-/* Define to 1 if you have the `geteuid' function. */
-#undef HAVE_GETEUID
+/* Define to 1 if you have the `ffs' function. */
+#undef HAVE_FFS
-/* Define to 1 if you have the `getisax' function. */
-#undef HAVE_GETISAX
+/* Define to 1 if you have the `getdtablesize' function. */
+#undef HAVE_GETDTABLESIZE
+
+/* Define to 1 if you have the `getifaddrs' function. */
+#undef HAVE_GETIFADDRS
-/* Define to 1 if you have the `getuid' function. */
-#undef HAVE_GETUID
+/* Define to 1 if you have the `getpeereid' function. */
+#undef HAVE_GETPEEREID
+
+/* Define to 1 if you have the `getpeerucred' function. */
+#undef HAVE_GETPEERUCRED
/* Define to 1 if you have the `getzoneid' function. */
#undef HAVE_GETZONEID
@@ -136,9 +121,6 @@
/* Define to 1 if you have the libdispatch (GCD) available */
#undef HAVE_LIBDISPATCH
-/* Define to 1 if you have the `link' function. */
-#undef HAVE_LINK
-
/* Define to 1 if you have the <linux/agpgart.h> header file. */
#undef HAVE_LINUX_AGPGART_H
@@ -148,8 +130,8 @@
/* Define to 1 if you have the <linux/fb.h> header file. */
#undef HAVE_LINUX_FB_H
-/* Define to 1 if you have the `mkstemp' function. */
-#undef HAVE_MKSTEMP
+/* Define to 1 if you have the `mmap' function. */
+#undef HAVE_MMAP
/* Define to 1 if you have the <ndbm.h> header file. */
#undef HAVE_NDBM_H
@@ -181,8 +163,20 @@
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
-/* Define to 1 if you have the `strchr' function. */
-#undef HAVE_STRCHR
+/* Define to 1 if you have the `strcasecmp' function. */
+#undef HAVE_STRCASECMP
+
+/* Define to 1 if you have the `strcasestr' function. */
+#undef HAVE_STRCASESTR
+
+/* Define to 1 if you have the `strncasecmp' function. */
+#undef HAVE_STRNCASECMP
+
+/* Define to 1 if you have the `strlcat' function. */
+#undef HAVE_STRLCAT
+
+/* Define to 1 if you have the `strlcpy' function. */
+#undef HAVE_STRLCPY
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
@@ -193,12 +187,6 @@
/* Define to 1 if you have the `strndup' function. */
#undef HAVE_STRNDUP
-/* Define to 1 if you have the `strrchr' function. */
-#undef HAVE_STRRCHR
-
-/* Define to 1 if you have the `strtol' function. */
-#undef HAVE_STRTOL
-
/* Define to 1 if SYSV IPC is available */
#undef HAVE_SYSV_IPC
@@ -234,9 +222,6 @@
/* Have /dev/urandom */
#undef HAVE_URANDOM
-/* Define to 1 if you have the `vprintf' function. */
-#undef HAVE_VPRINTF
-
/* Define to 1 if you have the `vasprintf' function. */
#undef HAVE_VASPRINTF
@@ -432,18 +417,6 @@
/* Define to 64-bit byteswap macro */
#undef bswap_64
-/* Need the strcasecmp function. */
-#undef NEED_STRCASECMP
-
-/* Need the strncasecmp function. */
-#undef NEED_STRNCASECMP
-
-/* Need the strcasestr function. */
-#undef NEED_STRCASESTR
-
-/* Define to 1 if you have the `ffs' function. */
-#undef HAVE_FFS
-
/* The compiler supported TLS storage class, prefering initial-exec if tls_model is supported */
#undef TLS
diff --git a/xorg-server/include/dix.h b/xorg-server/include/dix.h
index 34661f3b6..f98c87b04 100644
--- a/xorg-server/include/dix.h
+++ b/xorg-server/include/dix.h
@@ -529,7 +529,9 @@ extern _X_EXPORT void
ScreenRestructured (ScreenPtr pScreen);
#endif
+#ifndef HAVE_FFS
extern _X_EXPORT int ffs(int i);
+#endif
/*
diff --git a/xorg-server/include/os.h b/xorg-server/include/os.h
index 22983814b..1fd5367c4 100644
--- a/xorg-server/include/os.h
+++ b/xorg-server/include/os.h
@@ -472,22 +472,22 @@ extern _X_EXPORT void ddxGiveUp(enum ExitCode error);
extern _X_EXPORT int TimeSinceLastInputEvent(void);
/* strcasecmp.c */
-#if NEED_STRCASECMP
+#ifndef HAVE_STRCASECMP
#define strcasecmp xstrcasecmp
extern _X_EXPORT int xstrcasecmp(const char *s1, const char *s2);
#endif
-#if NEED_STRNCASECMP
+#ifndef HAVE_STRNCASECMP
#define strncasecmp xstrncasecmp
extern _X_EXPORT int xstrncasecmp(const char *s1, const char *s2, size_t n);
#endif
-#if NEED_STRCASESTR
+#ifndef HAVE_STRCASESTR
#define strcasestr xstrcasestr
extern _X_EXPORT char *xstrcasestr(const char *s, const char *find);
#endif
-#ifndef HAS_STRLCPY
+#ifndef HAVE_STRLCPY
extern _X_EXPORT size_t strlcpy(char *dst, const char *src, size_t siz);
extern _X_EXPORT size_t strlcat(char *dst, const char *src, size_t siz);
#endif
diff --git a/xorg-server/include/xkb-config.h.in b/xorg-server/include/xkb-config.h.in
index d3cdd1916..7b6a671b8 100644
--- a/xorg-server/include/xkb-config.h.in
+++ b/xorg-server/include/xkb-config.h.in
@@ -29,7 +29,4 @@
/* XKB output dir for compiled keymaps. */
#undef XKM_OUTPUT_DIR
-/* Do not have `strcasecmp'. */
-#undef NEED_STRCASECMP
-
#endif /* _XKB_CONFIG_H_ */
diff --git a/xorg-server/include/xorg-server.h.in b/xorg-server/include/xorg-server.h.in
index b10b9949e..8086f32ae 100644
--- a/xorg-server/include/xorg-server.h.in
+++ b/xorg-server/include/xorg-server.h.in
@@ -37,6 +37,27 @@
/* Support SHM */
#undef HAS_SHM
+/* Define to 1 if you have the `ffs' function. */
+#undef HAVE_FFS
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#undef HAVE_STRCASECMP
+
+/* Define to 1 if you have the `strcasestr' function. */
+#undef HAVE_STRCASESTR
+
+/* Define to 1 if you have the `strlcat' function. */
+#undef HAVE_STRLCAT
+
+/* Define to 1 if you have the `strlcpy' function. */
+#undef HAVE_STRLCPY
+
+/* Define to 1 if you have the `strncasecmp' function. */
+#undef HAVE_STRNCASECMP
+
+/* Define to 1 if you have the `strndup' function. */
+#undef HAVE_STRNDUP
+
/* Support IPv6 for TCP connections */
#undef IPv6
diff --git a/xorg-server/include/xwin-config.h.in b/xorg-server/include/xwin-config.h.in
index 13b51ca7f..8122f5543 100644
--- a/xorg-server/include/xwin-config.h.in
+++ b/xorg-server/include/xwin-config.h.in
@@ -20,9 +20,6 @@
/* Define to 1 if unsigned long is 64 bits. */
#undef _XSERVER64
-/* Do we require our own snprintf? */
-#undef NEED_SNPRINTF
-
/* Short vendor name */
#undef XVENDORNAMESHORT
diff --git a/xorg-server/mi/mibitblt.c b/xorg-server/mi/mibitblt.c
index 3374ae385..2dfff1451 100644
--- a/xorg-server/mi/mibitblt.c
+++ b/xorg-server/mi/mibitblt.c
@@ -1,825 +1,825 @@
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice 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
-OPEN GROUP 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.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* Author: Todd Newman (aided and abetted by Mr. Drewry) */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <X11/X.h>
-#include <X11/Xprotostr.h>
-
-#include "misc.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "mi.h"
-#include "regionstr.h"
-#include <X11/Xmd.h>
-#include "servermd.h"
-
-#ifndef HAS_FFS
-extern int ffs(int);
-#endif
-
-/* MICOPYAREA -- public entry for the CopyArea request
- * For each rectangle in the source region
- * get the pixels with GetSpans
- * set them in the destination with SetSpans
- * We let SetSpans worry about clipping to the destination.
- */
-RegionPtr
-miCopyArea(DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- int xIn,
- int yIn,
- int widthSrc,
- int heightSrc,
- int xOut,
- int yOut)
-{
- DDXPointPtr ppt, pptFirst;
- unsigned int *pwidthFirst, *pwidth, *pbits;
- BoxRec srcBox, *prect;
- /* may be a new region, or just a copy */
- RegionPtr prgnSrcClip;
- /* non-0 if we've created a src clip */
- RegionPtr prgnExposed;
- int realSrcClip = 0;
- int srcx, srcy, dstx, dsty, i, j, y, width, height,
- xMin, xMax, yMin, yMax;
- unsigned int *ordering;
- int numRects;
- BoxPtr boxes;
-
- srcx = xIn + pSrcDrawable->x;
- srcy = yIn + pSrcDrawable->y;
-
- /* If the destination isn't realized, this is easy */
- if (pDstDrawable->type == DRAWABLE_WINDOW &&
- !((WindowPtr)pDstDrawable)->realized)
- return NULL;
-
- /* clip the source */
- if (pSrcDrawable->type == DRAWABLE_PIXMAP)
- {
- BoxRec box;
-
- box.x1 = pSrcDrawable->x;
- box.y1 = pSrcDrawable->y;
- box.x2 = pSrcDrawable->x + (int) pSrcDrawable->width;
- box.y2 = pSrcDrawable->y + (int) pSrcDrawable->height;
-
- prgnSrcClip = RegionCreate(&box, 1);
- realSrcClip = 1;
- }
- else
- {
- if (pGC->subWindowMode == IncludeInferiors) {
- prgnSrcClip = NotClippedByChildren ((WindowPtr) pSrcDrawable);
- realSrcClip = 1;
- } else
- prgnSrcClip = &((WindowPtr)pSrcDrawable)->clipList;
- }
-
- /* If the src drawable is a window, we need to translate the srcBox so
- * that we can compare it with the window's clip region later on. */
- srcBox.x1 = srcx;
- srcBox.y1 = srcy;
- srcBox.x2 = srcx + widthSrc;
- srcBox.y2 = srcy + heightSrc;
-
- dstx = xOut;
- dsty = yOut;
- if (pGC->miTranslate)
- {
- dstx += pDstDrawable->x;
- dsty += pDstDrawable->y;
- }
-
- pptFirst = ppt = malloc(heightSrc * sizeof(DDXPointRec));
- pwidthFirst = pwidth = malloc(heightSrc * sizeof(unsigned int));
- numRects = RegionNumRects(prgnSrcClip);
- boxes = RegionRects(prgnSrcClip);
- ordering = malloc(numRects * sizeof(unsigned int));
- if(!pptFirst || !pwidthFirst || !ordering)
- {
- free(ordering);
- free(pwidthFirst);
- free(pptFirst);
- return NULL;
- }
-
- /* If not the same drawable then order of move doesn't matter.
- Following assumes that boxes are sorted from top
- to bottom and left to right.
- */
- if ((pSrcDrawable != pDstDrawable) &&
- ((pGC->subWindowMode != IncludeInferiors) ||
- (pSrcDrawable->type == DRAWABLE_PIXMAP) ||
- (pDstDrawable->type == DRAWABLE_PIXMAP)))
- for (i=0; i < numRects; i++)
- ordering[i] = i;
- else { /* within same drawable, must sequence moves carefully! */
- if (dsty <= srcBox.y1) { /* Scroll up or stationary vertical.
- Vertical order OK */
- if (dstx <= srcBox.x1) /* Scroll left or stationary horizontal.
- Horizontal order OK as well */
- for (i=0; i < numRects; i++)
- ordering[i] = i;
- else { /* scroll right. must reverse horizontal banding of rects. */
- for (i=0, j=1, xMax=0; i < numRects; j=i+1, xMax=i) {
- /* find extent of current horizontal band */
- y=boxes[i].y1; /* band has this y coordinate */
- while ((j < numRects) && (boxes[j].y1 == y))
- j++;
- /* reverse the horizontal band in the output ordering */
- for (j-- ; j >= xMax; j--, i++)
- ordering[i] = j;
- }
- }
- }
- else { /* Scroll down. Must reverse vertical banding. */
- if (dstx < srcBox.x1) { /* Scroll left. Horizontal order OK. */
- for (i=numRects-1, j=i-1, yMin=i, yMax=0;
- i >= 0;
- j=i-1, yMin=i) {
- /* find extent of current horizontal band */
- y=boxes[i].y1; /* band has this y coordinate */
- while ((j >= 0) && (boxes[j].y1 == y))
- j--;
- /* reverse the horizontal band in the output ordering */
- for (j++ ; j <= yMin; j++, i--, yMax++)
- ordering[yMax] = j;
- }
- }
- else /* Scroll right or horizontal stationary.
- Reverse horizontal order as well (if stationary, horizontal
- order can be swapped without penalty and this is faster
- to compute). */
- for (i=0, j=numRects-1; i < numRects; i++, j--)
- ordering[i] = j;
- }
- }
-
- for(i = 0; i < numRects; i++)
- {
- prect = &boxes[ordering[i]];
- xMin = max(prect->x1, srcBox.x1);
- xMax = min(prect->x2, srcBox.x2);
- yMin = max(prect->y1, srcBox.y1);
- yMax = min(prect->y2, srcBox.y2);
- /* is there anything visible here? */
- if(xMax <= xMin || yMax <= yMin)
- continue;
-
- ppt = pptFirst;
- pwidth = pwidthFirst;
- y = yMin;
- height = yMax - yMin;
- width = xMax - xMin;
-
- for(j = 0; j < height; j++)
- {
- /* We must untranslate before calling GetSpans */
- ppt->x = xMin;
- ppt++->y = y++;
- *pwidth++ = width;
- }
- pbits = malloc(height * PixmapBytePad(width, pSrcDrawable->depth));
- if (pbits)
- {
- (*pSrcDrawable->pScreen->GetSpans)(pSrcDrawable, width, pptFirst,
- (int *)pwidthFirst, height, (char *)pbits);
- ppt = pptFirst;
- pwidth = pwidthFirst;
- xMin -= (srcx - dstx);
- y = yMin - (srcy - dsty);
- for(j = 0; j < height; j++)
- {
- ppt->x = xMin;
- ppt++->y = y++;
- *pwidth++ = width;
- }
-
- (*pGC->ops->SetSpans)(pDstDrawable, pGC, (char *)pbits, pptFirst,
- (int *)pwidthFirst, height, TRUE);
- free(pbits);
- }
- }
- prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, xIn, yIn,
- widthSrc, heightSrc, xOut, yOut, (unsigned long)0);
- if(realSrcClip)
- RegionDestroy(prgnSrcClip);
-
- free(ordering);
- free(pwidthFirst);
- free(pptFirst);
- return prgnExposed;
-}
-
-/* MIGETPLANE -- gets a bitmap representing one plane of pDraw
- * A helper used for CopyPlane and XY format GetImage
- * No clever strategy here, we grab a scanline at a time, pull out the
- * bits and then stuff them in a 1 bit deep map.
- */
-/*
- * This should be replaced with something more general. mi shouldn't have to
- * care about such things as scanline padding et alia.
- */
-static
-MiBits *
-miGetPlane(
- DrawablePtr pDraw,
- int planeNum, /* number of the bitPlane */
- int sx,
- int sy,
- int w,
- int h,
- MiBits *result)
-{
- int i, j, k, width, bitsPerPixel, widthInBytes;
- DDXPointRec pt = {0, 0};
- MiBits pixel;
- MiBits bit;
- unsigned char *pCharsOut = NULL;
-
-#if BITMAP_SCANLINE_UNIT == 8
-#define OUT_TYPE unsigned char
-#endif
-#if BITMAP_SCANLINE_UNIT == 16
-#define OUT_TYPE CARD16
-#endif
-#if BITMAP_SCANLINE_UNIT == 32
-#define OUT_TYPE CARD32
-#endif
-#if BITMAP_SCANLINE_UNIT == 64
-#define OUT_TYPE CARD64
-#endif
-
- OUT_TYPE *pOut;
- int delta = 0;
-
- sx += pDraw->x;
- sy += pDraw->y;
- widthInBytes = BitmapBytePad(w);
- if(!result)
- result = calloc(h, widthInBytes);
- if (!result)
- return NULL;
- bitsPerPixel = pDraw->bitsPerPixel;
- pOut = (OUT_TYPE *) result;
- if(bitsPerPixel == 1)
- {
- pCharsOut = (unsigned char *) result;
- width = w;
- }
- else
- {
- delta = (widthInBytes / (BITMAP_SCANLINE_UNIT / 8)) -
- (w / BITMAP_SCANLINE_UNIT);
- width = 1;
-#if IMAGE_BYTE_ORDER == MSBFirst
- planeNum += (32 - bitsPerPixel);
-#endif
- }
- pt.y = sy;
- for (i = h; --i >= 0; pt.y++)
- {
- pt.x = sx;
- if(bitsPerPixel == 1)
- {
- (*pDraw->pScreen->GetSpans)(pDraw, width, &pt, &width, 1,
- (char *)pCharsOut);
- pCharsOut += widthInBytes;
- }
- else
- {
- k = 0;
- for(j = w; --j >= 0; pt.x++)
- {
- /* Fetch the next pixel */
- (*pDraw->pScreen->GetSpans)(pDraw, width, &pt, &width, 1,
- (char *)&pixel);
- /*
- * Now get the bit and insert into a bitmap in XY format.
- */
- bit = (pixel >> planeNum) & 1;
-#if 0
- /* XXX assuming bit order == byte order */
-#if BITMAP_BIT_ORDER == LSBFirst
- bit <<= k;
-#else
- bit <<= ((BITMAP_SCANLINE_UNIT - 1) - k);
-#endif
-#else
- /* XXX assuming byte order == LSBFirst */
- if (screenInfo.bitmapBitOrder == LSBFirst)
- bit <<= k;
- else
- bit <<= ((screenInfo.bitmapScanlineUnit - 1) -
- (k % screenInfo.bitmapScanlineUnit)) +
- ((k / screenInfo.bitmapScanlineUnit) *
- screenInfo.bitmapScanlineUnit);
-#endif
- *pOut |= (OUT_TYPE) bit;
- k++;
- if (k == BITMAP_SCANLINE_UNIT)
- {
- pOut++;
- k = 0;
- }
- }
- pOut += delta;
- }
- }
- return result;
-
-}
-
-/* MIOPQSTIPDRAWABLE -- use pbits as an opaque stipple for pDraw.
- * Drawing through the clip mask we SetSpans() the bits into a
- * bitmap and stipple those bits onto the destination drawable by doing a
- * PolyFillRect over the whole drawable,
- * then we invert the bitmap by copying it onto itself with an alu of
- * GXinvert, invert the foreground/background colors of the gc, and draw
- * the background bits.
- * Note how the clipped out bits of the bitmap are always the background
- * color so that the stipple never causes FillRect to draw them.
- */
-static void
-miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
- MiBits *pbits, int srcx, int w, int h, int dstx, int dsty)
-{
- int oldfill, i;
- unsigned long oldfg;
- int *pwidth, *pwidthFirst;
- ChangeGCVal gcv[6];
- PixmapPtr pStipple, pPixmap;
- DDXPointRec oldOrg;
- GCPtr pGCT;
- DDXPointPtr ppt, pptFirst;
- xRectangle rect;
- RegionPtr prgnSrcClip;
-
- pPixmap = (*pDraw->pScreen->CreatePixmap)
- (pDraw->pScreen, w + srcx, h, 1,
- CREATE_PIXMAP_USAGE_SCRATCH);
- if (!pPixmap)
- return;
-
- /* Put the image into a 1 bit deep pixmap */
- pGCT = GetScratchGC(1, pDraw->pScreen);
- if (!pGCT)
- {
- (*pDraw->pScreen->DestroyPixmap)(pPixmap);
- return;
- }
- /* First set the whole pixmap to 0 */
- gcv[0].val = 0;
- ChangeGC(NullClient, pGCT, GCBackground, gcv);
- ValidateGC((DrawablePtr)pPixmap, pGCT);
- miClearDrawable((DrawablePtr)pPixmap, pGCT);
- ppt = pptFirst = malloc(h * sizeof(DDXPointRec));
- pwidth = pwidthFirst = malloc(h * sizeof(int));
- if(!pptFirst || !pwidthFirst)
- {
- free(pwidthFirst);
- free(pptFirst);
- FreeScratchGC(pGCT);
- return;
- }
-
- /* we need a temporary region because ChangeClip must be assumed
- to destroy what it's sent. note that this means we don't
- have to free prgnSrcClip ourselves.
- */
- prgnSrcClip = RegionCreate(NULL, 0);
- RegionCopy(prgnSrcClip, prgnSrc);
- RegionTranslate(prgnSrcClip, srcx, 0);
- (*pGCT->funcs->ChangeClip)(pGCT, CT_REGION, prgnSrcClip, 0);
- ValidateGC((DrawablePtr)pPixmap, pGCT);
-
- /* Since we know pDraw is always a pixmap, we never need to think
- * about translation here */
- for(i = 0; i < h; i++)
- {
- ppt->x = 0;
- ppt++->y = i;
- *pwidth++ = w + srcx;
- }
-
- (*pGCT->ops->SetSpans)((DrawablePtr)pPixmap, pGCT, (char *)pbits,
- pptFirst, pwidthFirst, h, TRUE);
- free(pwidthFirst);
- free(pptFirst);
-
-
- /* Save current values from the client GC */
- oldfill = pGC->fillStyle;
- pStipple = pGC->stipple;
- if(pStipple)
- pStipple->refcnt++;
- oldOrg = pGC->patOrg;
-
- /* Set a new stipple in the drawable */
- gcv[0].val = FillStippled;
- gcv[1].ptr = pPixmap;
- gcv[2].val = dstx - srcx;
- gcv[3].val = dsty;
-
- ChangeGC(NullClient, pGC,
- GCFillStyle | GCStipple | GCTileStipXOrigin | GCTileStipYOrigin,
- gcv);
- ValidateGC(pDraw, pGC);
-
- /* Fill the drawable with the stipple. This will draw the
- * foreground color whereever 1 bits are set, leaving everything
- * with 0 bits untouched. Note that the part outside the clip
- * region is all 0s. */
- rect.x = dstx;
- rect.y = dsty;
- rect.width = w;
- rect.height = h;
- (*pGC->ops->PolyFillRect)(pDraw, pGC, 1, &rect);
-
- /* Invert the tiling pixmap. This sets 0s for 1s and 1s for 0s, only
- * within the clipping region, the part outside is still all 0s */
- gcv[0].val = GXinvert;
- ChangeGC(NullClient, pGCT, GCFunction, gcv);
- ValidateGC((DrawablePtr)pPixmap, pGCT);
- (*pGCT->ops->CopyArea)((DrawablePtr)pPixmap, (DrawablePtr)pPixmap,
- pGCT, 0, 0, w + srcx, h, 0, 0);
-
- /* Swap foreground and background colors on the GC for the drawable.
- * Now when we fill the drawable, we will fill in the "Background"
- * values */
- oldfg = pGC->fgPixel;
- gcv[0].val = pGC->bgPixel;
- gcv[1].val = oldfg;
- gcv[2].ptr = pPixmap;
- ChangeGC(NullClient, pGC, GCForeground | GCBackground | GCStipple, gcv);
- ValidateGC(pDraw, pGC);
- /* PolyFillRect might have bashed the rectangle */
- rect.x = dstx;
- rect.y = dsty;
- rect.width = w;
- rect.height = h;
- (*pGC->ops->PolyFillRect)(pDraw, pGC, 1, &rect);
-
- /* Now put things back */
- if(pStipple)
- pStipple->refcnt--;
- gcv[0].val = oldfg;
- gcv[1].val = pGC->fgPixel;
- gcv[2].val = oldfill;
- gcv[3].ptr = pStipple;
- gcv[4].val = oldOrg.x;
- gcv[5].val = oldOrg.y;
- ChangeGC(NullClient, pGC,
- GCForeground | GCBackground | GCFillStyle | GCStipple |
- GCTileStipXOrigin | GCTileStipYOrigin, gcv);
-
- ValidateGC(pDraw, pGC);
- /* put what we hope is a smaller clip region back in the scratch gc */
- (*pGCT->funcs->ChangeClip)(pGCT, CT_NONE, NULL, 0);
- FreeScratchGC(pGCT);
- (*pDraw->pScreen->DestroyPixmap)(pPixmap);
-
-}
-
-/* MICOPYPLANE -- public entry for the CopyPlane request.
- * strategy:
- * First build up a bitmap out of the bits requested
- * build a source clip
- * Use the bitmap we've built up as a Stipple for the destination
- */
-RegionPtr
-miCopyPlane( DrawablePtr pSrcDrawable,
- DrawablePtr pDstDrawable,
- GCPtr pGC,
- int srcx,
- int srcy,
- int width,
- int height,
- int dstx,
- int dsty,
- unsigned long bitPlane)
-{
- MiBits *ptile;
- BoxRec box;
- RegionPtr prgnSrc, prgnExposed;
-
- /* incorporate the source clip */
-
- box.x1 = srcx + pSrcDrawable->x;
- box.y1 = srcy + pSrcDrawable->y;
- box.x2 = box.x1 + width;
- box.y2 = box.y1 + height;
- /* clip to visible drawable */
- if (box.x1 < pSrcDrawable->x)
- box.x1 = pSrcDrawable->x;
- if (box.y1 < pSrcDrawable->y)
- box.y1 = pSrcDrawable->y;
- if (box.x2 > pSrcDrawable->x + (int) pSrcDrawable->width)
- box.x2 = pSrcDrawable->x + (int) pSrcDrawable->width;
- if (box.y2 > pSrcDrawable->y + (int) pSrcDrawable->height)
- box.y2 = pSrcDrawable->y + (int) pSrcDrawable->height;
- if (box.x1 > box.x2)
- box.x2 = box.x1;
- if (box.y1 > box.y2)
- box.y2 = box.y1;
- prgnSrc = RegionCreate(&box, 1);
-
- if (pSrcDrawable->type != DRAWABLE_PIXMAP) {
- /* clip to visible drawable */
-
- if (pGC->subWindowMode == IncludeInferiors)
- {
- RegionPtr clipList = NotClippedByChildren ((WindowPtr) pSrcDrawable);
- RegionIntersect(prgnSrc, prgnSrc, clipList);
- RegionDestroy(clipList);
- } else
- RegionIntersect(prgnSrc, prgnSrc,
- &((WindowPtr)pSrcDrawable)->clipList);
- }
-
- box = *RegionExtents(prgnSrc);
- RegionTranslate(prgnSrc, -box.x1, -box.y1);
-
- if ((box.x2 > box.x1) && (box.y2 > box.y1))
- {
- /* minimize the size of the data extracted */
- /* note that we convert the plane mask bitPlane into a plane number */
- box.x1 -= pSrcDrawable->x;
- box.x2 -= pSrcDrawable->x;
- box.y1 -= pSrcDrawable->y;
- box.y2 -= pSrcDrawable->y;
- ptile = miGetPlane(pSrcDrawable, ffs(bitPlane) - 1,
- box.x1, box.y1,
- box.x2 - box.x1, box.y2 - box.y1,
- (MiBits *) NULL);
- if (ptile)
- {
- miOpqStipDrawable(pDstDrawable, pGC, prgnSrc, ptile, 0,
- box.x2 - box.x1, box.y2 - box.y1,
- dstx + box.x1 - srcx, dsty + box.y1 - srcy);
- free(ptile);
- }
- }
- prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx, srcy,
- width, height, dstx, dsty, bitPlane);
- RegionDestroy(prgnSrc);
- return prgnExposed;
-}
-
-/* MIGETIMAGE -- public entry for the GetImage Request
- * We're getting the image into a memory buffer. While we have to use GetSpans
- * to read a line from the device (since we don't know what that looks like),
- * we can just write into the destination buffer
- *
- * two different strategies are used, depending on whether we're getting the
- * image in Z format or XY format
- * Z format:
- * Line at a time, GetSpans a line into the destination buffer, then if the
- * planemask is not all ones, we do a SetSpans into a temporary buffer (to get
- * bits turned off) and then another GetSpans to get stuff back (because
- * pixmaps are opaque, and we are passed in the memory to write into). This is
- * pretty ugly and slow but works. Life is hard.
- * XY format:
- * get the single plane specified in planemask
- */
-void
-miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
- unsigned int format, unsigned long planeMask, char *pDst)
-{
- unsigned char depth;
- int i, linelength, width, srcx, srcy;
- DDXPointRec pt = {0, 0};
- PixmapPtr pPixmap = NULL;
- GCPtr pGC = NULL;
-
- depth = pDraw->depth;
- if(format == ZPixmap)
- {
- if ( (((1<<depth)-1)&planeMask) != (1<<depth)-1 )
- {
- ChangeGCVal gcv;
- xPoint pt;
-
- pGC = GetScratchGC(depth, pDraw->pScreen);
- if (!pGC)
- return;
- pPixmap = (*pDraw->pScreen->CreatePixmap)
- (pDraw->pScreen, w, 1, depth,
- CREATE_PIXMAP_USAGE_SCRATCH);
- if (!pPixmap)
- {
- FreeScratchGC(pGC);
- return;
- }
- /*
- * Clear the pixmap before doing anything else
- */
- ValidateGC((DrawablePtr)pPixmap, pGC);
- pt.x = pt.y = 0;
- width = w;
- (*pGC->ops->FillSpans)((DrawablePtr)pPixmap, pGC, 1, &pt, &width,
- TRUE);
-
- /* alu is already GXCopy */
- gcv.val = (XID)planeMask;
- ChangeGC(NullClient, pGC, GCPlaneMask, &gcv);
- ValidateGC((DrawablePtr)pPixmap, pGC);
- }
-
- linelength = PixmapBytePad(w, depth);
- srcx = sx + pDraw->x;
- srcy = sy + pDraw->y;
- for(i = 0; i < h; i++)
- {
- pt.x = srcx;
- pt.y = srcy + i;
- width = w;
- (*pDraw->pScreen->GetSpans)(pDraw, w, &pt, &width, 1, pDst);
- if (pPixmap)
- {
- pt.x = 0;
- pt.y = 0;
- width = w;
- (*pGC->ops->SetSpans)((DrawablePtr)pPixmap, pGC, pDst,
- &pt, &width, 1, TRUE);
- (*pDraw->pScreen->GetSpans)((DrawablePtr)pPixmap, w, &pt,
- &width, 1, pDst);
- }
- pDst += linelength;
- }
- if (pPixmap)
- {
- (*pGC->pScreen->DestroyPixmap)(pPixmap);
- FreeScratchGC(pGC);
- }
- }
- else
- {
- (void) miGetPlane(pDraw, ffs(planeMask) - 1, sx, sy, w, h,
- (MiBits *)pDst);
- }
-}
-
-/* MIPUTIMAGE -- public entry for the PutImage request
- * Here we benefit from knowing the format of the bits pointed to by pImage,
- * even if we don't know how pDraw represents them.
- * Three different strategies are used depending on the format
- * XYBitmap Format:
- * we just use the Opaque Stipple helper function to cover the destination
- * Note that this covers all the planes of the drawable with the
- * foreground color (masked with the GC planemask) where there are 1 bits
- * and the background color (masked with the GC planemask) where there are
- * 0 bits
- * XYPixmap format:
- * what we're called with is a series of XYBitmaps, but we only want
- * each XYPixmap to update 1 plane, instead of updating all of them.
- * we set the foreground color to be all 1s and the background to all 0s
- * then for each plane, we set the plane mask to only effect that one
- * plane and recursive call ourself with the format set to XYBitmap
- * (This clever idea courtesy of RGD.)
- * ZPixmap format:
- * This part is simple, just call SetSpans
- */
-void
-miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth,
- int x, int y, int w, int h,
- int leftPad, int format, char *pImage)
-{
- DDXPointPtr pptFirst, ppt;
- int *pwidthFirst, *pwidth;
- RegionPtr prgnSrc;
- BoxRec box;
- unsigned long oldFg, oldBg;
- ChangeGCVal gcv[3];
- unsigned long oldPlanemask;
- unsigned long i;
- long bytesPer;
-
- if (!w || !h)
- return;
- switch(format)
- {
- case XYBitmap:
-
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = w;
- box.y2 = h;
- prgnSrc = RegionCreate(&box, 1);
-
- miOpqStipDrawable(pDraw, pGC, prgnSrc, (MiBits *) pImage,
- leftPad, w, h, x, y);
- RegionDestroy(prgnSrc);
- break;
-
- case XYPixmap:
- depth = pGC->depth;
- oldPlanemask = pGC->planemask;
- oldFg = pGC->fgPixel;
- oldBg = pGC->bgPixel;
- gcv[0].val = (XID)~0;
- gcv[1].val = (XID)0;
- ChangeGC(NullClient, pGC, GCForeground | GCBackground, gcv);
- bytesPer = (long)h * BitmapBytePad(w + leftPad);
-
- for (i = 1 << (depth-1); i != 0; i >>= 1, pImage += bytesPer)
- {
- if (i & oldPlanemask)
- {
- gcv[0].val = (XID)i;
- ChangeGC(NullClient, pGC, GCPlaneMask, gcv);
- ValidateGC(pDraw, pGC);
- (*pGC->ops->PutImage)(pDraw, pGC, 1, x, y, w, h, leftPad,
- XYBitmap, (char *)pImage);
- }
- }
- gcv[0].val = (XID)oldPlanemask;
- gcv[1].val = (XID)oldFg;
- gcv[2].val = (XID)oldBg;
- ChangeGC(NullClient, pGC, GCPlaneMask | GCForeground | GCBackground, gcv);
- ValidateGC(pDraw, pGC);
- break;
-
- case ZPixmap:
- ppt = pptFirst = malloc(h * sizeof(DDXPointRec));
- pwidth = pwidthFirst = malloc(h * sizeof(int));
- if(!pptFirst || !pwidthFirst)
- {
- free(pwidthFirst);
- free(pptFirst);
- return;
- }
- if (pGC->miTranslate)
- {
- x += pDraw->x;
- y += pDraw->y;
- }
-
- for(i = 0; i < h; i++)
- {
- ppt->x = x;
- ppt->y = y + i;
- ppt++;
- *pwidth++ = w;
- }
-
- (*pGC->ops->SetSpans)(pDraw, pGC, (char *)pImage, pptFirst,
- pwidthFirst, h, TRUE);
- free(pwidthFirst);
- free(pptFirst);
- break;
- }
-}
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice 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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+/* Author: Todd Newman (aided and abetted by Mr. Drewry) */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/X.h>
+#include <X11/Xprotostr.h>
+
+#include "misc.h"
+#include "gcstruct.h"
+#include "pixmapstr.h"
+#include "windowstr.h"
+#include "scrnintstr.h"
+#include "mi.h"
+#include "regionstr.h"
+#include <X11/Xmd.h>
+#include "servermd.h"
+
+#ifndef HAVE_FFS
+extern int ffs(int);
+#endif
+
+/* MICOPYAREA -- public entry for the CopyArea request
+ * For each rectangle in the source region
+ * get the pixels with GetSpans
+ * set them in the destination with SetSpans
+ * We let SetSpans worry about clipping to the destination.
+ */
+RegionPtr
+miCopyArea(DrawablePtr pSrcDrawable,
+ DrawablePtr pDstDrawable,
+ GCPtr pGC,
+ int xIn,
+ int yIn,
+ int widthSrc,
+ int heightSrc,
+ int xOut,
+ int yOut)
+{
+ DDXPointPtr ppt, pptFirst;
+ unsigned int *pwidthFirst, *pwidth, *pbits;
+ BoxRec srcBox, *prect;
+ /* may be a new region, or just a copy */
+ RegionPtr prgnSrcClip;
+ /* non-0 if we've created a src clip */
+ RegionPtr prgnExposed;
+ int realSrcClip = 0;
+ int srcx, srcy, dstx, dsty, i, j, y, width, height,
+ xMin, xMax, yMin, yMax;
+ unsigned int *ordering;
+ int numRects;
+ BoxPtr boxes;
+
+ srcx = xIn + pSrcDrawable->x;
+ srcy = yIn + pSrcDrawable->y;
+
+ /* If the destination isn't realized, this is easy */
+ if (pDstDrawable->type == DRAWABLE_WINDOW &&
+ !((WindowPtr)pDstDrawable)->realized)
+ return NULL;
+
+ /* clip the source */
+ if (pSrcDrawable->type == DRAWABLE_PIXMAP)
+ {
+ BoxRec box;
+
+ box.x1 = pSrcDrawable->x;
+ box.y1 = pSrcDrawable->y;
+ box.x2 = pSrcDrawable->x + (int) pSrcDrawable->width;
+ box.y2 = pSrcDrawable->y + (int) pSrcDrawable->height;
+
+ prgnSrcClip = RegionCreate(&box, 1);
+ realSrcClip = 1;
+ }
+ else
+ {
+ if (pGC->subWindowMode == IncludeInferiors) {
+ prgnSrcClip = NotClippedByChildren ((WindowPtr) pSrcDrawable);
+ realSrcClip = 1;
+ } else
+ prgnSrcClip = &((WindowPtr)pSrcDrawable)->clipList;
+ }
+
+ /* If the src drawable is a window, we need to translate the srcBox so
+ * that we can compare it with the window's clip region later on. */
+ srcBox.x1 = srcx;
+ srcBox.y1 = srcy;
+ srcBox.x2 = srcx + widthSrc;
+ srcBox.y2 = srcy + heightSrc;
+
+ dstx = xOut;
+ dsty = yOut;
+ if (pGC->miTranslate)
+ {
+ dstx += pDstDrawable->x;
+ dsty += pDstDrawable->y;
+ }
+
+ pptFirst = ppt = malloc(heightSrc * sizeof(DDXPointRec));
+ pwidthFirst = pwidth = malloc(heightSrc * sizeof(unsigned int));
+ numRects = RegionNumRects(prgnSrcClip);
+ boxes = RegionRects(prgnSrcClip);
+ ordering = malloc(numRects * sizeof(unsigned int));
+ if(!pptFirst || !pwidthFirst || !ordering)
+ {
+ free(ordering);
+ free(pwidthFirst);
+ free(pptFirst);
+ return NULL;
+ }
+
+ /* If not the same drawable then order of move doesn't matter.
+ Following assumes that boxes are sorted from top
+ to bottom and left to right.
+ */
+ if ((pSrcDrawable != pDstDrawable) &&
+ ((pGC->subWindowMode != IncludeInferiors) ||
+ (pSrcDrawable->type == DRAWABLE_PIXMAP) ||
+ (pDstDrawable->type == DRAWABLE_PIXMAP)))
+ for (i=0; i < numRects; i++)
+ ordering[i] = i;
+ else { /* within same drawable, must sequence moves carefully! */
+ if (dsty <= srcBox.y1) { /* Scroll up or stationary vertical.
+ Vertical order OK */
+ if (dstx <= srcBox.x1) /* Scroll left or stationary horizontal.
+ Horizontal order OK as well */
+ for (i=0; i < numRects; i++)
+ ordering[i] = i;
+ else { /* scroll right. must reverse horizontal banding of rects. */
+ for (i=0, j=1, xMax=0; i < numRects; j=i+1, xMax=i) {
+ /* find extent of current horizontal band */
+ y=boxes[i].y1; /* band has this y coordinate */
+ while ((j < numRects) && (boxes[j].y1 == y))
+ j++;
+ /* reverse the horizontal band in the output ordering */
+ for (j-- ; j >= xMax; j--, i++)
+ ordering[i] = j;
+ }
+ }
+ }
+ else { /* Scroll down. Must reverse vertical banding. */
+ if (dstx < srcBox.x1) { /* Scroll left. Horizontal order OK. */
+ for (i=numRects-1, j=i-1, yMin=i, yMax=0;
+ i >= 0;
+ j=i-1, yMin=i) {
+ /* find extent of current horizontal band */
+ y=boxes[i].y1; /* band has this y coordinate */
+ while ((j >= 0) && (boxes[j].y1 == y))
+ j--;
+ /* reverse the horizontal band in the output ordering */
+ for (j++ ; j <= yMin; j++, i--, yMax++)
+ ordering[yMax] = j;
+ }
+ }
+ else /* Scroll right or horizontal stationary.
+ Reverse horizontal order as well (if stationary, horizontal
+ order can be swapped without penalty and this is faster
+ to compute). */
+ for (i=0, j=numRects-1; i < numRects; i++, j--)
+ ordering[i] = j;
+ }
+ }
+
+ for(i = 0; i < numRects; i++)
+ {
+ prect = &boxes[ordering[i]];
+ xMin = max(prect->x1, srcBox.x1);
+ xMax = min(prect->x2, srcBox.x2);
+ yMin = max(prect->y1, srcBox.y1);
+ yMax = min(prect->y2, srcBox.y2);
+ /* is there anything visible here? */
+ if(xMax <= xMin || yMax <= yMin)
+ continue;
+
+ ppt = pptFirst;
+ pwidth = pwidthFirst;
+ y = yMin;
+ height = yMax - yMin;
+ width = xMax - xMin;
+
+ for(j = 0; j < height; j++)
+ {
+ /* We must untranslate before calling GetSpans */
+ ppt->x = xMin;
+ ppt++->y = y++;
+ *pwidth++ = width;
+ }
+ pbits = malloc(height * PixmapBytePad(width, pSrcDrawable->depth));
+ if (pbits)
+ {
+ (*pSrcDrawable->pScreen->GetSpans)(pSrcDrawable, width, pptFirst,
+ (int *)pwidthFirst, height, (char *)pbits);
+ ppt = pptFirst;
+ pwidth = pwidthFirst;
+ xMin -= (srcx - dstx);
+ y = yMin - (srcy - dsty);
+ for(j = 0; j < height; j++)
+ {
+ ppt->x = xMin;
+ ppt++->y = y++;
+ *pwidth++ = width;
+ }
+
+ (*pGC->ops->SetSpans)(pDstDrawable, pGC, (char *)pbits, pptFirst,
+ (int *)pwidthFirst, height, TRUE);
+ free(pbits);
+ }
+ }
+ prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, xIn, yIn,
+ widthSrc, heightSrc, xOut, yOut, (unsigned long)0);
+ if(realSrcClip)
+ RegionDestroy(prgnSrcClip);
+
+ free(ordering);
+ free(pwidthFirst);
+ free(pptFirst);
+ return prgnExposed;
+}
+
+/* MIGETPLANE -- gets a bitmap representing one plane of pDraw
+ * A helper used for CopyPlane and XY format GetImage
+ * No clever strategy here, we grab a scanline at a time, pull out the
+ * bits and then stuff them in a 1 bit deep map.
+ */
+/*
+ * This should be replaced with something more general. mi shouldn't have to
+ * care about such things as scanline padding et alia.
+ */
+static
+MiBits *
+miGetPlane(
+ DrawablePtr pDraw,
+ int planeNum, /* number of the bitPlane */
+ int sx,
+ int sy,
+ int w,
+ int h,
+ MiBits *result)
+{
+ int i, j, k, width, bitsPerPixel, widthInBytes;
+ DDXPointRec pt = {0, 0};
+ MiBits pixel;
+ MiBits bit;
+ unsigned char *pCharsOut = NULL;
+
+#if BITMAP_SCANLINE_UNIT == 8
+#define OUT_TYPE unsigned char
+#endif
+#if BITMAP_SCANLINE_UNIT == 16
+#define OUT_TYPE CARD16
+#endif
+#if BITMAP_SCANLINE_UNIT == 32
+#define OUT_TYPE CARD32
+#endif
+#if BITMAP_SCANLINE_UNIT == 64
+#define OUT_TYPE CARD64
+#endif
+
+ OUT_TYPE *pOut;
+ int delta = 0;
+
+ sx += pDraw->x;
+ sy += pDraw->y;
+ widthInBytes = BitmapBytePad(w);
+ if(!result)
+ result = calloc(h, widthInBytes);
+ if (!result)
+ return NULL;
+ bitsPerPixel = pDraw->bitsPerPixel;
+ pOut = (OUT_TYPE *) result;
+ if(bitsPerPixel == 1)
+ {
+ pCharsOut = (unsigned char *) result;
+ width = w;
+ }
+ else
+ {
+ delta = (widthInBytes / (BITMAP_SCANLINE_UNIT / 8)) -
+ (w / BITMAP_SCANLINE_UNIT);
+ width = 1;
+#if IMAGE_BYTE_ORDER == MSBFirst
+ planeNum += (32 - bitsPerPixel);
+#endif
+ }
+ pt.y = sy;
+ for (i = h; --i >= 0; pt.y++)
+ {
+ pt.x = sx;
+ if(bitsPerPixel == 1)
+ {
+ (*pDraw->pScreen->GetSpans)(pDraw, width, &pt, &width, 1,
+ (char *)pCharsOut);
+ pCharsOut += widthInBytes;
+ }
+ else
+ {
+ k = 0;
+ for(j = w; --j >= 0; pt.x++)
+ {
+ /* Fetch the next pixel */
+ (*pDraw->pScreen->GetSpans)(pDraw, width, &pt, &width, 1,
+ (char *)&pixel);
+ /*
+ * Now get the bit and insert into a bitmap in XY format.
+ */
+ bit = (pixel >> planeNum) & 1;
+#if 0
+ /* XXX assuming bit order == byte order */
+#if BITMAP_BIT_ORDER == LSBFirst
+ bit <<= k;
+#else
+ bit <<= ((BITMAP_SCANLINE_UNIT - 1) - k);
+#endif
+#else
+ /* XXX assuming byte order == LSBFirst */
+ if (screenInfo.bitmapBitOrder == LSBFirst)
+ bit <<= k;
+ else
+ bit <<= ((screenInfo.bitmapScanlineUnit - 1) -
+ (k % screenInfo.bitmapScanlineUnit)) +
+ ((k / screenInfo.bitmapScanlineUnit) *
+ screenInfo.bitmapScanlineUnit);
+#endif
+ *pOut |= (OUT_TYPE) bit;
+ k++;
+ if (k == BITMAP_SCANLINE_UNIT)
+ {
+ pOut++;
+ k = 0;
+ }
+ }
+ pOut += delta;
+ }
+ }
+ return result;
+
+}
+
+/* MIOPQSTIPDRAWABLE -- use pbits as an opaque stipple for pDraw.
+ * Drawing through the clip mask we SetSpans() the bits into a
+ * bitmap and stipple those bits onto the destination drawable by doing a
+ * PolyFillRect over the whole drawable,
+ * then we invert the bitmap by copying it onto itself with an alu of
+ * GXinvert, invert the foreground/background colors of the gc, and draw
+ * the background bits.
+ * Note how the clipped out bits of the bitmap are always the background
+ * color so that the stipple never causes FillRect to draw them.
+ */
+static void
+miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
+ MiBits *pbits, int srcx, int w, int h, int dstx, int dsty)
+{
+ int oldfill, i;
+ unsigned long oldfg;
+ int *pwidth, *pwidthFirst;
+ ChangeGCVal gcv[6];
+ PixmapPtr pStipple, pPixmap;
+ DDXPointRec oldOrg;
+ GCPtr pGCT;
+ DDXPointPtr ppt, pptFirst;
+ xRectangle rect;
+ RegionPtr prgnSrcClip;
+
+ pPixmap = (*pDraw->pScreen->CreatePixmap)
+ (pDraw->pScreen, w + srcx, h, 1,
+ CREATE_PIXMAP_USAGE_SCRATCH);
+ if (!pPixmap)
+ return;
+
+ /* Put the image into a 1 bit deep pixmap */
+ pGCT = GetScratchGC(1, pDraw->pScreen);
+ if (!pGCT)
+ {
+ (*pDraw->pScreen->DestroyPixmap)(pPixmap);
+ return;
+ }
+ /* First set the whole pixmap to 0 */
+ gcv[0].val = 0;
+ ChangeGC(NullClient, pGCT, GCBackground, gcv);
+ ValidateGC((DrawablePtr)pPixmap, pGCT);
+ miClearDrawable((DrawablePtr)pPixmap, pGCT);
+ ppt = pptFirst = malloc(h * sizeof(DDXPointRec));
+ pwidth = pwidthFirst = malloc(h * sizeof(int));
+ if(!pptFirst || !pwidthFirst)
+ {
+ free(pwidthFirst);
+ free(pptFirst);
+ FreeScratchGC(pGCT);
+ return;
+ }
+
+ /* we need a temporary region because ChangeClip must be assumed
+ to destroy what it's sent. note that this means we don't
+ have to free prgnSrcClip ourselves.
+ */
+ prgnSrcClip = RegionCreate(NULL, 0);
+ RegionCopy(prgnSrcClip, prgnSrc);
+ RegionTranslate(prgnSrcClip, srcx, 0);
+ (*pGCT->funcs->ChangeClip)(pGCT, CT_REGION, prgnSrcClip, 0);
+ ValidateGC((DrawablePtr)pPixmap, pGCT);
+
+ /* Since we know pDraw is always a pixmap, we never need to think
+ * about translation here */
+ for(i = 0; i < h; i++)
+ {
+ ppt->x = 0;
+ ppt++->y = i;
+ *pwidth++ = w + srcx;
+ }
+
+ (*pGCT->ops->SetSpans)((DrawablePtr)pPixmap, pGCT, (char *)pbits,
+ pptFirst, pwidthFirst, h, TRUE);
+ free(pwidthFirst);
+ free(pptFirst);
+
+
+ /* Save current values from the client GC */
+ oldfill = pGC->fillStyle;
+ pStipple = pGC->stipple;
+ if(pStipple)
+ pStipple->refcnt++;
+ oldOrg = pGC->patOrg;
+
+ /* Set a new stipple in the drawable */
+ gcv[0].val = FillStippled;
+ gcv[1].ptr = pPixmap;
+ gcv[2].val = dstx - srcx;
+ gcv[3].val = dsty;
+
+ ChangeGC(NullClient, pGC,
+ GCFillStyle | GCStipple | GCTileStipXOrigin | GCTileStipYOrigin,
+ gcv);
+ ValidateGC(pDraw, pGC);
+
+ /* Fill the drawable with the stipple. This will draw the
+ * foreground color whereever 1 bits are set, leaving everything
+ * with 0 bits untouched. Note that the part outside the clip
+ * region is all 0s. */
+ rect.x = dstx;
+ rect.y = dsty;
+ rect.width = w;
+ rect.height = h;
+ (*pGC->ops->PolyFillRect)(pDraw, pGC, 1, &rect);
+
+ /* Invert the tiling pixmap. This sets 0s for 1s and 1s for 0s, only
+ * within the clipping region, the part outside is still all 0s */
+ gcv[0].val = GXinvert;
+ ChangeGC(NullClient, pGCT, GCFunction, gcv);
+ ValidateGC((DrawablePtr)pPixmap, pGCT);
+ (*pGCT->ops->CopyArea)((DrawablePtr)pPixmap, (DrawablePtr)pPixmap,
+ pGCT, 0, 0, w + srcx, h, 0, 0);
+
+ /* Swap foreground and background colors on the GC for the drawable.
+ * Now when we fill the drawable, we will fill in the "Background"
+ * values */
+ oldfg = pGC->fgPixel;
+ gcv[0].val = pGC->bgPixel;
+ gcv[1].val = oldfg;
+ gcv[2].ptr = pPixmap;
+ ChangeGC(NullClient, pGC, GCForeground | GCBackground | GCStipple, gcv);
+ ValidateGC(pDraw, pGC);
+ /* PolyFillRect might have bashed the rectangle */
+ rect.x = dstx;
+ rect.y = dsty;
+ rect.width = w;
+ rect.height = h;
+ (*pGC->ops->PolyFillRect)(pDraw, pGC, 1, &rect);
+
+ /* Now put things back */
+ if(pStipple)
+ pStipple->refcnt--;
+ gcv[0].val = oldfg;
+ gcv[1].val = pGC->fgPixel;
+ gcv[2].val = oldfill;
+ gcv[3].ptr = pStipple;
+ gcv[4].val = oldOrg.x;
+ gcv[5].val = oldOrg.y;
+ ChangeGC(NullClient, pGC,
+ GCForeground | GCBackground | GCFillStyle | GCStipple |
+ GCTileStipXOrigin | GCTileStipYOrigin, gcv);
+
+ ValidateGC(pDraw, pGC);
+ /* put what we hope is a smaller clip region back in the scratch gc */
+ (*pGCT->funcs->ChangeClip)(pGCT, CT_NONE, NULL, 0);
+ FreeScratchGC(pGCT);
+ (*pDraw->pScreen->DestroyPixmap)(pPixmap);
+
+}
+
+/* MICOPYPLANE -- public entry for the CopyPlane request.
+ * strategy:
+ * First build up a bitmap out of the bits requested
+ * build a source clip
+ * Use the bitmap we've built up as a Stipple for the destination
+ */
+RegionPtr
+miCopyPlane( DrawablePtr pSrcDrawable,
+ DrawablePtr pDstDrawable,
+ GCPtr pGC,
+ int srcx,
+ int srcy,
+ int width,
+ int height,
+ int dstx,
+ int dsty,
+ unsigned long bitPlane)
+{
+ MiBits *ptile;
+ BoxRec box;
+ RegionPtr prgnSrc, prgnExposed;
+
+ /* incorporate the source clip */
+
+ box.x1 = srcx + pSrcDrawable->x;
+ box.y1 = srcy + pSrcDrawable->y;
+ box.x2 = box.x1 + width;
+ box.y2 = box.y1 + height;
+ /* clip to visible drawable */
+ if (box.x1 < pSrcDrawable->x)
+ box.x1 = pSrcDrawable->x;
+ if (box.y1 < pSrcDrawable->y)
+ box.y1 = pSrcDrawable->y;
+ if (box.x2 > pSrcDrawable->x + (int) pSrcDrawable->width)
+ box.x2 = pSrcDrawable->x + (int) pSrcDrawable->width;
+ if (box.y2 > pSrcDrawable->y + (int) pSrcDrawable->height)
+ box.y2 = pSrcDrawable->y + (int) pSrcDrawable->height;
+ if (box.x1 > box.x2)
+ box.x2 = box.x1;
+ if (box.y1 > box.y2)
+ box.y2 = box.y1;
+ prgnSrc = RegionCreate(&box, 1);
+
+ if (pSrcDrawable->type != DRAWABLE_PIXMAP) {
+ /* clip to visible drawable */
+
+ if (pGC->subWindowMode == IncludeInferiors)
+ {
+ RegionPtr clipList = NotClippedByChildren ((WindowPtr) pSrcDrawable);
+ RegionIntersect(prgnSrc, prgnSrc, clipList);
+ RegionDestroy(clipList);
+ } else
+ RegionIntersect(prgnSrc, prgnSrc,
+ &((WindowPtr)pSrcDrawable)->clipList);
+ }
+
+ box = *RegionExtents(prgnSrc);
+ RegionTranslate(prgnSrc, -box.x1, -box.y1);
+
+ if ((box.x2 > box.x1) && (box.y2 > box.y1))
+ {
+ /* minimize the size of the data extracted */
+ /* note that we convert the plane mask bitPlane into a plane number */
+ box.x1 -= pSrcDrawable->x;
+ box.x2 -= pSrcDrawable->x;
+ box.y1 -= pSrcDrawable->y;
+ box.y2 -= pSrcDrawable->y;
+ ptile = miGetPlane(pSrcDrawable, ffs(bitPlane) - 1,
+ box.x1, box.y1,
+ box.x2 - box.x1, box.y2 - box.y1,
+ (MiBits *) NULL);
+ if (ptile)
+ {
+ miOpqStipDrawable(pDstDrawable, pGC, prgnSrc, ptile, 0,
+ box.x2 - box.x1, box.y2 - box.y1,
+ dstx + box.x1 - srcx, dsty + box.y1 - srcy);
+ free(ptile);
+ }
+ }
+ prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx, srcy,
+ width, height, dstx, dsty, bitPlane);
+ RegionDestroy(prgnSrc);
+ return prgnExposed;
+}
+
+/* MIGETIMAGE -- public entry for the GetImage Request
+ * We're getting the image into a memory buffer. While we have to use GetSpans
+ * to read a line from the device (since we don't know what that looks like),
+ * we can just write into the destination buffer
+ *
+ * two different strategies are used, depending on whether we're getting the
+ * image in Z format or XY format
+ * Z format:
+ * Line at a time, GetSpans a line into the destination buffer, then if the
+ * planemask is not all ones, we do a SetSpans into a temporary buffer (to get
+ * bits turned off) and then another GetSpans to get stuff back (because
+ * pixmaps are opaque, and we are passed in the memory to write into). This is
+ * pretty ugly and slow but works. Life is hard.
+ * XY format:
+ * get the single plane specified in planemask
+ */
+void
+miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
+ unsigned int format, unsigned long planeMask, char *pDst)
+{
+ unsigned char depth;
+ int i, linelength, width, srcx, srcy;
+ DDXPointRec pt = {0, 0};
+ PixmapPtr pPixmap = NULL;
+ GCPtr pGC = NULL;
+
+ depth = pDraw->depth;
+ if(format == ZPixmap)
+ {
+ if ( (((1<<depth)-1)&planeMask) != (1<<depth)-1 )
+ {
+ ChangeGCVal gcv;
+ xPoint pt;
+
+ pGC = GetScratchGC(depth, pDraw->pScreen);
+ if (!pGC)
+ return;
+ pPixmap = (*pDraw->pScreen->CreatePixmap)
+ (pDraw->pScreen, w, 1, depth,
+ CREATE_PIXMAP_USAGE_SCRATCH);
+ if (!pPixmap)
+ {
+ FreeScratchGC(pGC);
+ return;
+ }
+ /*
+ * Clear the pixmap before doing anything else
+ */
+ ValidateGC((DrawablePtr)pPixmap, pGC);
+ pt.x = pt.y = 0;
+ width = w;
+ (*pGC->ops->FillSpans)((DrawablePtr)pPixmap, pGC, 1, &pt, &width,
+ TRUE);
+
+ /* alu is already GXCopy */
+ gcv.val = (XID)planeMask;
+ ChangeGC(NullClient, pGC, GCPlaneMask, &gcv);
+ ValidateGC((DrawablePtr)pPixmap, pGC);
+ }
+
+ linelength = PixmapBytePad(w, depth);
+ srcx = sx + pDraw->x;
+ srcy = sy + pDraw->y;
+ for(i = 0; i < h; i++)
+ {
+ pt.x = srcx;
+ pt.y = srcy + i;
+ width = w;
+ (*pDraw->pScreen->GetSpans)(pDraw, w, &pt, &width, 1, pDst);
+ if (pPixmap)
+ {
+ pt.x = 0;
+ pt.y = 0;
+ width = w;
+ (*pGC->ops->SetSpans)((DrawablePtr)pPixmap, pGC, pDst,
+ &pt, &width, 1, TRUE);
+ (*pDraw->pScreen->GetSpans)((DrawablePtr)pPixmap, w, &pt,
+ &width, 1, pDst);
+ }
+ pDst += linelength;
+ }
+ if (pPixmap)
+ {
+ (*pGC->pScreen->DestroyPixmap)(pPixmap);
+ FreeScratchGC(pGC);
+ }
+ }
+ else
+ {
+ (void) miGetPlane(pDraw, ffs(planeMask) - 1, sx, sy, w, h,
+ (MiBits *)pDst);
+ }
+}
+
+/* MIPUTIMAGE -- public entry for the PutImage request
+ * Here we benefit from knowing the format of the bits pointed to by pImage,
+ * even if we don't know how pDraw represents them.
+ * Three different strategies are used depending on the format
+ * XYBitmap Format:
+ * we just use the Opaque Stipple helper function to cover the destination
+ * Note that this covers all the planes of the drawable with the
+ * foreground color (masked with the GC planemask) where there are 1 bits
+ * and the background color (masked with the GC planemask) where there are
+ * 0 bits
+ * XYPixmap format:
+ * what we're called with is a series of XYBitmaps, but we only want
+ * each XYPixmap to update 1 plane, instead of updating all of them.
+ * we set the foreground color to be all 1s and the background to all 0s
+ * then for each plane, we set the plane mask to only effect that one
+ * plane and recursive call ourself with the format set to XYBitmap
+ * (This clever idea courtesy of RGD.)
+ * ZPixmap format:
+ * This part is simple, just call SetSpans
+ */
+void
+miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth,
+ int x, int y, int w, int h,
+ int leftPad, int format, char *pImage)
+{
+ DDXPointPtr pptFirst, ppt;
+ int *pwidthFirst, *pwidth;
+ RegionPtr prgnSrc;
+ BoxRec box;
+ unsigned long oldFg, oldBg;
+ ChangeGCVal gcv[3];
+ unsigned long oldPlanemask;
+ unsigned long i;
+ long bytesPer;
+
+ if (!w || !h)
+ return;
+ switch(format)
+ {
+ case XYBitmap:
+
+ box.x1 = 0;
+ box.y1 = 0;
+ box.x2 = w;
+ box.y2 = h;
+ prgnSrc = RegionCreate(&box, 1);
+
+ miOpqStipDrawable(pDraw, pGC, prgnSrc, (MiBits *) pImage,
+ leftPad, w, h, x, y);
+ RegionDestroy(prgnSrc);
+ break;
+
+ case XYPixmap:
+ depth = pGC->depth;
+ oldPlanemask = pGC->planemask;
+ oldFg = pGC->fgPixel;
+ oldBg = pGC->bgPixel;
+ gcv[0].val = (XID)~0;
+ gcv[1].val = (XID)0;
+ ChangeGC(NullClient, pGC, GCForeground | GCBackground, gcv);
+ bytesPer = (long)h * BitmapBytePad(w + leftPad);
+
+ for (i = 1 << (depth-1); i != 0; i >>= 1, pImage += bytesPer)
+ {
+ if (i & oldPlanemask)
+ {
+ gcv[0].val = (XID)i;
+ ChangeGC(NullClient, pGC, GCPlaneMask, gcv);
+ ValidateGC(pDraw, pGC);
+ (*pGC->ops->PutImage)(pDraw, pGC, 1, x, y, w, h, leftPad,
+ XYBitmap, (char *)pImage);
+ }
+ }
+ gcv[0].val = (XID)oldPlanemask;
+ gcv[1].val = (XID)oldFg;
+ gcv[2].val = (XID)oldBg;
+ ChangeGC(NullClient, pGC, GCPlaneMask | GCForeground | GCBackground, gcv);
+ ValidateGC(pDraw, pGC);
+ break;
+
+ case ZPixmap:
+ ppt = pptFirst = malloc(h * sizeof(DDXPointRec));
+ pwidth = pwidthFirst = malloc(h * sizeof(int));
+ if(!pptFirst || !pwidthFirst)
+ {
+ free(pwidthFirst);
+ free(pptFirst);
+ return;
+ }
+ if (pGC->miTranslate)
+ {
+ x += pDraw->x;
+ y += pDraw->y;
+ }
+
+ for(i = 0; i < h; i++)
+ {
+ ppt->x = x;
+ ppt->y = y + i;
+ ppt++;
+ *pwidth++ = w;
+ }
+
+ (*pGC->ops->SetSpans)(pDraw, pGC, (char *)pImage, pptFirst,
+ pwidthFirst, h, TRUE);
+ free(pwidthFirst);
+ free(pptFirst);
+ break;
+ }
+}
diff --git a/xorg-server/os/Makefile.am b/xorg-server/os/Makefile.am
index 8dd809531..88914852f 100644
--- a/xorg-server/os/Makefile.am
+++ b/xorg-server/os/Makefile.am
@@ -4,7 +4,6 @@ AM_CFLAGS = $(DIX_CFLAGS) $(SHA1_CFLAGS)
SECURERPC_SRCS = rpcauth.c
XDMCP_SRCS = xdmcp.c
-STRLCAT_SRCS = strlcat.c strlcpy.c
XORG_SRCS = log.c
libos_la_SOURCES = \
@@ -20,14 +19,12 @@ libos_la_SOURCES = \
osdep.h \
osinit.c \
utils.c \
- strcasecmp.c \
- strcasestr.c \
xdmauth.c \
xsha1.c \
xstrans.c \
xprintf.c \
$(XORG_SRCS)
-libos_la_LIBADD = @SHA1_LIBS@ $(DLOPEN_LIBS)
+libos_la_LIBADD = @SHA1_LIBS@ $(DLOPEN_LIBS) $(LTLIBOBJS)
if SECURE_RPC
libos_la_SOURCES += $(SECURERPC_SRCS)
@@ -37,16 +34,7 @@ if XDMCP
libos_la_SOURCES += $(XDMCP_SRCS)
endif
-if NEED_STRLCAT
-libos_la_SOURCES += $(STRLCAT_SRCS)
-endif
-
-if NEED_STRNDUP
-libos_la_SOURCES += $(STRNDUP_SRCS)
-endif
-
-EXTRA_DIST = $(SECURERPC_SRCS) $(INTERNALMALLOC_SRCS) \
- $(XDMCP_SRCS) $(STRLCAT_SRCS)
+EXTRA_DIST = $(SECURERPC_SRCS) $(XDMCP_SRCS)
if SPECIAL_DTRACE_OBJECTS
# Generate dtrace object code for probes in libos & libdix
diff --git a/xorg-server/os/access.c b/xorg-server/os/access.c
index 159894007..0800c7f73 100644
--- a/xorg-server/os/access.c
+++ b/xorg-server/os/access.c
@@ -106,7 +106,7 @@ SOFTWARE.
#include <netinet/in.h>
#endif /* TCPCONN || STREAMSCONN */
-#ifdef HAS_GETPEERUCRED
+#ifdef HAVE_GETPEERUCRED
# include <ucred.h>
# ifdef sun
# include <zone.h>
@@ -146,7 +146,7 @@ SOFTWARE.
#endif
#endif
-#ifdef HAS_GETIFADDRS
+#ifdef HAVE_GETIFADDRS
#include <ifaddrs.h>
#endif
@@ -495,7 +495,7 @@ in6_fillscopeid(struct sockaddr_in6 *sin6)
void
DefineSelf (int fd)
{
-#ifndef HAS_GETIFADDRS
+#ifndef HAVE_GETIFADDRS
char *cp, *cplim;
# ifdef USE_SIOCGLIFCONF
struct sockaddr_storage buf[16];
@@ -510,7 +510,7 @@ DefineSelf (int fd)
register struct ifreq *ifr;
# endif
void * bufptr = buf;
-#else /* HAS_GETIFADDRS */
+#else /* HAVE_GETIFADDRS */
struct ifaddrs * ifap, *ifr;
#endif
int len;
@@ -518,7 +518,7 @@ DefineSelf (int fd)
int family;
register HOST *host;
-#ifndef HAS_GETIFADDRS
+#ifndef HAVE_GETIFADDRS
len = sizeof(buf);
@@ -689,7 +689,7 @@ DefineSelf (int fd)
}
if (bufptr != buf)
free(bufptr);
-#else /* HAS_GETIFADDRS */
+#else /* HAVE_GETIFADDRS */
if (getifaddrs(&ifap) < 0) {
ErrorF("Warning: getifaddrs returns %s\n", strerror(errno));
return;
@@ -777,7 +777,7 @@ DefineSelf (int fd)
} /* for */
freeifaddrs(ifap);
-#endif /* HAS_GETIFADDRS */
+#endif /* HAVE_GETIFADDRS */
/*
* add something of FamilyLocalHost
@@ -798,7 +798,7 @@ DefineSelf (int fd)
}
}
}
-#endif /* hpux && !HAS_IFREQ */
+#endif /* hpux && !HAVE_IFREQ */
#ifdef XDMCP
void
@@ -1091,14 +1091,14 @@ LocalClientCred(ClientPtr client, int *pUid, int *pGid)
int
GetLocalClientCreds(ClientPtr client, LocalClientCredRec **lccp)
{
-#if defined(HAS_GETPEEREID) || defined(HAS_GETPEERUCRED) || defined(SO_PEERCRED)
+#if defined(HAVE_GETPEEREID) || defined(HAVE_GETPEERUCRED) || defined(SO_PEERCRED)
int fd;
XtransConnInfo ci;
LocalClientCredRec *lcc;
-#ifdef HAS_GETPEEREID
+#ifdef HAVE_GETPEEREID
uid_t uid;
gid_t gid;
-#elif defined(HAS_GETPEERUCRED)
+#elif defined(HAVE_GETPEERUCRED)
ucred_t *peercred = NULL;
const gid_t *gids;
#elif defined(SO_PEERCRED)
@@ -1109,7 +1109,7 @@ GetLocalClientCreds(ClientPtr client, LocalClientCredRec **lccp)
if (client == NULL)
return -1;
ci = ((OsCommPtr)client->osPrivate)->trans_conn;
-#if !(defined(sun) && defined(HAS_GETPEERUCRED))
+#if !(defined(sun) && defined(HAVE_GETPEERUCRED))
/* Most implementations can only determine peer credentials for Unix
* domain sockets - Solaris getpeerucred can work with a bit more, so
* we just let it tell us if the connection type is supported or not
@@ -1125,7 +1125,7 @@ GetLocalClientCreds(ClientPtr client, LocalClientCredRec **lccp)
lcc = *lccp;
fd = _XSERVTransGetConnectionNumber(ci);
-#ifdef HAS_GETPEEREID
+#ifdef HAVE_GETPEEREID
if (getpeereid(fd, &uid, &gid) == -1) {
FreeLocalClientCreds(lcc);
return -1;
@@ -1134,7 +1134,7 @@ GetLocalClientCreds(ClientPtr client, LocalClientCredRec **lccp)
lcc->egid = gid;
lcc->fieldsSet = LCC_UID_SET | LCC_GID_SET;
return 0;
-#elif defined(HAS_GETPEERUCRED)
+#elif defined(HAVE_GETPEERUCRED)
if (getpeerucred(fd, &peercred) < 0) {
FreeLocalClientCreds(lcc);
return -1;
diff --git a/xorg-server/os/connection.c b/xorg-server/os/connection.c
index c5fc5a07e..6f480deb6 100644
--- a/xorg-server/os/connection.c
+++ b/xorg-server/os/connection.c
@@ -114,7 +114,7 @@ SOFTWARE.
#define Pid_t pid_t
-#ifdef HAS_GETPEERUCRED
+#ifdef HAVE_GETPEERUCRED
# include <ucred.h>
# include <zone.h>
#endif
@@ -122,7 +122,7 @@ SOFTWARE.
#ifdef XSERVER_DTRACE
# include <sys/types.h>
typedef const char *string;
-# ifndef HAS_GETPEERUCRED
+# ifndef HAVE_GETPEERUCRED
# define zoneid_t int
# endif
# include "../dix/Xserver-dtrace.h"
@@ -282,7 +282,7 @@ InitConnectionLimits(void)
lastfdesc = sysconf(_SC_OPEN_MAX) - 1;
#endif
-#ifdef HAS_GETDTABLESIZE
+#ifdef HAVE_GETDTABLESIZE
if (lastfdesc < 0)
lastfdesc = getdtablesize() - 1;
#endif
diff --git a/xorg-server/os/osdep.h b/xorg-server/os/osdep.h
index d7756b67a..72bd7d762 100644
--- a/xorg-server/os/osdep.h
+++ b/xorg-server/os/osdep.h
@@ -1,288 +1,282 @@
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice 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
-OPEN GROUP 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.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifndef _OSDEP_H_
-#define _OSDEP_H_ 1
-
-#define BOTIMEOUT 200 /* in milliseconds */
-#define BUFSIZE 4096
-#define BUFWATERMARK 8192
-
-#if defined(XDMCP) || defined(HASXDMAUTH)
-#include <X11/Xdmcp.h>
-#endif
-
-#ifdef _POSIX_SOURCE
-#include <limits.h>
-#else
-#define _POSIX_SOURCE
-#include <limits.h>
-#undef _POSIX_SOURCE
-#endif
-
-#ifndef OPEN_MAX
-#ifdef SVR4
-#define OPEN_MAX 256
-#else
-#include <sys/param.h>
-#ifndef OPEN_MAX
-#if defined(NOFILE) && !defined(NOFILES_MAX)
-#define OPEN_MAX NOFILE
-#else
-#if !defined(WIN32)
-#define OPEN_MAX NOFILES_MAX
-#else
-#define OPEN_MAX 256
-#endif
-#endif
-#endif
-#endif
-#endif
-
-#include <X11/Xpoll.h>
-
-/*
- * MAXSOCKS is used only for initialising MaxClients when no other method
- * like sysconf(_SC_OPEN_MAX) is not supported.
- */
-
-#if OPEN_MAX <= 256
-#define MAXSOCKS (OPEN_MAX - 1)
-#else
-#define MAXSOCKS 256
-#endif
-
-/* MAXSELECT is the number of fds that select() can handle */
-#define MAXSELECT (sizeof(fd_set) * NBBY)
-
-#ifndef HAS_GETDTABLESIZE
-#if !defined(SVR4) && !defined(SYSV)
-#define HAS_GETDTABLESIZE
-#endif
-#endif
-
-#include <stddef.h>
-
-#if defined(XDMCP) || defined(HASXDMAUTH)
-typedef Bool (*ValidatorFunc)(ARRAY8Ptr Auth, ARRAY8Ptr Data, int packet_type);
-typedef Bool (*GeneratorFunc)(ARRAY8Ptr Auth, ARRAY8Ptr Data, int packet_type);
-typedef Bool (*AddAuthorFunc)(unsigned name_length, const char *name,
- unsigned data_length, char *data);
-#endif
-
-typedef struct _connectionInput {
- struct _connectionInput *next;
- char *buffer; /* contains current client input */
- char *bufptr; /* pointer to current start of data */
- int bufcnt; /* count of bytes in buffer */
- int lenLastReq;
- int size;
- unsigned int ignoreBytes; /* bytes to ignore before the next request */
-} ConnectionInput, *ConnectionInputPtr;
-
-typedef struct _connectionOutput {
- struct _connectionOutput *next;
- int size;
- unsigned char *buf;
- int count;
-} ConnectionOutput, *ConnectionOutputPtr;
-
-struct _osComm;
-
-#define AuthInitArgs void
-typedef void (*AuthInitFunc) (AuthInitArgs);
-
-#define AuthAddCArgs unsigned short data_length, const char *data, XID id
-typedef int (*AuthAddCFunc) (AuthAddCArgs);
-
-#define AuthCheckArgs unsigned short data_length, const char *data, ClientPtr client, char **reason
-typedef XID (*AuthCheckFunc) (AuthCheckArgs);
-
-#define AuthFromIDArgs XID id, unsigned short *data_lenp, char **datap
-typedef int (*AuthFromIDFunc) (AuthFromIDArgs);
-
-#define AuthGenCArgs unsigned data_length, const char *data, XID id, unsigned *data_length_return, char **data_return
-typedef XID (*AuthGenCFunc) (AuthGenCArgs);
-
-#define AuthRemCArgs unsigned short data_length, const char *data
-typedef int (*AuthRemCFunc) (AuthRemCArgs);
-
-#define AuthRstCArgs void
-typedef int (*AuthRstCFunc) (AuthRstCArgs);
-
-#define AuthToIDArgs unsigned short data_length, char *data
-typedef XID (*AuthToIDFunc) (AuthToIDArgs);
-
-typedef void (*OsCloseFunc)(ClientPtr);
-
-typedef int (*OsFlushFunc)(ClientPtr who, struct _osComm * oc, char* extraBuf, int extraCount);
-
-typedef struct _osComm {
- int fd;
- ConnectionInputPtr input;
- ConnectionOutputPtr output;
- XID auth_id; /* authorization id */
- CARD32 conn_time; /* timestamp if not established, else 0 */
- struct _XtransConnInfo *trans_conn; /* transport connection object */
- Bool local_client;
-} OsCommRec, *OsCommPtr;
-
-extern int FlushClient(
- ClientPtr /*who*/,
- OsCommPtr /*oc*/,
- const void * /*extraBuf*/,
- int /*extraCount*/
-);
-
-extern void FreeOsBuffers(
- OsCommPtr /*oc*/
-);
-
-#include "dix.h"
-
-extern fd_set AllSockets;
-extern fd_set AllClients;
-extern fd_set LastSelectMask;
-extern fd_set WellKnownConnections;
-extern fd_set EnabledDevices;
-extern fd_set ClientsWithInput;
-extern fd_set ClientsWriteBlocked;
-extern fd_set OutputPending;
-extern fd_set IgnoredClientsWithInput;
-
-#ifndef WIN32
-extern int *ConnectionTranslation;
-#else
-extern int GetConnectionTranslation(int conn);
-extern void SetConnectionTranslation(int conn, int client);
-extern void ClearConnectionTranslation(void);
-#endif
-
-extern Bool NewOutputPending;
-extern Bool AnyClientsWriteBlocked;
-
-extern WorkQueuePtr workQueue;
-
-/* in WaitFor.c */
-#ifdef WIN32
-typedef long int fd_mask;
-#endif
-#define ffs mffs
-extern int mffs(fd_mask);
-
-/* in access.c */
-extern Bool ComputeLocalClient(ClientPtr client);
-
-/* in auth.c */
-extern void GenerateRandomData (int len, char *buf);
-
-/* in mitauth.c */
-extern XID MitCheckCookie (AuthCheckArgs);
-extern XID MitGenerateCookie (AuthGenCArgs);
-extern XID MitToID (AuthToIDArgs);
-extern int MitAddCookie (AuthAddCArgs);
-extern int MitFromID (AuthFromIDArgs);
-extern int MitRemoveCookie (AuthRemCArgs);
-extern int MitResetCookie (AuthRstCArgs);
-
-/* in xdmauth.c */
-#ifdef HASXDMAUTH
-extern XID XdmCheckCookie (AuthCheckArgs);
-extern XID XdmToID (AuthToIDArgs);
-extern int XdmAddCookie (AuthAddCArgs);
-extern int XdmFromID (AuthFromIDArgs);
-extern int XdmRemoveCookie (AuthRemCArgs);
-extern int XdmResetCookie (AuthRstCArgs);
-#endif
-
-/* in rpcauth.c */
-#ifdef SECURE_RPC
-extern void SecureRPCInit (AuthInitArgs);
-extern XID SecureRPCCheck (AuthCheckArgs);
-extern XID SecureRPCToID (AuthToIDArgs);
-extern int SecureRPCAdd (AuthAddCArgs);
-extern int SecureRPCFromID (AuthFromIDArgs);
-extern int SecureRPCRemove (AuthRemCArgs);
-extern int SecureRPCReset (AuthRstCArgs);
-#endif
-
-#ifdef XDMCP
-/* in xdmcp.c */
-extern void XdmcpUseMsg (void);
-extern int XdmcpOptions(int argc, char **argv, int i);
-extern void XdmcpRegisterConnection (
- int type,
- const char *address,
- int addrlen);
-extern void XdmcpRegisterAuthorizations (void);
-extern void XdmcpRegisterAuthorization (const char *name, int namelen);
-extern void XdmcpInit (void);
-extern void XdmcpReset (void);
-extern void XdmcpOpenDisplay(int sock);
-extern void XdmcpCloseDisplay(int sock);
-extern void XdmcpRegisterAuthentication (
- const char *name,
- int namelen,
- const char *data,
- int datalen,
- ValidatorFunc Validator,
- GeneratorFunc Generator,
- AddAuthorFunc AddAuth);
-
-struct sockaddr_in;
-extern void XdmcpRegisterBroadcastAddress (const struct sockaddr_in *addr);
-#endif
-
-#ifdef HASXDMAUTH
-extern void XdmAuthenticationInit (const char *cookie, int cookie_length);
-#endif
-
-#endif /* _OSDEP_H_ */
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice 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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _OSDEP_H_
+#define _OSDEP_H_ 1
+
+#define BOTIMEOUT 200 /* in milliseconds */
+#define BUFSIZE 4096
+#define BUFWATERMARK 8192
+
+#if defined(XDMCP) || defined(HASXDMAUTH)
+#include <X11/Xdmcp.h>
+#endif
+
+#ifdef _POSIX_SOURCE
+#include <limits.h>
+#else
+#define _POSIX_SOURCE
+#include <limits.h>
+#undef _POSIX_SOURCE
+#endif
+
+#ifndef OPEN_MAX
+#ifdef SVR4
+#define OPEN_MAX 256
+#else
+#include <sys/param.h>
+#ifndef OPEN_MAX
+#if defined(NOFILE) && !defined(NOFILES_MAX)
+#define OPEN_MAX NOFILE
+#else
+#if !defined(WIN32)
+#define OPEN_MAX NOFILES_MAX
+#else
+#define OPEN_MAX 256
+#endif
+#endif
+#endif
+#endif
+#endif
+
+#include <X11/Xpoll.h>
+
+/*
+ * MAXSOCKS is used only for initialising MaxClients when no other method
+ * like sysconf(_SC_OPEN_MAX) is not supported.
+ */
+
+#if OPEN_MAX <= 256
+#define MAXSOCKS (OPEN_MAX - 1)
+#else
+#define MAXSOCKS 256
+#endif
+
+/* MAXSELECT is the number of fds that select() can handle */
+#define MAXSELECT (sizeof(fd_set) * NBBY)
+
+#include <stddef.h>
+
+#if defined(XDMCP) || defined(HASXDMAUTH)
+typedef Bool (*ValidatorFunc)(ARRAY8Ptr Auth, ARRAY8Ptr Data, int packet_type);
+typedef Bool (*GeneratorFunc)(ARRAY8Ptr Auth, ARRAY8Ptr Data, int packet_type);
+typedef Bool (*AddAuthorFunc)(unsigned name_length, const char *name,
+ unsigned data_length, char *data);
+#endif
+
+typedef struct _connectionInput {
+ struct _connectionInput *next;
+ char *buffer; /* contains current client input */
+ char *bufptr; /* pointer to current start of data */
+ int bufcnt; /* count of bytes in buffer */
+ int lenLastReq;
+ int size;
+ unsigned int ignoreBytes; /* bytes to ignore before the next request */
+} ConnectionInput, *ConnectionInputPtr;
+
+typedef struct _connectionOutput {
+ struct _connectionOutput *next;
+ int size;
+ unsigned char *buf;
+ int count;
+} ConnectionOutput, *ConnectionOutputPtr;
+
+struct _osComm;
+
+#define AuthInitArgs void
+typedef void (*AuthInitFunc) (AuthInitArgs);
+
+#define AuthAddCArgs unsigned short data_length, const char *data, XID id
+typedef int (*AuthAddCFunc) (AuthAddCArgs);
+
+#define AuthCheckArgs unsigned short data_length, const char *data, ClientPtr client, char **reason
+typedef XID (*AuthCheckFunc) (AuthCheckArgs);
+
+#define AuthFromIDArgs XID id, unsigned short *data_lenp, char **datap
+typedef int (*AuthFromIDFunc) (AuthFromIDArgs);
+
+#define AuthGenCArgs unsigned data_length, const char *data, XID id, unsigned *data_length_return, char **data_return
+typedef XID (*AuthGenCFunc) (AuthGenCArgs);
+
+#define AuthRemCArgs unsigned short data_length, const char *data
+typedef int (*AuthRemCFunc) (AuthRemCArgs);
+
+#define AuthRstCArgs void
+typedef int (*AuthRstCFunc) (AuthRstCArgs);
+
+#define AuthToIDArgs unsigned short data_length, char *data
+typedef XID (*AuthToIDFunc) (AuthToIDArgs);
+
+typedef void (*OsCloseFunc)(ClientPtr);
+
+typedef int (*OsFlushFunc)(ClientPtr who, struct _osComm * oc, char* extraBuf, int extraCount);
+
+typedef struct _osComm {
+ int fd;
+ ConnectionInputPtr input;
+ ConnectionOutputPtr output;
+ XID auth_id; /* authorization id */
+ CARD32 conn_time; /* timestamp if not established, else 0 */
+ struct _XtransConnInfo *trans_conn; /* transport connection object */
+ Bool local_client;
+} OsCommRec, *OsCommPtr;
+
+extern int FlushClient(
+ ClientPtr /*who*/,
+ OsCommPtr /*oc*/,
+ const void * /*extraBuf*/,
+ int /*extraCount*/
+);
+
+extern void FreeOsBuffers(
+ OsCommPtr /*oc*/
+);
+
+#include "dix.h"
+
+extern fd_set AllSockets;
+extern fd_set AllClients;
+extern fd_set LastSelectMask;
+extern fd_set WellKnownConnections;
+extern fd_set EnabledDevices;
+extern fd_set ClientsWithInput;
+extern fd_set ClientsWriteBlocked;
+extern fd_set OutputPending;
+extern fd_set IgnoredClientsWithInput;
+
+#ifndef WIN32
+extern int *ConnectionTranslation;
+#else
+extern int GetConnectionTranslation(int conn);
+extern void SetConnectionTranslation(int conn, int client);
+extern void ClearConnectionTranslation(void);
+#endif
+
+extern Bool NewOutputPending;
+extern Bool AnyClientsWriteBlocked;
+
+extern WorkQueuePtr workQueue;
+
+/* in WaitFor.c */
+#ifdef WIN32
+typedef long int fd_mask;
+#endif
+#define ffs mffs
+extern int mffs(fd_mask);
+
+/* in access.c */
+extern Bool ComputeLocalClient(ClientPtr client);
+
+/* in auth.c */
+extern void GenerateRandomData (int len, char *buf);
+
+/* in mitauth.c */
+extern XID MitCheckCookie (AuthCheckArgs);
+extern XID MitGenerateCookie (AuthGenCArgs);
+extern XID MitToID (AuthToIDArgs);
+extern int MitAddCookie (AuthAddCArgs);
+extern int MitFromID (AuthFromIDArgs);
+extern int MitRemoveCookie (AuthRemCArgs);
+extern int MitResetCookie (AuthRstCArgs);
+
+/* in xdmauth.c */
+#ifdef HASXDMAUTH
+extern XID XdmCheckCookie (AuthCheckArgs);
+extern XID XdmToID (AuthToIDArgs);
+extern int XdmAddCookie (AuthAddCArgs);
+extern int XdmFromID (AuthFromIDArgs);
+extern int XdmRemoveCookie (AuthRemCArgs);
+extern int XdmResetCookie (AuthRstCArgs);
+#endif
+
+/* in rpcauth.c */
+#ifdef SECURE_RPC
+extern void SecureRPCInit (AuthInitArgs);
+extern XID SecureRPCCheck (AuthCheckArgs);
+extern XID SecureRPCToID (AuthToIDArgs);
+extern int SecureRPCAdd (AuthAddCArgs);
+extern int SecureRPCFromID (AuthFromIDArgs);
+extern int SecureRPCRemove (AuthRemCArgs);
+extern int SecureRPCReset (AuthRstCArgs);
+#endif
+
+#ifdef XDMCP
+/* in xdmcp.c */
+extern void XdmcpUseMsg (void);
+extern int XdmcpOptions(int argc, char **argv, int i);
+extern void XdmcpRegisterConnection (
+ int type,
+ const char *address,
+ int addrlen);
+extern void XdmcpRegisterAuthorizations (void);
+extern void XdmcpRegisterAuthorization (const char *name, int namelen);
+extern void XdmcpInit (void);
+extern void XdmcpReset (void);
+extern void XdmcpOpenDisplay(int sock);
+extern void XdmcpCloseDisplay(int sock);
+extern void XdmcpRegisterAuthentication (
+ const char *name,
+ int namelen,
+ const char *data,
+ int datalen,
+ ValidatorFunc Validator,
+ GeneratorFunc Generator,
+ AddAuthorFunc AddAuth);
+
+struct sockaddr_in;
+extern void XdmcpRegisterBroadcastAddress (const struct sockaddr_in *addr);
+#endif
+
+#ifdef HASXDMAUTH
+extern void XdmAuthenticationInit (const char *cookie, int cookie_length);
+#endif
+
+#endif /* _OSDEP_H_ */
diff --git a/xorg-server/os/strcasecmp.c b/xorg-server/os/strcasecmp.c
index c95bc5220..cf100baf4 100644
--- a/xorg-server/os/strcasecmp.c
+++ b/xorg-server/os/strcasecmp.c
@@ -1,70 +1,70 @@
-/*
- * Copyright (c) 1987, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <ctype.h>
-#include "dix.h"
-
-#ifdef NEED_STRCASECMP
-int
-xstrcasecmp(const char *str1, const char *str2)
-{
- const u_char *us1 = (const u_char *)str1, *us2 = (const u_char *)str2;
-
- while (tolower(*us1) == tolower(*us2)) {
- if (*us1++ == '\0')
- return 0;
- us2++;
- }
-
- return (tolower(*us1) - tolower(*us2));
-}
-#endif
-
-#ifdef NEED_STRNCASECMP
-int
-xstrncasecmp(const char *s1, const char *s2, size_t n)
-{
- if (n != 0) {
- const u_char *us1 = (const u_char *)s1, *us2 = (const u_char *)s2;
-
- do {
- if (tolower(*us1) != tolower(*us2++))
- return (tolower(*us1) - tolower(*--us2));
- if (*us1++ == '\0')
- break;
- } while (--n != 0);
- }
-
- return 0;
-}
-#endif
+/*
+ * Copyright (c) 1987, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <ctype.h>
+#include "dix.h"
+
+#ifndef HAVE_STRCASECMP
+int
+xstrcasecmp(const char *str1, const char *str2)
+{
+ const u_char *us1 = (const u_char *)str1, *us2 = (const u_char *)str2;
+
+ while (tolower(*us1) == tolower(*us2)) {
+ if (*us1++ == '\0')
+ return 0;
+ us2++;
+ }
+
+ return (tolower(*us1) - tolower(*us2));
+}
+#endif
+
+#ifndef HAVE_STRNCASECMP
+int
+xstrncasecmp(const char *s1, const char *s2, size_t n)
+{
+ if (n != 0) {
+ const u_char *us1 = (const u_char *)s1, *us2 = (const u_char *)s2;
+
+ do {
+ if (tolower(*us1) != tolower(*us2++))
+ return (tolower(*us1) - tolower(*--us2));
+ if (*us1++ == '\0')
+ break;
+ } while (--n != 0);
+ }
+
+ return 0;
+}
+#endif
diff --git a/xorg-server/os/strcasestr.c b/xorg-server/os/strcasestr.c
index 75f220fd3..a20a6cc33 100644
--- a/xorg-server/os/strcasestr.c
+++ b/xorg-server/os/strcasestr.c
@@ -1,64 +1,64 @@
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <ctype.h>
-#include <string.h>
-#include "dix.h"
-
-/*
- * Find the first occurrence of find in s, ignore case.
- */
-#ifdef NEED_STRCASESTR
-char *
-xstrcasestr(const char *s, const char *find)
-{
- char c, sc;
- size_t len;
-
- if ((c = *find++) != 0) {
- c = tolower((unsigned char)c);
- len = strlen(find);
- do {
- do {
- if ((sc = *s++) == 0)
- return NULL;
- } while ((char)tolower((unsigned char)sc) != c);
- } while (strncasecmp(s, find, len) != 0);
- s--;
- }
- return ((char *)s);
-}
-#endif
+/*-
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Chris Torek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <ctype.h>
+#include <string.h>
+#include "dix.h"
+
+/*
+ * Find the first occurrence of find in s, ignore case.
+ */
+#ifndef HAVE_STRCASESTR
+char *
+xstrcasestr(const char *s, const char *find)
+{
+ char c, sc;
+ size_t len;
+
+ if ((c = *find++) != 0) {
+ c = tolower((unsigned char)c);
+ len = strlen(find);
+ do {
+ do {
+ if ((sc = *s++) == 0)
+ return NULL;
+ } while ((char)tolower((unsigned char)sc) != c);
+ } while (strncasecmp(s, find, len) != 0);
+ s--;
+ }
+ return ((char *)s);
+}
+#endif
diff --git a/xorg-server/os/strlcpy.c b/xorg-server/os/strlcpy.c
index 006cd7dc2..7ffb64cd6 100644
--- a/xorg-server/os/strlcpy.c
+++ b/xorg-server/os/strlcpy.c
@@ -1,54 +1,56 @@
-/*
- * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE
- * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <sys/types.h>
-#include <string.h>
-#include "os.h"
-
-/*
- * Copy src to string dst of size siz. At most siz-1 characters
- * will be copied. Always NUL terminates (unless siz == 0).
- * Returns strlen(src); if retval >= siz, truncation occurred.
- */
-size_t
-strlcpy(char *dst, const char *src, size_t siz)
-{
- register char *d = dst;
- register const char *s = src;
- register size_t n = siz;
-
- /* Copy as many bytes as will fit */
- if (n != 0 && --n != 0) {
- do {
- if ((*d++ = *s++) == 0)
- break;
- } while (--n != 0);
- }
-
- /* Not enough room in dst, add NUL and traverse rest of src */
- if (n == 0) {
- if (siz != 0)
- *d = '\0'; /* NUL-terminate dst */
- while (*s++)
- ;
- }
-
- return s - src - 1; /* count does not include NUL */
-}
+/*
+ * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE
+ * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <sys/types.h>
+#include <string.h>
+#include "os.h"
+
+#ifndef HAVE_STRLCPY
+/*
+ * Copy src to string dst of size siz. At most siz-1 characters
+ * will be copied. Always NUL terminates (unless siz == 0).
+ * Returns strlen(src); if retval >= siz, truncation occurred.
+ */
+size_t
+strlcpy(char *dst, const char *src, size_t siz)
+{
+ register char *d = dst;
+ register const char *s = src;
+ register size_t n = siz;
+
+ /* Copy as many bytes as will fit */
+ if (n != 0 && --n != 0) {
+ do {
+ if ((*d++ = *s++) == 0)
+ break;
+ } while (--n != 0);
+ }
+
+ /* Not enough room in dst, add NUL and traverse rest of src */
+ if (n == 0) {
+ if (siz != 0)
+ *d = '\0'; /* NUL-terminate dst */
+ while (*s++)
+ ;
+ }
+
+ return s - src - 1; /* count does not include NUL */
+}
+#endif
diff --git a/xorg-server/test/Makefile.am b/xorg-server/test/Makefile.am
index 62c398c18..48393d39a 100644
--- a/xorg-server/test/Makefile.am
+++ b/xorg-server/test/Makefile.am
@@ -1,21 +1,32 @@
if ENABLE_UNIT_TESTS
-SUBDIRS= . xi2
-noinst_PROGRAMS = xkb input xtest list misc fixes xfree86 string
+SUBDIRS= .
+noinst_PROGRAMS = list string
+if XORG
+# Tests that require at least some DDX functions in order to fully link
+# For now, requires xf86 ddx, could be adjusted to use another
+SUBDIRS += xi2
+noinst_PROGRAMS += xkb input xtest misc fixes xfree86
+endif
check_LTLIBRARIES = libxservertest.la
TESTS=$(noinst_PROGRAMS)
TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV)
AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
-INCLUDES = $(XORG_INCS) -I$(top_srcdir)/hw/xfree86/parser \
- -I$(top_srcdir)/miext/cw -I$(top_srcdir)/hw/xfree86/ddc \
+INCLUDES = $(XORG_INCS) -I$(top_srcdir)/miext/cw
+if XORG
+INCLUDES += -I$(top_srcdir)/hw/xfree86/parser \
+ -I$(top_srcdir)/hw/xfree86/ddc \
-I$(top_srcdir)/hw/xfree86/i2c -I$(top_srcdir)/hw/xfree86/modes \
-I$(top_srcdir)/hw/xfree86/ramdac
+endif
TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS)
+if XORG
if SPECIAL_DTRACE_OBJECTS
TEST_LDADD += $(OS_LIB) $(DIX_LIB)
endif
+endif
xkb_LDADD=$(TEST_LDADD)
input_LDADD=$(TEST_LDADD)
@@ -25,9 +36,10 @@ misc_LDADD=$(TEST_LDADD)
fixes_LDADD=$(TEST_LDADD)
xfree86_LDADD=$(TEST_LDADD)
+libxservertest_la_LIBADD = $(XSERVER_LIBS)
+if XORG
nodist_libxservertest_la_SOURCES = $(top_builddir)/hw/xfree86/sdksyms.c
-libxservertest_la_LIBADD = \
- $(XSERVER_LIBS) \
+libxservertest_la_LIBADD += \
$(top_builddir)/hw/xfree86/loader/libloader.la \
$(top_builddir)/hw/xfree86/os-support/libxorgos.la \
$(top_builddir)/hw/xfree86/common/libcommon.la \
@@ -37,7 +49,9 @@ libxservertest_la_LIBADD = \
$(top_builddir)/hw/xfree86/ramdac/libramdac.la \
$(top_builddir)/hw/xfree86/ddc/libddc.la \
$(top_builddir)/hw/xfree86/i2c/libi2c.la \
- $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \
+ $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la
+endif
+libxservertest_la_LIBADD += \
$(top_builddir)/mi/libmi.la \
$(top_builddir)/os/libos.la \
@XORG_LIBS@