Index: trunk/src/VBox/Additions/x11/x11include/1.3/X11/X.h
===================================================================
--- trunk/src/VBox/Additions/x11/x11include/1.3/X11/X.h	(revision 11548)
+++ trunk/src/VBox/Additions/x11/x11include/1.3/X11/X.h	(revision 11548)
@@ -0,0 +1,721 @@
+/*
+ *	$Xorg: X.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $
+ */
+
+/* Definitions for the X window system likely to be used by applications */
+
+#ifndef X_H
+#define X_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.
+
+******************************************************************/
+/* $XFree86: xc/include/X.h,v 1.6 2003/07/09 15:27:28 tsi Exp $ */
+
+#define X_PROTOCOL	11		/* current protocol version */
+#define X_PROTOCOL_REVISION 0		/* current minor version */
+
+/* Resources */
+
+/*
+ * _XSERVER64 must ONLY be defined when compiling X server sources on
+ * systems where unsigned long is not 32 bits, must NOT be used in
+ * client or library code.
+ */
+#ifndef _XSERVER64
+#  ifndef _XTYPEDEF_XID
+#    define _XTYPEDEF_XID
+typedef unsigned long XID;
+#  endif
+#  ifndef _XTYPEDEF_MASK
+#    define _XTYPEDEF_MASK
+typedef unsigned long Mask;
+#  endif
+#  ifndef _XTYPEDEF_ATOM
+#    define _XTYPEDEF_ATOM
+typedef unsigned long Atom;		/* Also in Xdefs.h */
+#  endif
+typedef unsigned long VisualID;
+typedef unsigned long Time;
+#else
+#  include <X11/Xmd.h>
+#  ifndef _XTYPEDEF_XID
+#    define _XTYPEDEF_XID
+typedef CARD32 XID;
+#  endif
+#  ifndef _XTYPEDEF_MASK
+#    define _XTYPEDEF_MASK
+typedef CARD32 Mask;
+#  endif
+#  ifndef _XTYPEDEF_ATOM
+#    define _XTYPEDEF_ATOM
+typedef CARD32 Atom;
+#  endif
+typedef CARD32 VisualID;
+typedef CARD32 Time;
+#endif
+
+typedef XID Window;
+typedef XID Drawable;
+#ifndef _XTYPEDEF_FONT
+#  define _XTYPEDEF_FONT
+typedef XID Font;
+#endif
+typedef XID Pixmap;
+typedef XID Cursor;
+typedef XID Colormap;
+typedef XID GContext;
+typedef XID KeySym;
+
+typedef unsigned char KeyCode;
+
+/*****************************************************************
+ * RESERVED RESOURCE AND CONSTANT DEFINITIONS
+ *****************************************************************/
+
+#ifndef None
+#define None                 0L	/* universal null resource or null atom */
+#endif
+
+#define ParentRelative       1L	/* background pixmap in CreateWindow
+				    and ChangeWindowAttributes */
+
+#define CopyFromParent       0L	/* border pixmap in CreateWindow
+				       and ChangeWindowAttributes
+				   special VisualID and special window
+				       class passed to CreateWindow */
+
+#define PointerWindow        0L	/* destination window in SendEvent */
+#define InputFocus           1L	/* destination window in SendEvent */
+
+#define PointerRoot          1L	/* focus window in SetInputFocus */
+
+#define AnyPropertyType      0L	/* special Atom, passed to GetProperty */
+
+#define AnyKey		     0L	/* special Key Code, passed to GrabKey */
+
+#define AnyButton            0L	/* special Button Code, passed to GrabButton */
+
+#define AllTemporary         0L	/* special Resource ID passed to KillClient */
+
+#define CurrentTime          0L	/* special Time */
+
+#define NoSymbol	     0L	/* special KeySym */
+
+/***************************************************************** 
+ * EVENT DEFINITIONS 
+ *****************************************************************/
+
+/* Input Event Masks. Used as event-mask window attribute and as arguments
+   to Grab requests.  Not to be confused with event names.  */
+
+#define NoEventMask			0L
+#define KeyPressMask			(1L<<0)  
+#define KeyReleaseMask			(1L<<1)  
+#define ButtonPressMask			(1L<<2)  
+#define ButtonReleaseMask		(1L<<3)  
+#define EnterWindowMask			(1L<<4)  
+#define LeaveWindowMask			(1L<<5)  
+#define PointerMotionMask		(1L<<6)  
+#define PointerMotionHintMask		(1L<<7)  
+#define Button1MotionMask		(1L<<8)  
+#define Button2MotionMask		(1L<<9)  
+#define Button3MotionMask		(1L<<10) 
+#define Button4MotionMask		(1L<<11) 
+#define Button5MotionMask		(1L<<12) 
+#define ButtonMotionMask		(1L<<13) 
+#define KeymapStateMask			(1L<<14)
+#define ExposureMask			(1L<<15) 
+#define VisibilityChangeMask		(1L<<16) 
+#define StructureNotifyMask		(1L<<17) 
+#define ResizeRedirectMask		(1L<<18) 
+#define SubstructureNotifyMask		(1L<<19) 
+#define SubstructureRedirectMask	(1L<<20) 
+#define FocusChangeMask			(1L<<21) 
+#define PropertyChangeMask		(1L<<22) 
+#define ColormapChangeMask		(1L<<23) 
+#define OwnerGrabButtonMask		(1L<<24) 
+
+/* Event names.  Used in "type" field in XEvent structures.  Not to be
+confused with event masks above.  They start from 2 because 0 and 1
+are reserved in the protocol for errors and replies. */
+
+#define KeyPress		2
+#define KeyRelease		3
+#define ButtonPress		4
+#define ButtonRelease		5
+#define MotionNotify		6
+#define EnterNotify		7
+#define LeaveNotify		8
+#define FocusIn			9
+#define FocusOut		10
+#define KeymapNotify		11
+#define Expose			12
+#define GraphicsExpose		13
+#define NoExpose		14
+#define VisibilityNotify	15
+#define CreateNotify		16
+#define DestroyNotify		17
+#define UnmapNotify		18
+#define MapNotify		19
+#define MapRequest		20
+#define ReparentNotify		21
+#define ConfigureNotify		22
+#define ConfigureRequest	23
+#define GravityNotify		24
+#define ResizeRequest		25
+#define CirculateNotify		26
+#define CirculateRequest	27
+#define PropertyNotify		28
+#define SelectionClear		29
+#define SelectionRequest	30
+#define SelectionNotify		31
+#define ColormapNotify		32
+#define ClientMessage		33
+#define MappingNotify		34
+#define LASTEvent		35	/* must be bigger than any event # */
+
+
+/* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
+   state in various key-, mouse-, and button-related events. */
+
+#define ShiftMask		(1<<0)
+#define LockMask		(1<<1)
+#define ControlMask		(1<<2)
+#define Mod1Mask		(1<<3)
+#define Mod2Mask		(1<<4)
+#define Mod3Mask		(1<<5)
+#define Mod4Mask		(1<<6)
+#define Mod5Mask		(1<<7)
+
+/* modifier names.  Used to build a SetModifierMapping request or
+   to read a GetModifierMapping request.  These correspond to the
+   masks defined above. */
+#define ShiftMapIndex		0
+#define LockMapIndex		1
+#define ControlMapIndex		2
+#define Mod1MapIndex		3
+#define Mod2MapIndex		4
+#define Mod3MapIndex		5
+#define Mod4MapIndex		6
+#define Mod5MapIndex		7
+
+
+/* button masks.  Used in same manner as Key masks above. Not to be confused
+   with button names below. */
+
+#define Button1Mask		(1<<8)
+#define Button2Mask		(1<<9)
+#define Button3Mask		(1<<10)
+#define Button4Mask		(1<<11)
+#define Button5Mask		(1<<12)
+
+#define AnyModifier		(1<<15)  /* used in GrabButton, GrabKey */
+
+
+/* button names. Used as arguments to GrabButton and as detail in ButtonPress
+   and ButtonRelease events.  Not to be confused with button masks above.
+   Note that 0 is already defined above as "AnyButton".  */
+
+#define Button1			1
+#define Button2			2
+#define Button3			3
+#define Button4			4
+#define Button5			5
+
+/* Notify modes */
+
+#define NotifyNormal		0
+#define NotifyGrab		1
+#define NotifyUngrab		2
+#define NotifyWhileGrabbed	3
+
+#define NotifyHint		1	/* for MotionNotify events */
+		       
+/* Notify detail */
+
+#define NotifyAncestor		0
+#define NotifyVirtual		1
+#define NotifyInferior		2
+#define NotifyNonlinear		3
+#define NotifyNonlinearVirtual	4
+#define NotifyPointer		5
+#define NotifyPointerRoot	6
+#define NotifyDetailNone	7
+
+/* Visibility notify */
+
+#define VisibilityUnobscured		0
+#define VisibilityPartiallyObscured	1
+#define VisibilityFullyObscured		2
+
+/* Circulation request */
+
+#define PlaceOnTop		0
+#define PlaceOnBottom		1
+
+/* protocol families */
+
+#define FamilyInternet		0	/* IPv4 */
+#define FamilyDECnet		1
+#define FamilyChaos		2
+#define FamilyInternet6		6	/* IPv6 */
+
+/* authentication families not tied to a specific protocol */
+#define FamilyServerInterpreted 5
+
+/* Property notification */
+
+#define PropertyNewValue	0
+#define PropertyDelete		1
+
+/* Color Map notification */
+
+#define ColormapUninstalled	0
+#define ColormapInstalled	1
+
+/* GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes */
+
+#define GrabModeSync		0
+#define GrabModeAsync		1
+
+/* GrabPointer, GrabKeyboard reply status */
+
+#define GrabSuccess		0
+#define AlreadyGrabbed		1
+#define GrabInvalidTime		2
+#define GrabNotViewable		3
+#define GrabFrozen		4
+
+/* AllowEvents modes */
+
+#define AsyncPointer		0
+#define SyncPointer		1
+#define ReplayPointer		2
+#define AsyncKeyboard		3
+#define SyncKeyboard		4
+#define ReplayKeyboard		5
+#define AsyncBoth		6
+#define SyncBoth		7
+
+/* Used in SetInputFocus, GetInputFocus */
+
+#define RevertToNone		(int)None
+#define RevertToPointerRoot	(int)PointerRoot
+#define RevertToParent		2
+
+/*****************************************************************
+ * ERROR CODES 
+ *****************************************************************/
+
+#define Success		   0	/* everything's okay */
+#define BadRequest	   1	/* bad request code */
+#define BadValue	   2	/* int parameter out of range */
+#define BadWindow	   3	/* parameter not a Window */
+#define BadPixmap	   4	/* parameter not a Pixmap */
+#define BadAtom		   5	/* parameter not an Atom */
+#define BadCursor	   6	/* parameter not a Cursor */
+#define BadFont		   7	/* parameter not a Font */
+#define BadMatch	   8	/* parameter mismatch */
+#define BadDrawable	   9	/* parameter not a Pixmap or Window */
+#define BadAccess	  10	/* depending on context:
+				 - key/button already grabbed
+				 - attempt to free an illegal 
+				   cmap entry 
+				- attempt to store into a read-only 
+				   color map entry.
+ 				- attempt to modify the access control
+				   list from other than the local host.
+				*/
+#define BadAlloc	  11	/* insufficient resources */
+#define BadColor	  12	/* no such colormap */
+#define BadGC		  13	/* parameter not a GC */
+#define BadIDChoice	  14	/* choice not in range or already used */
+#define BadName		  15	/* font or color name doesn't exist */
+#define BadLength	  16	/* Request length incorrect */
+#define BadImplementation 17	/* server is defective */
+
+#define FirstExtensionError	128
+#define LastExtensionError	255
+
+/*****************************************************************
+ * WINDOW DEFINITIONS 
+ *****************************************************************/
+
+/* Window classes used by CreateWindow */
+/* Note that CopyFromParent is already defined as 0 above */
+
+#define InputOutput		1
+#define InputOnly		2
+
+/* Window attributes for CreateWindow and ChangeWindowAttributes */
+
+#define CWBackPixmap		(1L<<0)
+#define CWBackPixel		(1L<<1)
+#define CWBorderPixmap		(1L<<2)
+#define CWBorderPixel           (1L<<3)
+#define CWBitGravity		(1L<<4)
+#define CWWinGravity		(1L<<5)
+#define CWBackingStore          (1L<<6)
+#define CWBackingPlanes	        (1L<<7)
+#define CWBackingPixel	        (1L<<8)
+#define CWOverrideRedirect	(1L<<9)
+#define CWSaveUnder		(1L<<10)
+#define CWEventMask		(1L<<11)
+#define CWDontPropagate	        (1L<<12)
+#define CWColormap		(1L<<13)
+#define CWCursor	        (1L<<14)
+
+/* ConfigureWindow structure */
+
+#define CWX			(1<<0)
+#define CWY			(1<<1)
+#define CWWidth			(1<<2)
+#define CWHeight		(1<<3)
+#define CWBorderWidth		(1<<4)
+#define CWSibling		(1<<5)
+#define CWStackMode		(1<<6)
+
+
+/* Bit Gravity */
+
+#define ForgetGravity		0
+#define NorthWestGravity	1
+#define NorthGravity		2
+#define NorthEastGravity	3
+#define WestGravity		4
+#define CenterGravity		5
+#define EastGravity		6
+#define SouthWestGravity	7
+#define SouthGravity		8
+#define SouthEastGravity	9
+#define StaticGravity		10
+
+/* Window gravity + bit gravity above */
+
+#define UnmapGravity		0
+
+/* Used in CreateWindow for backing-store hint */
+
+#define NotUseful               0
+#define WhenMapped              1
+#define Always                  2
+
+/* Used in GetWindowAttributes reply */
+
+#define IsUnmapped		0
+#define IsUnviewable		1
+#define IsViewable		2
+
+/* Used in ChangeSaveSet */
+
+#define SetModeInsert           0
+#define SetModeDelete           1
+
+/* Used in ChangeCloseDownMode */
+
+#define DestroyAll              0
+#define RetainPermanent         1
+#define RetainTemporary         2
+
+/* Window stacking method (in configureWindow) */
+
+#define Above                   0
+#define Below                   1
+#define TopIf                   2
+#define BottomIf                3
+#define Opposite                4
+
+/* Circulation direction */
+
+#define RaiseLowest             0
+#define LowerHighest            1
+
+/* Property modes */
+
+#define PropModeReplace         0
+#define PropModePrepend         1
+#define PropModeAppend          2
+
+/*****************************************************************
+ * GRAPHICS DEFINITIONS
+ *****************************************************************/
+
+/* graphics functions, as in GC.alu */
+
+#define	GXclear			0x0		/* 0 */
+#define GXand			0x1		/* src AND dst */
+#define GXandReverse		0x2		/* src AND NOT dst */
+#define GXcopy			0x3		/* src */
+#define GXandInverted		0x4		/* NOT src AND dst */
+#define	GXnoop			0x5		/* dst */
+#define GXxor			0x6		/* src XOR dst */
+#define GXor			0x7		/* src OR dst */
+#define GXnor			0x8		/* NOT src AND NOT dst */
+#define GXequiv			0x9		/* NOT src XOR dst */
+#define GXinvert		0xa		/* NOT dst */
+#define GXorReverse		0xb		/* src OR NOT dst */
+#define GXcopyInverted		0xc		/* NOT src */
+#define GXorInverted		0xd		/* NOT src OR dst */
+#define GXnand			0xe		/* NOT src OR NOT dst */
+#define GXset			0xf		/* 1 */
+
+/* LineStyle */
+
+#define LineSolid		0
+#define LineOnOffDash		1
+#define LineDoubleDash		2
+
+/* capStyle */
+
+#define CapNotLast		0
+#define CapButt			1
+#define CapRound		2
+#define CapProjecting		3
+
+/* joinStyle */
+
+#define JoinMiter		0
+#define JoinRound		1
+#define JoinBevel		2
+
+/* fillStyle */
+
+#define FillSolid		0
+#define FillTiled		1
+#define FillStippled		2
+#define FillOpaqueStippled	3
+
+/* fillRule */
+
+#define EvenOddRule		0
+#define WindingRule		1
+
+/* subwindow mode */
+
+#define ClipByChildren		0
+#define IncludeInferiors	1
+
+/* SetClipRectangles ordering */
+
+#define Unsorted		0
+#define YSorted			1
+#define YXSorted		2
+#define YXBanded		3
+
+/* CoordinateMode for drawing routines */
+
+#define CoordModeOrigin		0	/* relative to the origin */
+#define CoordModePrevious       1	/* relative to previous point */
+
+/* Polygon shapes */
+
+#define Complex			0	/* paths may intersect */
+#define Nonconvex		1	/* no paths intersect, but not convex */
+#define Convex			2	/* wholly convex */
+
+/* Arc modes for PolyFillArc */
+
+#define ArcChord		0	/* join endpoints of arc */
+#define ArcPieSlice		1	/* join endpoints to center of arc */
+
+/* GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into
+   GC.stateChanges */
+
+#define GCFunction              (1L<<0)
+#define GCPlaneMask             (1L<<1)
+#define GCForeground            (1L<<2)
+#define GCBackground            (1L<<3)
+#define GCLineWidth             (1L<<4)
+#define GCLineStyle             (1L<<5)
+#define GCCapStyle              (1L<<6)
+#define GCJoinStyle		(1L<<7)
+#define GCFillStyle		(1L<<8)
+#define GCFillRule		(1L<<9) 
+#define GCTile			(1L<<10)
+#define GCStipple		(1L<<11)
+#define GCTileStipXOrigin	(1L<<12)
+#define GCTileStipYOrigin	(1L<<13)
+#define GCFont 			(1L<<14)
+#define GCSubwindowMode		(1L<<15)
+#define GCGraphicsExposures     (1L<<16)
+#define GCClipXOrigin		(1L<<17)
+#define GCClipYOrigin		(1L<<18)
+#define GCClipMask		(1L<<19)
+#define GCDashOffset		(1L<<20)
+#define GCDashList		(1L<<21)
+#define GCArcMode		(1L<<22)
+
+#define GCLastBit		22
+/*****************************************************************
+ * FONTS 
+ *****************************************************************/
+
+/* used in QueryFont -- draw direction */
+
+#define FontLeftToRight		0
+#define FontRightToLeft		1
+
+#define FontChange		255
+
+/*****************************************************************
+ *  IMAGING 
+ *****************************************************************/
+
+/* ImageFormat -- PutImage, GetImage */
+
+#define XYBitmap		0	/* depth 1, XYFormat */
+#define XYPixmap		1	/* depth == drawable depth */
+#define ZPixmap			2	/* depth == drawable depth */
+
+/*****************************************************************
+ *  COLOR MAP STUFF 
+ *****************************************************************/
+
+/* For CreateColormap */
+
+#define AllocNone		0	/* create map with no entries */
+#define AllocAll		1	/* allocate entire map writeable */
+
+
+/* Flags used in StoreNamedColor, StoreColors */
+
+#define DoRed			(1<<0)
+#define DoGreen			(1<<1)
+#define DoBlue			(1<<2)
+
+/*****************************************************************
+ * CURSOR STUFF
+ *****************************************************************/
+
+/* QueryBestSize Class */
+
+#define CursorShape		0	/* largest size that can be displayed */
+#define TileShape		1	/* size tiled fastest */
+#define StippleShape		2	/* size stippled fastest */
+
+/***************************************************************** 
+ * KEYBOARD/POINTER STUFF
+ *****************************************************************/
+
+#define AutoRepeatModeOff	0
+#define AutoRepeatModeOn	1
+#define AutoRepeatModeDefault	2
+
+#define LedModeOff		0
+#define LedModeOn		1
+
+/* masks for ChangeKeyboardControl */
+
+#define KBKeyClickPercent	(1L<<0)
+#define KBBellPercent		(1L<<1)
+#define KBBellPitch		(1L<<2)
+#define KBBellDuration		(1L<<3)
+#define KBLed			(1L<<4)
+#define KBLedMode		(1L<<5)
+#define KBKey			(1L<<6)
+#define KBAutoRepeatMode	(1L<<7)
+
+#define MappingSuccess     	0
+#define MappingBusy        	1
+#define MappingFailed		2
+
+#define MappingModifier		0
+#define MappingKeyboard		1
+#define MappingPointer		2
+
+/*****************************************************************
+ * SCREEN SAVER STUFF 
+ *****************************************************************/
+
+#define DontPreferBlanking	0
+#define PreferBlanking		1
+#define DefaultBlanking		2
+
+#define DisableScreenSaver	0
+#define DisableScreenInterval	0
+
+#define DontAllowExposures	0
+#define AllowExposures		1
+#define DefaultExposures	2
+
+/* for ForceScreenSaver */
+
+#define ScreenSaverReset 0
+#define ScreenSaverActive 1
+
+/*****************************************************************
+ * HOSTS AND CONNECTIONS
+ *****************************************************************/
+
+/* for ChangeHosts */
+
+#define HostInsert		0
+#define HostDelete		1
+
+/* for ChangeAccessControl */
+
+#define EnableAccess		1      
+#define DisableAccess		0
+
+/* Display classes  used in opening the connection 
+ * Note that the statically allocated ones are even numbered and the
+ * dynamically changeable ones are odd numbered */
+
+#define StaticGray		0
+#define GrayScale		1
+#define StaticColor		2
+#define PseudoColor		3
+#define TrueColor		4
+#define DirectColor		5
+
+
+/* Byte order  used in imageByteOrder and bitmapBitOrder */
+
+#define LSBFirst		0
+#define MSBFirst		1
+
+#endif /* X_H */
Index: trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xalloca.h
===================================================================
--- trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xalloca.h	(revision 11548)
+++ trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xalloca.h	(revision 11548)
@@ -0,0 +1,145 @@
+/* $Xorg: Xalloca.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ */
+
+/*
+
+Copyright 1995, 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.
+
+*/
+/* $XFree86: xc/include/Xalloca.h,v 3.10 2001/12/14 19:53:25 dawes Exp $ */
+
+/*
+ * The purpose of this header is to define the macros ALLOCATE_LOCAL and
+ * DEALLOCATE_LOCAL appropriately for the platform being compiled on.
+ * These macros are used to make fast, function-local memory allocations.
+ * Their characteristics are as follows:
+ *
+ * void *ALLOCATE_LOCAL(int size)
+ *    Returns a pointer to size bytes of memory, or NULL if the allocation
+ *    failed.  The memory must be freed with DEALLOCATE_LOCAL before the
+ *    function that made the allocation returns.  You should not ask for
+ *    large blocks of memory with this function, since on many platforms
+ *    the memory comes from the stack, which may have limited size.
+ *
+ * void DEALLOCATE_LOCAL(void *)
+ *    Frees the memory allocated by ALLOCATE_LOCAL.  Omission of this
+ *    step may be harmless on some platforms, but will result in
+ *    memory leaks or worse on others.
+ *
+ * Before including this file, you should define two macros,
+ * ALLOCATE_LOCAL_FALLBACK and DEALLOCATE_LOCAL_FALLBACK, that have the
+ * same characteristics as ALLOCATE_LOCAL and DEALLOCATE_LOCAL.  The
+ * header uses the fallbacks if it doesn't know a "better" way to define
+ * ALLOCATE_LOCAL and DEALLOCATE_LOCAL.  Typical usage would be:
+ *
+ *    #define ALLOCATE_LOCAL_FALLBACK(_size) malloc(_size)
+ *    #define DEALLOCATE_LOCAL_FALLBACK(_ptr) free(_ptr)
+ *    #include "Xalloca.h"
+ */
+
+#ifndef XALLOCA_H
+#define XALLOCA_H 1
+
+#ifndef INCLUDE_ALLOCA_H
+# if defined(__SUNPRO_C)  /* Need to add more here to match Imake *.cf's */
+#  define INCLUDE_ALLOCA_H
+# endif
+#endif
+
+#ifdef INCLUDE_ALLOCA_H
+#  include <alloca.h>
+#endif
+
+#ifndef NO_ALLOCA
+/*
+ * os-dependent definition of local allocation and deallocation
+ * If you want something other than (DE)ALLOCATE_LOCAL_FALLBACK
+ * for ALLOCATE/DEALLOCATE_LOCAL then you add that in here.
+ */
+#  if defined(__HIGHC__)
+#    ifndef NCR
+       extern char *alloca();
+#      if HCVERSION < 21003
+#        define ALLOCATE_LOCAL(size)	alloca((int)(size))
+         pragma on(alloca);
+#      else /* HCVERSION >= 21003 */
+#        define	ALLOCATE_LOCAL(size)	_Alloca((int)(size))
+#      endif /* HCVERSION < 21003 */
+#    else /* NCR */
+#      define ALLOCATE_LOCAL(size)	alloca(size)
+#    endif
+#  endif /* defined(__HIGHC__) */
+
+
+#  ifdef __GNUC__
+#    ifndef alloca
+#      define alloca __builtin_alloca
+#    endif /* !alloca */
+#    define ALLOCATE_LOCAL(size) alloca((int)(size))
+#  else /* ! __GNUC__ */
+
+/*
+ * warning: old mips alloca (pre 2.10) is unusable, new one is built in
+ * Test is easy, the new one is named __builtin_alloca and comes
+ * from alloca.h which #defines alloca.
+ */
+#    ifndef NCR
+#      if defined(vax) || defined(sun) || defined(apollo) || defined(stellar) || defined(alloca)
+/*
+ * Some System V boxes extract alloca.o from /lib/libPW.a; if you
+ * decide that you don't want to use alloca, you might want to fix it here.
+ */
+/* alloca might be a macro taking one arg (hi, Sun!), so give it one. */
+#        ifndef __sgi			/* IRIX 5/6 has definition */
+#         ifndef __QNX__
+#          define __Xnullarg		/* as nothing */
+#          ifndef X_NOT_STDC_ENV
+             extern void *alloca(__Xnullarg);
+#          else
+             extern char *alloca(__Xnullarg);
+#          endif
+#         endif /* __QNX__ */
+#        endif /* __sgi */
+#        define ALLOCATE_LOCAL(size) alloca((int)(size))
+#      endif /* who does alloca */
+#    endif /* NCR */
+#  endif /* __GNUC__ */
+
+#endif /* NO_ALLOCA */
+
+#if !defined(ALLOCATE_LOCAL)
+#  if defined(ALLOCATE_LOCAL_FALLBACK) && defined(DEALLOCATE_LOCAL_FALLBACK)
+#    define ALLOCATE_LOCAL(_size)  ALLOCATE_LOCAL_FALLBACK(_size)
+#    define DEALLOCATE_LOCAL(_ptr) DEALLOCATE_LOCAL_FALLBACK(_ptr)
+#  else /* no fallbacks supplied; error */
+#    define ALLOCATE_LOCAL(_size)  ALLOCATE_LOCAL_FALLBACK undefined!
+#    define DEALLOCATE_LOCAL(_ptr) DEALLOCATE_LOCAL_FALLBACK undefined!
+#  endif /* defined(ALLOCATE_LOCAL_FALLBACK && DEALLOCATE_LOCAL_FALLBACK) */
+#else
+#  if !defined(DEALLOCATE_LOCAL)
+#    define DEALLOCATE_LOCAL(_ptr) do {} while(0)
+#  endif
+#endif /* defined(ALLOCATE_LOCAL) */
+
+#endif /* XALLOCA_H */
Index: trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xarch.h
===================================================================
--- trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xarch.h	(revision 11548)
+++ trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xarch.h	(revision 11548)
@@ -0,0 +1,126 @@
+#ifndef _XARCH_H_
+#define _XARCH_H_
+
+/*
+ * Copyright 1997 Metro Link Incorporated
+ *
+ *                           All Rights Reserved
+ *
+ * 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, and that the names of the above listed copyright holder(s)
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission.  The above listed
+ * copyright holder(s) make(s) no representations about the suitability of
+ * this software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ *
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ */
+/* $XFree86: xc/include/Xarch.h,v 1.10tsi Exp $ */
+
+
+/*
+ * Determine the machine's byte order.
+ */
+
+/* See if it is set in the imake config first */
+#ifdef X_BYTE_ORDER
+
+#define X_BIG_ENDIAN 4321
+#define X_LITTLE_ENDIAN 1234
+
+#else
+
+#ifdef SVR4
+#if defined(NCR) || defined(Mips) || defined(__sgi)
+#include <sys/endian.h>
+#else
+#if !defined(sun)
+#include <sys/byteorder.h>
+#endif
+#endif
+#elif defined(CSRG_BASED)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
+#include <sys/types.h>
+#endif
+#include <machine/endian.h>
+#elif defined(linux)
+#if defined __STRICT_ANSI__
+#undef __STRICT_ANSI__
+#include <endian.h>
+#define __STRICT_ANSI__
+#else
+#include <endian.h>
+#endif
+/* 'endian.h' might have been included before 'Xarch.h' */
+#if !defined(LITTLE_ENDIAN) && defined(__LITTLE_ENDIAN)
+#define LITTLE_ENDIAN __LITTLE_ENDIAN
+#endif
+#if !defined(BIG_ENDIAN) && defined(__BIG_ENDIAN)
+#define BIG_ENDIAN __BIG_ENDIAN
+#endif
+#if !defined(PDP_ENDIAN) && defined(__PDP_ENDIAN)
+#define PDP_ENDIAN __PDP_ENDIAN
+#endif
+#if !defined(BYTE_ORDER) && defined(__BYTE_ORDER)
+#define BYTE_ORDER __BYTE_ORDER
+#endif
+#elif defined(Lynx)
+#if 0
+/* LynxOS 2.4.0 has wrong defines in bsd/ip.h */
+#include <bsd/in.h>
+#include <bsd/in_systm.h>
+#include <bsd/ip.h>
+#endif
+#endif
+
+#ifndef BYTE_ORDER
+#define LITTLE_ENDIAN 1234
+#define BIG_ENDIAN    4321
+
+#if defined(__QNX__) && !defined(__QNXNTO__)
+#define BYTE_ORDER LITTLE_ENDIAN
+#endif
+
+#if defined(__QNXNTO__)
+#if defined(i386) || defined(__i386__) || defined(__x86__)
+#define BYTE_ORDER LITTLE_ENDIAN
+#else
+#define BYTE_ORDER BIG_ENDIAN
+#endif
+#endif
+
+#ifdef Lynx
+#if defined(i386) || defined(__i386__) || defined(__x86__)
+#define BYTE_ORDER LITTLE_ENDIAN
+#else
+#define BYTE_ORDER BIG_ENDIAN
+#endif
+#endif
+#if (defined(sun) && defined(SVR4)) && !defined(Lynx)
+#include <sys/isa_defs.h>
+#ifdef _LITTLE_ENDIAN
+#define BYTE_ORDER LITTLE_ENDIAN
+#endif
+#ifdef _BIG_ENDIAN
+#define BYTE_ORDER BIG_ENDIAN
+#endif
+#endif /* sun */
+#endif /* BYTE_ORDER */
+
+#define X_BYTE_ORDER BYTE_ORDER
+#define X_BIG_ENDIAN BIG_ENDIAN
+#define X_LITTLE_ENDIAN LITTLE_ENDIAN
+
+#endif /* not in imake config */
+
+#endif /* _XARCH_H_ */
Index: trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xdefs.h
===================================================================
--- trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xdefs.h	(revision 11548)
+++ trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xdefs.h	(revision 11548)
@@ -0,0 +1,110 @@
+/* $XFree86: xc/include/Xdefs.h,v 1.2 1999/08/22 06:21:20 dawes Exp $ */
+
+/***********************************************************
+
+Copyright (c) 1999  The XFree86 Project Inc.
+
+All Rights Reserved.
+
+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 XFree86 Project
+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 The XFree86 Project Inc..
+
+*/
+
+/**
+ ** Types definitions shared between server and clients 
+ **/
+
+#ifndef _XDEFS_H
+#define _XDEFS_H
+
+#ifdef _XSERVER64
+#include <X11/Xmd.h>
+#endif 
+
+#ifndef _XTYPEDEF_ATOM
+#  define _XTYPEDEF_ATOM
+#  ifndef _XSERVER64
+typedef unsigned long Atom;
+#  else
+typedef CARD32 Atom;
+#  endif
+#endif
+
+#ifndef Bool
+#  ifndef _XTYPEDEF_BOOL
+#   define _XTYPEDEF_BOOL
+typedef int Bool;
+#  endif
+#endif
+
+#ifndef _XTYPEDEF_POINTER
+#  define _XTYPEDEF_POINTER
+typedef void *pointer;
+#endif
+
+#ifndef _XTYPEDEF_CLIENTPTR
+typedef struct _Client *ClientPtr;
+#  define _XTYPEDEF_CLIENTPTR
+#endif
+
+#ifndef _XTYPEDEF_XID
+#  define _XTYPEDEF_XID
+#  ifndef _XSERVER64
+typedef unsigned long XID;
+#  else
+typedef CARD32 XID;
+#  endif
+#endif
+
+#ifndef _XTYPEDEF_MASK
+#  define _XTYPEDEF_MASK
+#  ifndef _XSERVER64
+typedef unsigned long Mask;
+#  else
+typedef CARD32 Mask;
+#  endif
+#endif
+
+#ifndef _XTYPEDEF_FONTPTR
+#  define _XTYPEDEF_FONTPTR
+typedef struct _Font *FontPtr; /* also in fonts/include/font.h */
+#endif
+
+#ifndef _XTYPEDEF_FONT
+#  define _XTYPEDEF_FONT
+typedef XID	Font;
+#endif
+
+#ifndef _XTYPEDEF_FSID
+#  ifndef _XSERVER64
+typedef unsigned long FSID;
+#  else
+typedef CARD32 FSID;
+#  endif
+#endif
+
+typedef FSID AccContext;
+
+/* OS independent time value 
+   XXX Should probably go in Xos.h */
+typedef struct timeval **OSTimePtr;
+
+
+typedef void (* BlockHandlerProcPtr)(pointer /* blockData */,
+				     OSTimePtr /* pTimeout */,
+				     pointer /* pReadmask */);
+
+#endif
Index: trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xfuncs.h
===================================================================
--- trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xfuncs.h	(revision 11548)
+++ trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xfuncs.h	(revision 11548)
@@ -0,0 +1,94 @@
+/*
+ * $XdotOrg: xc/include/Xfuncs.h,v 1.2 2004/04/23 18:43:05 eich Exp $
+ * $Xorg: Xfuncs.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $
+ * 
+ * 
+Copyright 1990, 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.
+ *
+ */
+/* $XFree86: xc/include/Xfuncs.h,v 3.10 2002/05/31 18:45:38 dawes Exp $ */
+
+#ifndef _XFUNCS_H_
+#define _XFUNCS_H_
+
+#include <X11/Xosdefs.h>
+
+/* the old Xfuncs.h, for pre-R6 */
+#if !(defined(XFree86LOADER) && defined(IN_MODULE))
+
+#ifdef X_USEBFUNCS
+void bcopy();
+void bzero();
+int bcmp();
+#else
+#if defined(SYSV) && !defined(__SCO__) && !defined(sun) && !defined(__UNIXWARE__)
+#include <memory.h>
+void bcopy();
+#define bzero(b,len) memset(b, 0, len)
+#define bcmp(b1,b2,len) memcmp(b1, b2, len)
+#else
+#include <string.h>
+#if defined(__SCO__) || defined(sun) || defined(__UNIXWARE__)
+#include <strings.h>
+#endif
+#define _XFUNCS_H_INCLUDED_STRING_H
+#if defined(sun)
+#define bcopy(b1,b2,len) memmove(b2, b1, (size_t)(len))
+#define bzero(b,len) memset(b, 0, (size_t)(len))
+#define bcmp(b1,b2,len) memcmp(b1, b2, (size_t)(len))
+#endif
+#endif
+#endif /* X_USEBFUNCS */
+
+/* the new Xfuncs.h */
+
+#if !defined(X_NOT_STDC_ENV) && (!defined(sun) || defined(SVR4))
+/* the ANSI C way */
+#ifndef _XFUNCS_H_INCLUDED_STRING_H
+#include <string.h>
+#endif
+#undef bzero
+#define bzero(b,len) memset(b,0,len)
+#else /* else X_NOT_STDC_ENV or SunOS 4 */
+#if defined(SYSV) || defined(luna) || defined(sun) || defined(__sxg__)
+#include <memory.h>
+#define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
+#if defined(SYSV) && defined(_XBCOPYFUNC)
+#undef memmove
+#define memmove(dst,src,len) _XBCOPYFUNC((char *)(src),(char *)(dst),(int)(len))
+#define _XNEEDBCOPYFUNC
+#endif
+#else /* else vanilla BSD */
+#define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
+#define memcpy(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
+#define memcmp(b1,b2,len) bcmp((char *)(b1),(char *)(b2),(int)(len))
+#endif /* SYSV else */
+#endif /* ! X_NOT_STDC_ENV else */
+
+#if defined(X_NOT_STDC_ENV) || (defined(sun) && !defined(SVR4))
+#define atexit(f) on_exit(f, 0)
+#endif
+
+#endif /* !(defined(XFree86LOADER) && defined(IN_MODULE)) */
+
+#endif /* _XFUNCS_H_ */
Index: trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xmd.h
===================================================================
--- trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xmd.h	(revision 11548)
+++ trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xmd.h	(revision 11548)
@@ -0,0 +1,211 @@
+/* $XdotOrg: $ */
+/* $XFree86: xc/include/Xmd.h,v 3.18tsi Exp $ */
+/***********************************************************
+
+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.
+
+******************************************************************/
+#ifndef XMD_H
+#define XMD_H 1
+/* $Xorg: Xmd.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ */
+/*
+ *  Xmd.h: MACHINE DEPENDENT DECLARATIONS.
+ */
+
+/*
+ * Special per-machine configuration flags.
+ */
+#if defined(sun) && defined(__SVR4)
+# include <sys/isa_defs.h> /* Solaris: defines _LP64 if necessary */
+#endif
+
+#ifdef CRAY
+#define WORD64				/* 64-bit architecture */
+#endif
+#if defined (_LP64) || \
+    defined(__alpha) || defined(__alpha__) || \
+    defined(__ia64__) || defined(ia64) || \
+    defined(__sparc64__) || \
+    defined(__s390x__) || \
+    (defined(__hppa__) && defined(__LP64__)) || \
+    defined(__amd64__) || defined(amd64) || \
+    defined(__powerpc64__) || \
+    (defined(sgi) && (_MIPS_SZLONG == 64))
+#define LONG64				/* 32/64-bit architecture */
+#endif
+
+/*
+ * Stuff to handle large architecture machines; the constants were generated
+ * on a 32-bit machine and must correspond to the protocol.
+ */
+#ifdef WORD64
+#define MUSTCOPY
+#endif /* WORD64 */
+
+
+/*
+ * Definition of macro used to set constants for size of network structures;
+ * machines with preprocessors that can't handle all of the sz_ symbols
+ * can define this macro to be sizeof(x) if and only if their compiler doesn't
+ * pad out structures (esp. the xTextElt structure which contains only two
+ * one-byte fields).  Network structures should always define sz_symbols.
+ *
+ * The sz_ prefix is used instead of something more descriptive so that the
+ * symbols are no more than 32 characters long (which causes problems for some
+ * compilers and preprocessors).
+ *
+ * The extra indirection in the __STDC__ case is to get macro arguments to
+ * expand correctly before the concatenation, rather than afterward.
+ */
+#if ((defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)) && !defined(UNIXCPP)) || defined(ANSICPP)
+#define _SIZEOF(x) sz_##x
+#define SIZEOF(x) _SIZEOF(x)
+#else
+#define SIZEOF(x) sz_/**/x
+#endif /* if ANSI C compiler else not */
+
+/*
+ * Bitfield suffixes for the protocol structure elements, if you
+ * need them.  Note that bitfields are not guaranteed to be signed
+ * (or even unsigned) according to ANSI C.
+ */
+#ifdef WORD64
+typedef long INT64;
+typedef unsigned long CARD64;
+#define B32 :32
+#define B16 :16
+#ifdef UNSIGNEDBITFIELDS
+typedef unsigned int INT32;
+typedef unsigned int INT16;
+#else
+#ifdef __STDC__
+typedef signed int INT32;
+typedef signed int INT16;
+#else
+typedef int INT32;
+typedef int INT16;
+#endif
+#endif
+#else
+#define B32
+#define B16
+#ifdef LONG64
+typedef long INT64;
+typedef int INT32;
+#else
+typedef long INT32;
+#endif
+typedef short INT16;
+#endif
+
+#if defined(__STDC__) || defined(sgi) || defined(_AIX)
+typedef signed char    INT8;
+#else
+typedef char           INT8;
+#endif
+
+#ifdef LONG64
+typedef unsigned long CARD64;
+typedef unsigned int CARD32;
+#else
+typedef unsigned long CARD32;
+#endif
+#if !defined(WORD64) && !defined(LONG64)
+typedef unsigned long long CARD64;
+#endif
+typedef unsigned short CARD16;
+typedef unsigned char  CARD8;
+
+typedef CARD32		BITS32;
+typedef CARD16		BITS16;
+
+#ifndef I_NEED_OS2_H
+typedef CARD8		BYTE;
+typedef CARD8		BOOL;
+#else
+#define BYTE	CARD8
+#define BOOL	CARD8
+#endif
+
+/*
+ * definitions for sign-extending bitfields on 64-bit architectures
+ */
+#if defined(WORD64) && defined(UNSIGNEDBITFIELDS)
+#define cvtINT8toInt(val)   (((val) & 0x00000080) ? ((val) | 0xffffffffffffff00) : (val))
+#define cvtINT16toInt(val)  (((val) & 0x00008000) ? ((val) | 0xffffffffffff0000) : (val))
+#define cvtINT32toInt(val)  (((val) & 0x80000000) ? ((val) | 0xffffffff00000000) : (val))
+#define cvtINT8toShort(val)  cvtINT8toInt(val)
+#define cvtINT16toShort(val) cvtINT16toInt(val)
+#define cvtINT32toShort(val) cvtINT32toInt(val)
+#define cvtINT8toLong(val)  cvtINT8toInt(val)
+#define cvtINT16toLong(val) cvtINT16toInt(val)
+#define cvtINT32toLong(val) cvtINT32toInt(val)
+#else
+#define cvtINT8toInt(val) (val)
+#define cvtINT16toInt(val) (val)
+#define cvtINT32toInt(val) (val)
+#define cvtINT8toShort(val) (val)
+#define cvtINT16toShort(val) (val)
+#define cvtINT32toShort(val) (val)
+#define cvtINT8toLong(val) (val)
+#define cvtINT16toLong(val) (val)
+#define cvtINT32toLong(val) (val)
+#endif /* WORD64 and UNSIGNEDBITFIELDS */
+
+
+
+#ifdef MUSTCOPY
+/*
+ * This macro must not cast or else pointers will get aligned and be wrong
+ */
+#define NEXTPTR(p,t)  (((char *) p) + SIZEOF(t))
+#else /* else not MUSTCOPY, this is used for 32-bit machines */
+/*
+ * this version should leave result of type (t *), but that should only be
+ * used when not in MUSTCOPY
+ */
+#define NEXTPTR(p,t) (((t *)(p)) + 1)
+#endif /* MUSTCOPY - used machines whose C structs don't line up with proto */
+
+#endif /* XMD_H */
Index: trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xosdefs.h
===================================================================
--- trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xosdefs.h	(revision 11548)
+++ trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xosdefs.h	(revision 11548)
@@ -0,0 +1,166 @@
+/*
+ * O/S-dependent (mis)feature macro definitions
+ *
+ * $XdotOrg: xc/include/Xosdefs.h,v 1.3 2005/04/28 22:04:12 alanc Exp $
+ * $Xorg: Xosdefs.h,v 1.5 2001/02/09 02:03:23 xorgcvs Exp $
+ *
+Copyright 1991, 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.
+ */
+/* $XFree86: xc/include/Xosdefs.h,v 3.20 2002/05/31 18:45:39 dawes Exp $ */
+
+#ifndef _XOSDEFS_H_
+#define _XOSDEFS_H_
+
+/*
+ * X_NOT_STDC_ENV means does not have ANSI C header files.  Lack of this
+ * symbol does NOT mean that the system has stdarg.h.
+ *
+ * X_NOT_POSIX means does not have POSIX header files.  Lack of this
+ * symbol does NOT mean that the POSIX environment is the default.
+ * You may still have to define _POSIX_SOURCE to get it.
+ */
+
+#ifdef NOSTDHDRS
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+
+#ifdef sony
+#if !defined(SYSTYPE_SYSV) && !defined(_SYSTYPE_SYSV)
+#define X_NOT_POSIX
+#endif
+#endif
+
+#ifdef UTEK
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+
+#ifdef vax
+#ifndef ultrix			/* assume vanilla BSD */
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+#endif
+
+#ifdef luna
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+
+#ifdef Mips
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+  
+#ifdef USL
+#ifdef SYSV /* (release 3.2) */
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+#endif
+
+#ifdef _SCO_DS
+#ifndef __SCO__
+#define __SCO__
+#endif
+#endif
+
+#ifdef i386
+#ifdef SYSV
+#if !defined(ISC) && !defined(__SCO__) && !defined(_SEQUENT_) && \
+	!defined(__UNIXWARE__) && !defined(sun)
+#if !defined(_POSIX_SOURCE)
+#define X_NOT_POSIX
+#endif
+#define X_NOT_STDC_ENV
+#endif
+#endif
+#endif
+
+#ifdef MOTOROLA
+#ifdef SYSV
+#define X_NOT_STDC_ENV
+#endif
+#endif
+
+#ifdef sun
+/* Imake configs define SVR4 on Solaris, but cc & gcc only define __SVR4
+ * This check allows non-Imake configured programs to build correctly.
+ */
+#if defined(__SVR4) && !defined(SVR4)
+#define SVR4 1
+#endif
+#ifdef SVR4
+/* define this to whatever it needs to be */
+#define X_POSIX_C_SOURCE 199300L
+#endif
+#endif
+
+#ifdef WIN32
+#ifndef _POSIX_
+#define X_NOT_POSIX
+#endif
+#endif
+
+#if defined(nec_ews_svr2) || defined(SX) || defined(PC_UX)
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+
+#ifdef __UNIXOS2__
+#define USGISH
+#define NULL_NOT_ZERO
+#endif
+
+#ifdef __DARWIN__
+#define NULL_NOT_ZERO
+#endif
+
+#ifdef __GNU__
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 4096
+#endif
+#endif
+
+#if defined(__SCO__) || defined(__UNIXWARE__)
+# ifndef PATH_MAX
+#  define PATH_MAX	1024
+# endif
+# ifndef MAXPATHLEN
+#  define MAXPATHLEN	1024
+# endif
+#endif
+
+#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) \
+	|| defined(__Darwin__) || defined(__DragonFly__)
+# ifndef CSRG_BASED
+#  define CSRG_BASED
+# endif
+#endif
+
+#endif /* _XOSDEFS_H_ */
+
Index: trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xproto.h
===================================================================
--- trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xproto.h	(revision 11548)
+++ trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xproto.h	(revision 11548)
@@ -0,0 +1,2134 @@
+/*
+ *	$Xorg: Xproto.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $
+ */
+
+/* Definitions for the X window system used by server and c bindings */
+
+/*
+ * This packet-construction scheme makes the following assumptions:
+ *
+ * 1. The compiler is able
+ * to generate code which addresses one- and two-byte quantities.
+ * In the worst case, this would be done with bit-fields.  If bit-fields
+ * are used it may be necessary to reorder the request fields in this file,
+ * depending on the order in which the machine assigns bit fields to
+ * machine words.  There may also be a problem with sign extension,
+ * as K+R specify that bitfields are always unsigned.
+ *
+ * 2. 2- and 4-byte fields in packet structures must be ordered by hand
+ * such that they are naturally-aligned, so that no compiler will ever
+ * insert padding bytes.
+ *
+ * 3. All packets are hand-padded to a multiple of 4 bytes, for
+ * the same reason.
+ */
+
+#ifndef XPROTO_H
+#define XPROTO_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.
+
+******************************************************************/
+
+#include <X11/Xmd.h>
+#include <X11/Xprotostr.h>
+
+/*
+ * Define constants for the sizes of the network packets.  The sz_ prefix is
+ * used instead of something more descriptive so that the symbols are no more
+ * than 32 characters in length (which causes problems for some compilers).
+ */
+#define sz_xSegment 8
+#define sz_xPoint 4
+#define sz_xRectangle 8
+#define sz_xArc 12
+#define sz_xConnClientPrefix 12
+#define sz_xConnSetupPrefix 8
+#define sz_xConnSetup 32
+#define sz_xPixmapFormat 8
+#define sz_xDepth 8
+#define sz_xVisualType 24
+#define sz_xWindowRoot 40
+#define sz_xTimecoord 8
+#define sz_xHostEntry 4
+#define sz_xCharInfo 12
+#define sz_xFontProp 8
+#define sz_xTextElt 2
+#define sz_xColorItem 12
+#define sz_xrgb 8
+#define sz_xGenericReply 32
+#define sz_xGetWindowAttributesReply 44
+#define sz_xGetGeometryReply 32
+#define sz_xQueryTreeReply 32
+#define sz_xInternAtomReply 32
+#define sz_xGetAtomNameReply 32
+#define sz_xGetPropertyReply 32
+#define sz_xListPropertiesReply 32
+#define sz_xGetSelectionOwnerReply 32
+#define sz_xGrabPointerReply 32
+#define sz_xQueryPointerReply 32
+#define sz_xGetMotionEventsReply 32
+#define sz_xTranslateCoordsReply 32
+#define sz_xGetInputFocusReply 32
+#define sz_xQueryKeymapReply 40
+#define sz_xQueryFontReply 60
+#define sz_xQueryTextExtentsReply 32
+#define sz_xListFontsReply 32
+#define sz_xGetFontPathReply 32
+#define sz_xGetImageReply 32
+#define sz_xListInstalledColormapsReply 32
+#define sz_xAllocColorReply 32
+#define sz_xAllocNamedColorReply 32
+#define sz_xAllocColorCellsReply 32
+#define sz_xAllocColorPlanesReply 32
+#define sz_xQueryColorsReply 32
+#define sz_xLookupColorReply 32
+#define sz_xQueryBestSizeReply 32
+#define sz_xQueryExtensionReply 32
+#define sz_xListExtensionsReply 32
+#define sz_xSetMappingReply 32
+#define sz_xGetKeyboardControlReply 52
+#define sz_xGetPointerControlReply 32
+#define sz_xGetScreenSaverReply 32
+#define sz_xListHostsReply 32
+#define sz_xSetModifierMappingReply 32
+#define sz_xError 32
+#define sz_xEvent 32
+#define sz_xKeymapEvent 32
+#define sz_xReq 4
+#define sz_xResourceReq 8
+#define sz_xCreateWindowReq 32
+#define sz_xChangeWindowAttributesReq 12
+#define sz_xChangeSaveSetReq 8
+#define sz_xReparentWindowReq 16
+#define sz_xConfigureWindowReq 12
+#define sz_xCirculateWindowReq 8
+#define sz_xInternAtomReq 8
+#define sz_xChangePropertyReq 24
+#define sz_xDeletePropertyReq 12
+#define sz_xGetPropertyReq 24
+#define sz_xSetSelectionOwnerReq 16
+#define sz_xConvertSelectionReq 24
+#define sz_xSendEventReq 44
+#define sz_xGrabPointerReq 24
+#define sz_xGrabButtonReq 24
+#define sz_xUngrabButtonReq 12
+#define sz_xChangeActivePointerGrabReq 16
+#define sz_xGrabKeyboardReq 16
+#define sz_xGrabKeyReq 16
+#define sz_xUngrabKeyReq 12
+#define sz_xAllowEventsReq 8
+#define sz_xGetMotionEventsReq 16
+#define sz_xTranslateCoordsReq 16
+#define sz_xWarpPointerReq 24
+#define sz_xSetInputFocusReq 12
+#define sz_xOpenFontReq 12
+#define sz_xQueryTextExtentsReq 8
+#define sz_xListFontsReq 8
+#define sz_xSetFontPathReq 8
+#define sz_xCreatePixmapReq 16
+#define sz_xCreateGCReq 16
+#define sz_xChangeGCReq 12
+#define sz_xCopyGCReq 16
+#define sz_xSetDashesReq 12
+#define sz_xSetClipRectanglesReq 12
+#define sz_xCopyAreaReq 28
+#define sz_xCopyPlaneReq 32
+#define sz_xPolyPointReq 12
+#define sz_xPolySegmentReq 12
+#define sz_xFillPolyReq 16
+#define sz_xPutImageReq 24
+#define sz_xGetImageReq 20
+#define sz_xPolyTextReq 16
+#define sz_xImageTextReq 16
+#define sz_xCreateColormapReq 16
+#define sz_xCopyColormapAndFreeReq 12
+#define sz_xAllocColorReq 16
+#define sz_xAllocNamedColorReq 12
+#define sz_xAllocColorCellsReq 12
+#define sz_xAllocColorPlanesReq 16
+#define sz_xFreeColorsReq 12
+#define sz_xStoreColorsReq 8
+#define sz_xStoreNamedColorReq 16
+#define sz_xQueryColorsReq 8
+#define sz_xLookupColorReq 12
+#define sz_xCreateCursorReq 32
+#define sz_xCreateGlyphCursorReq 32
+#define sz_xRecolorCursorReq 20
+#define sz_xQueryBestSizeReq 12
+#define sz_xQueryExtensionReq 8
+#define sz_xChangeKeyboardControlReq 8
+#define sz_xBellReq 4
+#define sz_xChangePointerControlReq 12
+#define sz_xSetScreenSaverReq 12
+#define sz_xChangeHostsReq 8
+#define sz_xListHostsReq 4
+#define sz_xChangeModeReq 4
+#define sz_xRotatePropertiesReq 12
+#define sz_xReply 32
+#define sz_xGrabKeyboardReply 32
+#define sz_xListFontsWithInfoReply 60
+#define sz_xSetPointerMappingReply 32
+#define sz_xGetKeyboardMappingReply 32
+#define sz_xGetPointerMappingReply 32
+#define sz_xGetModifierMappingReply 32
+#define sz_xListFontsWithInfoReq 8
+#define sz_xPolyLineReq 12
+#define sz_xPolyArcReq 12
+#define sz_xPolyRectangleReq 12
+#define sz_xPolyFillRectangleReq 12
+#define sz_xPolyFillArcReq 12
+#define sz_xPolyText8Req 16
+#define sz_xPolyText16Req 16
+#define sz_xImageText8Req 16
+#define sz_xImageText16Req 16
+#define sz_xSetPointerMappingReq 4
+#define sz_xForceScreenSaverReq 4
+#define sz_xSetCloseDownModeReq 4
+#define sz_xClearAreaReq 16
+#define sz_xSetAccessControlReq 4
+#define sz_xGetKeyboardMappingReq 8
+#define sz_xSetModifierMappingReq 4
+#define sz_xPropIconSize 24
+#define sz_xChangeKeyboardMappingReq 8
+
+
+/* For the purpose of the structure definitions in this file,
+we must redefine the following types in terms of Xmd.h's types, which may
+include bit fields.  All of these are #undef'd at the end of this file,
+restoring the definitions in X.h.  */
+
+#define Window CARD32
+#define Drawable CARD32
+#define Font CARD32
+#define Pixmap CARD32
+#define Cursor CARD32
+#define Colormap CARD32
+#define GContext CARD32
+#define Atom CARD32
+#define VisualID CARD32
+#define Time CARD32
+#define KeyCode CARD8
+#define KeySym CARD32
+
+#define X_TCP_PORT 6000     /* add display number */
+
+#define xTrue        1
+#define xFalse       0
+
+
+typedef CARD16 KeyButMask;
+
+/***************** 
+   connection setup structure.  This is followed by
+   numRoots xWindowRoot structs.
+*****************/
+
+typedef struct {
+    CARD8	byteOrder;
+    BYTE	pad;
+    CARD16	majorVersion B16, minorVersion B16;
+    CARD16	nbytesAuthProto B16;	/* Authorization protocol */
+    CARD16	nbytesAuthString B16;	/* Authorization string */
+    CARD16	pad2 B16;
+} xConnClientPrefix;
+
+typedef struct {
+    CARD8          success;
+    BYTE           lengthReason; /*num bytes in string following if failure */
+    CARD16         majorVersion B16, 
+                   minorVersion B16;
+    CARD16         length B16;  /* 1/4 additional bytes in setup info */
+} xConnSetupPrefix;
+
+
+typedef struct {
+    CARD32         release B32;
+    CARD32         ridBase B32, 
+                   ridMask B32;
+    CARD32         motionBufferSize B32;
+    CARD16         nbytesVendor B16;  /* number of bytes in vendor string */
+    CARD16         maxRequestSize B16;
+    CARD8          numRoots;          /* number of roots structs to follow */
+    CARD8          numFormats;        /* number of pixmap formats */
+    CARD8          imageByteOrder;        /* LSBFirst, MSBFirst */
+    CARD8          bitmapBitOrder;        /* LeastSignificant, MostSign...*/
+    CARD8          bitmapScanlineUnit,     /* 8, 16, 32 */
+                   bitmapScanlinePad;     /* 8, 16, 32 */
+    KeyCode	   minKeyCode, maxKeyCode;
+    CARD32	   pad2 B32;
+} xConnSetup;
+
+typedef struct {
+    CARD8          depth;
+    CARD8          bitsPerPixel;
+    CARD8          scanLinePad;
+    CARD8          pad1;
+    CARD32	   pad2 B32;
+} xPixmapFormat;
+
+/* window root */
+
+typedef struct {
+    CARD8 	depth;
+    CARD8 	pad1;
+    CARD16	nVisuals B16;  /* number of xVisualType structures following */
+    CARD32	pad2 B32;
+    } xDepth;
+
+typedef struct {
+    VisualID visualID B32;
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8 c_class;
+#else
+    CARD8 class;
+#endif
+    CARD8 bitsPerRGB;
+    CARD16 colormapEntries B16;
+    CARD32 redMask B32, greenMask B32, blueMask B32;
+    CARD32 pad B32;
+    } xVisualType;
+
+typedef struct {
+    Window         windowId B32;
+    Colormap       defaultColormap B32;
+    CARD32         whitePixel B32, blackPixel B32;
+    CARD32         currentInputMask B32;   
+    CARD16         pixWidth B16, pixHeight B16;
+    CARD16         mmWidth B16, mmHeight B16;
+    CARD16         minInstalledMaps B16, maxInstalledMaps B16;
+    VisualID       rootVisualID B32;
+    CARD8          backingStore;
+    BOOL           saveUnders;
+    CARD8          rootDepth;
+    CARD8          nDepths;  /* number of xDepth structures following */
+} xWindowRoot;
+
+
+
+/*****************************************************************
+ * Structure Defns
+ *   Structures needed for replies 
+ *****************************************************************/
+
+/* Used in GetMotionEvents */
+
+typedef struct {
+    CARD32 time B32;
+    INT16 x B16, y B16;
+} xTimecoord;
+
+typedef struct {
+    CARD8 family;
+    BYTE pad;
+    CARD16 length B16;
+} xHostEntry;
+
+typedef struct {
+    INT16 leftSideBearing B16,
+	  rightSideBearing B16,
+	  characterWidth B16,
+	  ascent B16,
+	  descent B16;
+    CARD16 attributes B16;
+} xCharInfo;
+
+typedef struct {
+    Atom name B32;
+    CARD32 value B32;
+} xFontProp;
+
+/*
+ * non-aligned big-endian font ID follows this struct
+ */
+typedef struct {           /* followed by string */
+    CARD8 len;	/* number of *characters* in string, or FontChange (255)
+		   for font change, or 0 if just delta given */
+    INT8 delta;
+} xTextElt;
+
+
+typedef struct {        
+    CARD32 pixel B32;
+    CARD16 red B16, green B16, blue B16;
+    CARD8 flags;  /* DoRed, DoGreen, DoBlue booleans */
+    CARD8 pad;
+} xColorItem;
+
+
+typedef struct {
+    CARD16 red B16, green B16, blue B16, pad B16;
+} xrgb;
+
+typedef CARD8 KEYCODE;
+
+
+
+/*****************
+ * XRep:
+ *    meant to be 32 byte quantity 
+ *****************/
+
+/* GenericReply is the common format of all replies.  The "data" items
+   are specific to each individual reply type. */
+
+typedef struct {	
+    BYTE type;              /* X_Reply */
+    BYTE data1;             /* depends on reply type */
+    CARD16 sequenceNumber B16;  /* of last request received by server */
+    CARD32 length B32;      /* 4 byte quantities beyond size of GenericReply */
+    CARD32 data00 B32;
+    CARD32 data01 B32;
+    CARD32 data02 B32;
+    CARD32 data03 B32;
+    CARD32 data04 B32;
+    CARD32 data05 B32;
+    } xGenericReply;
+
+/* Individual reply formats. */
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    CARD8 backingStore;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;	/* NOT 0; this is an extra-large reply */
+    VisualID visualID B32;
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD16 c_class B16;
+#else
+    CARD16 class B16;
+#endif
+    CARD8 bitGravity;
+    CARD8 winGravity;
+    CARD32 backingBitPlanes B32;
+    CARD32 backingPixel B32;
+    BOOL saveUnder;
+    BOOL mapInstalled;
+    CARD8 mapState;
+    BOOL override;
+    Colormap colormap B32;
+    CARD32 allEventMasks B32;
+    CARD32 yourEventMask B32;
+    CARD16 doNotPropagateMask B16;
+    CARD16 pad B16;
+    } xGetWindowAttributesReply;
+
+typedef struct {
+    BYTE type;   /* X_Reply */
+    CARD8 depth;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 0 */
+    Window root B32;
+    INT16 x B16, y B16;
+    CARD16 width B16, height B16;
+    CARD16 borderWidth B16;
+    CARD16 pad1 B16;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    } xGetGeometryReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    Window root B32, parent B32;
+    CARD16 nChildren B16;
+    CARD16 pad2 B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    } xQueryTreeReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32; /* 0 */
+    Atom atom B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    } xInternAtomReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* of additional bytes */
+    CARD16 nameLength B16;  /* # of characters in name */
+    CARD16 pad2 B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xGetAtomNameReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    CARD8 format;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32; /* of additional bytes */
+    Atom propertyType B32;
+    CARD32 bytesAfter B32;
+    CARD32 nItems B32; /* # of 8, 16, or 32-bit entities in reply */
+    CARD32 pad1 B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    } xGetPropertyReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD16 nProperties B16;
+    CARD16 pad2 B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xListPropertiesReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 0 */
+    Window owner B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    } xGetSelectionOwnerReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE status;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 0 */
+    CARD32 pad1 B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    } xGrabPointerReply;
+
+typedef xGrabPointerReply xGrabKeyboardReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BOOL sameScreen;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 0 */
+    Window root B32, child B32;
+    INT16 rootX B16, rootY B16, winX B16, winY B16;
+    CARD16 mask B16;
+    CARD16 pad1 B16;
+    CARD32 pad B32;
+    } xQueryPointerReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD32 nEvents B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    } xGetMotionEventsReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BOOL sameScreen;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32; /* 0 */
+    Window child B32;
+    INT16 dstX B16, dstY B16;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    } xTranslateCoordsReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    CARD8 revertTo;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 0 */
+    Window focus B32;
+    CARD32 pad1 B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    } xGetInputFocusReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 2, NOT 0; this is an extra-large reply */
+    BYTE map[32];
+    } xQueryKeymapReply;
+
+/* Warning: this MUST match (up to component renaming) xListFontsWithInfoReply */
+typedef struct _xQueryFontReply {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* definitely > 0, even if "nCharInfos" is 0 */
+    xCharInfo minBounds; 
+#ifndef WORD64
+    CARD32 walign1 B32;
+#endif
+    xCharInfo maxBounds; 
+#ifndef WORD64
+    CARD32 walign2 B32;
+#endif
+    CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;
+    CARD16 defaultChar B16;
+    CARD16 nFontProps B16;  /* followed by this many xFontProp structures */
+    CARD8 drawDirection;
+    CARD8 minByte1, maxByte1;
+    BOOL allCharsExist;
+    INT16 fontAscent B16, fontDescent B16;
+    CARD32 nCharInfos B32; /* followed by this many xCharInfo structures */
+} xQueryFontReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    CARD8 drawDirection;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 0 */
+    INT16 fontAscent B16, fontDescent B16;
+    INT16 overallAscent B16, overallDescent B16;
+    INT32 overallWidth B32, overallLeft B32, overallRight B32;
+    CARD32 pad B32;
+    } xQueryTextExtentsReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD16 nFonts B16;
+    CARD16 pad2 B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xListFontsReply;
+
+/* Warning: this MUST match (up to component renaming) xQueryFontReply */
+typedef struct {
+    BYTE type;  /* X_Reply */
+    CARD8 nameLength;  /* 0 indicates end-of-reply-sequence */
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* definitely > 0, even if "nameLength" is 0 */
+    xCharInfo minBounds; 
+#ifndef WORD64
+    CARD32 walign1 B32;
+#endif
+    xCharInfo maxBounds; 
+#ifndef WORD64
+    CARD32 walign2 B32;
+#endif
+    CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;
+    CARD16 defaultChar B16;
+    CARD16 nFontProps B16;  /* followed by this many xFontProp structures */
+    CARD8 drawDirection;
+    CARD8 minByte1, maxByte1;
+    BOOL allCharsExist;
+    INT16 fontAscent B16, fontDescent B16;
+    CARD32 nReplies B32;   /* hint as to how many more replies might be coming */
+} xListFontsWithInfoReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD16 nPaths B16;
+    CARD16 pad2 B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xGetFontPathReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    CARD8 depth;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    VisualID visual B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xGetImageReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD16 nColormaps B16;
+    CARD16 pad2 B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xListInstalledColormapsReply;
+
+typedef struct {
+    BYTE type; /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;   /* 0 */
+    CARD16 red B16, green B16, blue B16;
+    CARD16 pad2 B16;
+    CARD32 pixel B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    } xAllocColorReply;
+
+typedef struct {
+    BYTE type; /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 0 */
+    CARD32 pixel B32;
+    CARD16 exactRed B16, exactGreen B16, exactBlue B16;
+    CARD16 screenRed B16, screenGreen B16, screenBlue B16;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    } xAllocNamedColorReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD16 nPixels B16, nMasks B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xAllocColorCellsReply;
+
+typedef struct {
+    BYTE type; /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD16 nPixels B16;
+    CARD16 pad2 B16;
+    CARD32 redMask B32, greenMask B32, blueMask B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    } xAllocColorPlanesReply;
+
+typedef struct {
+    BYTE type; /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD16 nColors B16;
+    CARD16 pad2 B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xQueryColorsReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 0 */
+    CARD16 exactRed B16, exactGreen B16, exactBlue B16;
+    CARD16 screenRed B16, screenGreen B16, screenBlue B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    } xLookupColorReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 0 */
+    CARD16 width B16, height B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xQueryBestSizeReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32; /* 0 */
+    BOOL  present;
+    CARD8 major_opcode;
+    CARD8 first_event;
+    CARD8 first_error;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xQueryExtensionReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    CARD8 nExtensions;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xListExtensionsReply;
+
+
+typedef struct {
+    BYTE   type;  /* X_Reply */
+    CARD8  success;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xSetMappingReply;
+typedef xSetMappingReply xSetPointerMappingReply;
+typedef xSetMappingReply xSetModifierMappingReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    CARD8 nElts;  /* how many elements does the map have */
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xGetPointerMappingReply;
+
+typedef struct {
+    BYTE type;
+    CARD8 keySymsPerKeyCode;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+} xGetKeyboardMappingReply;    
+
+typedef struct {
+    BYTE type;
+    CARD8 numKeyPerModifier;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD32 pad1 B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+} xGetModifierMappingReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BOOL globalAutoRepeat;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 5 */
+    CARD32 ledMask B32;
+    CARD8 keyClickPercent, bellPercent;
+    CARD16 bellPitch B16, bellDuration B16;
+    CARD16 pad B16;
+    BYTE map[32];  /* bit masks start here */
+    } xGetKeyboardControlReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 0 */
+    CARD16 accelNumerator B16, accelDenominator B16;
+    CARD16 threshold B16;
+    CARD16 pad2 B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    } xGetPointerControlReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 0 */
+    CARD16 timeout B16, interval B16;
+    BOOL preferBlanking;
+    BOOL allowExposures;
+    CARD16 pad2 B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    } xGetScreenSaverReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BOOL enabled;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD16 nHosts B16;
+    CARD16 pad1 B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xListHostsReply;
+
+
+
+
+
+/*****************************************************************
+ * Xerror
+ *    All errors  are 32 bytes 
+ *****************************************************************/
+
+typedef struct {
+    BYTE type;                  /* X_Error */
+    BYTE errorCode;
+    CARD16 sequenceNumber B16;       /* the nth request from this client */
+    CARD32 resourceID B32;
+    CARD16 minorCode B16;
+    CARD8 majorCode;
+    BYTE pad1;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+} xError;
+
+/*****************************************************************
+ * xEvent
+ *    All events are 32 bytes
+ *****************************************************************/
+
+typedef struct _xEvent {
+    union {
+	struct {
+	    BYTE type;
+	    BYTE detail;
+	    CARD16 sequenceNumber B16;
+	    } u;
+	struct {
+            CARD32 pad00 B32;
+	    Time time B32;
+	    Window root B32, event B32, child B32;
+	    INT16 rootX B16, rootY B16, eventX B16, eventY B16;
+	    KeyButMask state B16;
+	    BOOL sameScreen;		
+	    BYTE pad1;
+	} keyButtonPointer;
+	struct {
+            CARD32 pad00 B32;
+            Time time B32;
+	    Window root B32, event B32, child B32;
+	    INT16 rootX B16, rootY B16, eventX B16, eventY B16;
+	    KeyButMask state B16;
+	    BYTE mode; 			/* really XMode */
+	    BYTE flags;		/* sameScreen and focus booleans, packed together */
+#define ELFlagFocus        (1<<0)
+#define ELFlagSameScreen   (1<<1)
+	} enterLeave;
+	struct {
+            CARD32 pad00 B32;
+	    Window window B32;
+	    BYTE mode; 			/* really XMode */
+	    BYTE pad1, pad2, pad3;
+	} focus;
+	struct {
+            CARD32 pad00 B32;
+	    Window window B32;
+	    CARD16 x B16, y B16, width B16, height B16;
+	    CARD16 count B16;
+	    CARD16 pad2 B16;
+	} expose;
+	struct {
+            CARD32 pad00 B32;
+	    Drawable drawable B32;
+	    CARD16 x B16, y B16, width B16, height B16;
+	    CARD16 minorEvent B16;
+	    CARD16 count B16;
+	    BYTE majorEvent;
+	    BYTE pad1, pad2, pad3;
+	} graphicsExposure;
+	struct {
+            CARD32 pad00 B32;
+	    Drawable drawable B32;
+	    CARD16 minorEvent B16;
+	    BYTE majorEvent;
+	    BYTE bpad;
+	} noExposure;
+	struct {
+            CARD32 pad00 B32;
+	    Window window B32;
+	    CARD8 state;
+	    BYTE pad1, pad2, pad3;
+	} visibility;
+	struct {
+            CARD32 pad00 B32;
+	    Window parent B32, window B32;
+	    INT16 x B16, y B16;
+	    CARD16 width B16, height B16, borderWidth B16;
+	    BOOL override;
+	    BYTE bpad;
+        } createNotify;
+/*
+ * The event fields in the structures for DestroyNotify, UnmapNotify,
+ * MapNotify, ReparentNotify, ConfigureNotify, CirculateNotify, GravityNotify,
+ * must be at the same offset because server internal code is depending upon
+ * this to patch up the events before they are delivered.
+ * Also note that MapRequest, ConfigureRequest and CirculateRequest have
+ * the same offset for the event window.
+ */
+	struct {
+            CARD32 pad00 B32;
+	    Window event B32, window B32;
+	} destroyNotify;
+	struct {
+            CARD32 pad00 B32;
+	    Window event B32, window B32;
+	    BOOL fromConfigure;
+	    BYTE pad1, pad2, pad3;
+        } unmapNotify;
+	struct {
+            CARD32 pad00 B32;
+	    Window event B32, window B32;
+	    BOOL override;
+	    BYTE pad1, pad2, pad3;
+        } mapNotify;
+	struct {
+            CARD32 pad00 B32;
+	    Window parent B32, window B32;
+        } mapRequest;
+	struct {
+            CARD32 pad00 B32;
+	    Window event B32, window B32, parent B32;
+	    INT16 x B16, y B16;
+	    BOOL override;
+	    BYTE pad1, pad2, pad3;
+	} reparent;
+	struct {
+            CARD32 pad00 B32;
+	    Window event B32, window B32, aboveSibling B32;
+	    INT16 x B16, y B16;
+	    CARD16 width B16, height B16, borderWidth B16;
+	    BOOL override;		
+	    BYTE bpad;
+	} configureNotify;
+	struct {
+            CARD32 pad00 B32;
+	    Window parent B32, window B32, sibling B32;
+	    INT16 x B16, y B16;
+	    CARD16 width B16, height B16, borderWidth B16;
+	    CARD16 valueMask B16;
+	    CARD32 pad1 B32;
+	} configureRequest;
+	struct {
+            CARD32 pad00 B32;
+	    Window event B32, window B32;
+	    INT16 x B16, y B16;
+	    CARD32 pad1 B32, pad2 B32, pad3 B32, pad4 B32;
+	} gravity;
+	struct {
+            CARD32 pad00 B32;
+	    Window window B32;
+	    CARD16 width B16, height B16;
+	} resizeRequest;
+	struct {
+/* The event field in the circulate record is really the parent when this
+   is used as a CirculateRequest instead of a CirculateNotify */
+            CARD32 pad00 B32;
+	    Window event B32, window B32, parent B32;
+	    BYTE place;			/* Top or Bottom */
+	    BYTE pad1, pad2, pad3;
+	} circulate;
+	struct {
+            CARD32 pad00 B32;
+	    Window window B32;
+	    Atom atom B32;
+	    Time time B32;
+	    BYTE state;			/* NewValue or Deleted */
+	    BYTE pad1;
+	    CARD16 pad2 B16;
+	} property;
+	struct {
+            CARD32 pad00 B32;
+            Time time B32;     
+	    Window window B32;
+	    Atom atom B32;
+	} selectionClear;
+	struct {
+            CARD32 pad00 B32;
+            Time time B32;    
+	    Window owner B32, requestor B32;
+	    Atom selection B32, target B32, property B32;
+	} selectionRequest;
+	struct {
+            CARD32 pad00 B32;
+            Time time B32;   
+	    Window requestor B32;
+	    Atom selection B32, target B32, property B32;
+	} selectionNotify;
+	struct {
+            CARD32 pad00 B32;
+	    Window window B32;
+	    Colormap colormap B32;
+#if defined(__cplusplus) || defined(c_plusplus)
+	    BOOL c_new;
+#else
+	    BOOL new;
+#endif
+	    BYTE state;			/* Installed or UnInstalled */
+	    BYTE pad1, pad2;
+	} colormap;
+	struct {
+	    CARD32 pad00 B32;
+	    CARD8 request;
+	    KeyCode firstKeyCode;
+	    CARD8 count;
+	    BYTE pad1;
+	} mappingNotify;
+	struct {
+            CARD32 pad00 B32;
+	    Window window B32;
+	    union {
+		struct {
+		    Atom type B32;
+		    INT32 longs0 B32;
+		    INT32 longs1 B32;
+		    INT32 longs2 B32;
+		    INT32 longs3 B32;
+		    INT32 longs4 B32;
+		} l;
+		struct {
+		    Atom type B32;
+		    INT16 shorts0 B16;
+		    INT16 shorts1 B16;
+		    INT16 shorts2 B16;
+		    INT16 shorts3 B16;
+		    INT16 shorts4 B16;
+		    INT16 shorts5 B16;
+		    INT16 shorts6 B16;
+		    INT16 shorts7 B16;
+		    INT16 shorts8 B16;
+		    INT16 shorts9 B16;
+		} s;
+		struct {
+		    Atom type B32;
+		    INT8 bytes[20];
+		} b;
+	    } u; 
+	} clientMessage;
+    } u;
+} xEvent;
+
+/* KeymapNotify events are not included in the above union because they
+   are different from all other events: they do not have a "detail"
+   or "sequenceNumber", so there is room for a 248-bit key mask. */
+
+typedef struct {
+    BYTE type;
+    BYTE map[31];
+    } xKeymapEvent;
+
+#define XEventSize (sizeof(xEvent))
+
+/* XReply is the union of all the replies above whose "fixed part"
+fits in 32 bytes.  It does NOT include GetWindowAttributesReply,
+QueryFontReply, QueryKeymapReply, or GetKeyboardControlReply 
+ListFontsWithInfoReply */
+
+typedef union {
+    xGenericReply generic;
+    xGetGeometryReply geom;
+    xQueryTreeReply tree;
+    xInternAtomReply atom;
+    xGetAtomNameReply atomName;
+    xGetPropertyReply property;
+    xListPropertiesReply listProperties;
+    xGetSelectionOwnerReply selection;
+    xGrabPointerReply grabPointer;
+    xGrabKeyboardReply grabKeyboard;
+    xQueryPointerReply pointer;
+    xGetMotionEventsReply motionEvents;
+    xTranslateCoordsReply coords;
+    xGetInputFocusReply inputFocus;
+    xQueryTextExtentsReply textExtents;
+    xListFontsReply fonts;
+    xGetFontPathReply fontPath;
+    xGetImageReply image;
+    xListInstalledColormapsReply colormaps;
+    xAllocColorReply allocColor;
+    xAllocNamedColorReply allocNamedColor;
+    xAllocColorCellsReply colorCells;
+    xAllocColorPlanesReply colorPlanes;
+    xQueryColorsReply colors;
+    xLookupColorReply lookupColor;
+    xQueryBestSizeReply bestSize;
+    xQueryExtensionReply extension;
+    xListExtensionsReply extensions;
+    xSetModifierMappingReply setModifierMapping;
+    xGetModifierMappingReply getModifierMapping;
+    xSetPointerMappingReply setPointerMapping;
+    xGetKeyboardMappingReply getKeyboardMapping;
+    xGetPointerMappingReply getPointerMapping;
+    xGetPointerControlReply pointerControl;
+    xGetScreenSaverReply screenSaver;
+    xListHostsReply hosts;
+    xError error;
+    xEvent event;
+} xReply;
+
+
+
+
+/*****************************************************************
+ * REQUESTS
+ *****************************************************************/
+
+
+/* Request structure */
+
+typedef struct _xReq {
+	CARD8 reqType;
+	CARD8 data;            /* meaning depends on request type */
+	CARD16 length B16;         /* length in 4 bytes quantities 
+				  of whole request, including this header */
+} xReq;
+
+/*****************************************************************
+ *  structures that follow request. 
+ *****************************************************************/
+
+/* ResourceReq is used for any request which has a resource ID 
+   (or Atom or Time) as its one and only argument.  */
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    CARD32 id B32;  /* a Window, Drawable, Font, GContext, Pixmap, etc. */
+    } xResourceReq;
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 depth;
+    CARD16 length B16;
+    Window wid B32, parent B32;
+    INT16 x B16, y B16;
+    CARD16 width B16, height B16, borderWidth B16;  
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD16 c_class B16;
+#else
+    CARD16 class B16;
+#endif
+    VisualID visual B32;
+    CARD32 mask B32;
+} xCreateWindowReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Window window B32;
+    CARD32 valueMask B32; 
+} xChangeWindowAttributesReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE mode;
+    CARD16 length B16;
+    Window window B32;
+} xChangeSaveSetReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Window window B32, parent B32;
+    INT16 x B16, y B16;
+} xReparentWindowReq;
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 pad;
+    CARD16 length B16;
+    Window window B32;
+    CARD16 mask B16;
+    CARD16 pad2 B16;
+} xConfigureWindowReq;
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 direction;
+    CARD16 length B16;
+    Window window B32;
+} xCirculateWindowReq;
+
+typedef struct {    /* followed by padded string */
+    CARD8 reqType;
+    BOOL onlyIfExists;
+    CARD16 length B16;
+    CARD16 nbytes  B16;    /* number of bytes in string */
+    CARD16 pad B16;
+} xInternAtomReq;
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 mode;
+    CARD16 length B16;
+    Window window B32;
+    Atom property B32, type B32;
+    CARD8 format;
+    BYTE pad[3];
+    CARD32 nUnits B32;     /* length of stuff following, depends on format */
+} xChangePropertyReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Window window B32;
+    Atom property B32;
+} xDeletePropertyReq;
+
+typedef struct {
+    CARD8 reqType;
+#if defined(__cplusplus) || defined(c_plusplus)
+    BOOL c_delete;
+#else
+    BOOL delete;
+#endif
+    CARD16 length B16;
+    Window window B32;
+    Atom property B32, type B32;
+    CARD32 longOffset B32;
+    CARD32 longLength B32;
+} xGetPropertyReq;
+ 
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Window window B32;
+    Atom selection B32;
+    Time time B32;
+} xSetSelectionOwnerReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Window requestor B32;
+    Atom selection B32, target B32, property B32;
+    Time time B32;
+    } xConvertSelectionReq;
+
+typedef struct {
+    CARD8 reqType;
+    BOOL propagate;
+    CARD16 length B16;
+    Window destination B32;
+    CARD32 eventMask B32;
+#ifdef WORD64
+    /* the structure should have been quad-aligned */
+    BYTE eventdata[SIZEOF(xEvent)];
+#else
+    xEvent event;
+#endif /* WORD64 */
+} xSendEventReq;
+
+typedef struct {
+    CARD8 reqType;
+    BOOL ownerEvents;
+    CARD16 length B16;
+    Window grabWindow B32;
+    CARD16 eventMask B16;
+    BYTE pointerMode, keyboardMode;
+    Window confineTo B32;
+    Cursor cursor B32;
+    Time time B32;
+} xGrabPointerReq;
+
+typedef struct {
+    CARD8 reqType;
+    BOOL ownerEvents;
+    CARD16 length B16;
+    Window grabWindow B32;
+    CARD16 eventMask B16;
+    BYTE pointerMode, keyboardMode;
+    Window confineTo B32;
+    Cursor cursor B32;
+    CARD8 button;
+    BYTE pad;
+    CARD16 modifiers B16;
+} xGrabButtonReq;
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 button;
+    CARD16 length B16;
+    Window grabWindow B32;
+    CARD16 modifiers B16;
+    CARD16 pad B16;
+} xUngrabButtonReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Cursor cursor B32;
+    Time time B32;
+    CARD16 eventMask B16;
+    CARD16 pad2 B16;
+} xChangeActivePointerGrabReq;
+
+typedef struct {
+    CARD8 reqType;
+    BOOL ownerEvents;
+    CARD16 length B16;
+    Window grabWindow B32;
+    Time time B32;
+    BYTE pointerMode, keyboardMode;  
+    CARD16 pad B16;
+} xGrabKeyboardReq;
+
+typedef struct {
+    CARD8 reqType;
+    BOOL ownerEvents;
+    CARD16 length B16;
+    Window grabWindow B32;
+    CARD16 modifiers B16;
+    CARD8 key;
+    BYTE pointerMode, keyboardMode;  
+    BYTE pad1, pad2, pad3;
+} xGrabKeyReq;
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 key;
+    CARD16 length B16;
+    Window grabWindow B32;
+    CARD16 modifiers B16;
+    CARD16 pad B16;
+} xUngrabKeyReq;
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 mode;
+    CARD16 length B16;
+    Time time B32;
+} xAllowEventsReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Window window B32;
+    Time start B32, stop B32;
+} xGetMotionEventsReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Window srcWid B32, dstWid B32;
+    INT16 srcX B16, srcY B16;
+} xTranslateCoordsReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Window srcWid B32, dstWid B32;
+    INT16 srcX B16, srcY B16;
+    CARD16 srcWidth B16, srcHeight B16;
+    INT16 dstX B16, dstY B16;
+} xWarpPointerReq;
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 revertTo;
+    CARD16 length B16;
+    Window focus B32;
+    Time time B32;
+} xSetInputFocusReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Font fid B32;
+    CARD16 nbytes B16;
+    BYTE pad1, pad2;	/* string follows on word boundary */
+} xOpenFontReq;
+
+typedef struct {
+    CARD8 reqType;
+    BOOL oddLength;
+    CARD16 length B16;
+    Font fid B32;
+    } xQueryTextExtentsReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    CARD16 maxNames B16;
+    CARD16 nbytes B16;  /* followed immediately by string bytes */
+} xListFontsReq;
+
+typedef xListFontsReq xListFontsWithInfoReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    CARD16 nFonts B16;
+    BYTE pad1, pad2;	/* LISTofSTRING8 follows on word boundary */
+} xSetFontPathReq;
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 depth;
+    CARD16 length B16;
+    Pixmap pid B32;
+    Drawable drawable B32;
+    CARD16 width B16, height B16;
+} xCreatePixmapReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    GContext gc B32;
+    Drawable drawable B32;
+    CARD32 mask B32;
+} xCreateGCReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    GContext gc B32;
+    CARD32 mask B32;
+} xChangeGCReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    GContext srcGC B32, dstGC B32;
+    CARD32 mask B32;
+} xCopyGCReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    GContext gc B32;
+    CARD16 dashOffset B16;
+    CARD16 nDashes B16;        /* length LISTofCARD8 of values following */
+} xSetDashesReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE ordering;
+    CARD16 length B16;
+    GContext gc B32;
+    INT16 xOrigin B16, yOrigin B16;
+} xSetClipRectanglesReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BOOL exposures;
+    CARD16 length B16;
+    Window window B32;
+    INT16 x B16, y B16;
+    CARD16 width B16, height B16;
+} xClearAreaReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Drawable srcDrawable B32, dstDrawable B32;
+    GContext gc B32;
+    INT16 srcX B16, srcY B16, dstX B16, dstY B16;
+    CARD16 width B16, height B16;
+} xCopyAreaReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Drawable srcDrawable B32, dstDrawable B32;
+    GContext gc B32;
+    INT16 srcX B16, srcY B16, dstX B16, dstY B16;
+    CARD16 width B16, height B16;
+    CARD32 bitPlane B32;
+} xCopyPlaneReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE coordMode;
+    CARD16 length B16;
+    Drawable drawable B32;
+    GContext gc B32;
+} xPolyPointReq;    
+
+typedef xPolyPointReq xPolyLineReq;  /* same request structure */
+
+/* The following used for PolySegment, PolyRectangle, PolyArc, PolyFillRectangle, PolyFillArc */
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Drawable drawable B32;
+    GContext gc B32;
+} xPolySegmentReq;    
+
+typedef xPolySegmentReq xPolyArcReq;
+typedef xPolySegmentReq xPolyRectangleReq;
+typedef xPolySegmentReq xPolyFillRectangleReq;
+typedef xPolySegmentReq xPolyFillArcReq;
+
+typedef struct _FillPolyReq {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Drawable drawable B32;
+    GContext gc B32;
+    BYTE shape;
+    BYTE coordMode;
+    CARD16 pad1 B16;
+} xFillPolyReq;    
+
+
+typedef struct _PutImageReq {
+    CARD8 reqType;
+    CARD8 format;
+    CARD16 length B16;
+    Drawable drawable B32;
+    GContext gc B32;
+    CARD16 width B16, height B16;
+    INT16 dstX B16, dstY B16;
+    CARD8 leftPad;
+    CARD8 depth;
+    CARD16 pad B16;
+} xPutImageReq;    
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 format;
+    CARD16 length B16;
+    Drawable drawable B32;
+    INT16 x B16, y B16;
+    CARD16 width B16, height B16;
+    CARD32 planeMask B32;
+} xGetImageReq;    
+
+/* the following used by PolyText8 and PolyText16 */
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 pad;
+    CARD16 length B16;
+    Drawable drawable B32;
+    GContext gc B32;
+    INT16 x B16, y B16;		/* items (xTextElt) start after struct */
+} xPolyTextReq;    
+
+typedef xPolyTextReq xPolyText8Req;
+typedef xPolyTextReq xPolyText16Req;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE nChars;
+    CARD16 length B16;
+    Drawable drawable B32;
+    GContext gc B32;
+    INT16 x B16, y B16;
+} xImageTextReq;    
+
+typedef xImageTextReq xImageText8Req;
+typedef xImageTextReq xImageText16Req;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE alloc;
+    CARD16 length B16;
+    Colormap mid B32;
+    Window window B32;
+    VisualID visual B32;
+} xCreateColormapReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Colormap mid B32;
+    Colormap srcCmap B32;
+} xCopyColormapAndFreeReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Colormap cmap B32;
+    CARD16 red B16, green B16, blue B16;
+    CARD16 pad2 B16;
+} xAllocColorReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Colormap cmap B32;
+    CARD16 nbytes B16;  /* followed by structure */
+    BYTE pad1, pad2;
+} xAllocNamedColorReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BOOL contiguous;
+    CARD16 length B16;
+    Colormap cmap B32;
+    CARD16 colors B16, planes B16;
+} xAllocColorCellsReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BOOL contiguous;
+    CARD16 length B16;
+    Colormap cmap B32;
+    CARD16 colors B16, red B16, green B16, blue B16;
+} xAllocColorPlanesReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Colormap cmap B32;
+    CARD32 planeMask B32;
+} xFreeColorsReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Colormap cmap B32;
+} xStoreColorsReq;    
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 flags;   /* DoRed, DoGreen, DoBlue, as in xColorItem */
+    CARD16 length B16;
+    Colormap cmap B32;
+    CARD32 pixel B32;
+    CARD16 nbytes B16;  /* number of name string bytes following structure */
+    BYTE pad1, pad2;
+    } xStoreNamedColorReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Colormap cmap B32;
+} xQueryColorsReq;    
+
+typedef struct {    /* followed  by string of length len */
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Colormap cmap B32;
+    CARD16 nbytes B16;  /* number of string bytes following structure*/
+    BYTE pad1, pad2;
+} xLookupColorReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Cursor cid B32;
+    Pixmap source B32, mask B32;
+    CARD16 foreRed B16, foreGreen B16, foreBlue B16;
+    CARD16 backRed B16, backGreen B16, backBlue B16;
+    CARD16 x B16, y B16;
+} xCreateCursorReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Cursor cid B32;
+    Font source B32, mask B32;
+    CARD16 sourceChar B16, maskChar B16;
+    CARD16 foreRed B16, foreGreen B16, foreBlue B16;
+    CARD16 backRed B16, backGreen B16, backBlue B16;
+} xCreateGlyphCursorReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Cursor cursor B32;
+    CARD16 foreRed B16, foreGreen B16, foreBlue B16;
+    CARD16 backRed B16, backGreen B16, backBlue B16;
+} xRecolorCursorReq;    
+
+typedef struct {
+    CARD8 reqType;
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8 c_class;
+#else
+    CARD8 class;
+#endif
+    CARD16 length B16;
+    Drawable drawable B32;
+    CARD16 width B16, height B16;
+} xQueryBestSizeReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    CARD16 nbytes B16;  /* number of string bytes following structure */
+    BYTE pad1, pad2;
+} xQueryExtensionReq;
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   numKeyPerModifier;
+    CARD16  length B16;
+} xSetModifierMappingReq;
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 nElts;  /* how many elements in the map */
+    CARD16 length B16;
+} xSetPointerMappingReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    KeyCode firstKeyCode;
+    CARD8 count;
+    CARD16 pad1 B16;
+} xGetKeyboardMappingReq;    
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 keyCodes;
+    CARD16 length B16;
+    KeyCode firstKeyCode;
+    CARD8 keySymsPerKeyCode;
+    CARD16 pad1 B16;
+} xChangeKeyboardMappingReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    CARD32 mask B32;
+} xChangeKeyboardControlReq;    
+
+typedef struct {
+    CARD8 reqType;
+    INT8 percent;  /* -100 to 100 */
+    CARD16 length B16;
+} xBellReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    INT16 accelNum B16, accelDenum B16;
+    INT16 threshold B16;             
+    BOOL doAccel, doThresh;
+} xChangePointerControlReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    INT16 timeout B16, interval B16;
+    BYTE preferBlank, allowExpose;  
+    CARD16 pad2 B16;
+} xSetScreenSaverReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE mode;
+    CARD16 length B16;
+    CARD8 hostFamily;
+    BYTE pad;
+    CARD16 hostLength B16;
+} xChangeHostsReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    } xListHostsReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE mode;
+    CARD16 length B16;
+    } xChangeModeReq;
+
+typedef xChangeModeReq xSetAccessControlReq;
+typedef xChangeModeReq xSetCloseDownModeReq;
+typedef xChangeModeReq xForceScreenSaverReq;
+
+typedef struct { /* followed by LIST of ATOM */
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Window window B32;
+    CARD16 nAtoms B16;
+    INT16 nPositions B16;
+    } xRotatePropertiesReq;
+    
+
+
+
+/* Reply codes */
+
+#define X_Reply		1		/* Normal reply */
+#define X_Error		0		/* Error */
+
+/* Request codes */
+
+#define X_CreateWindow                  1              
+#define X_ChangeWindowAttributes        2        
+#define X_GetWindowAttributes           3     
+#define X_DestroyWindow                 4
+#define X_DestroySubwindows             5   
+#define X_ChangeSaveSet                 6
+#define X_ReparentWindow                7
+#define X_MapWindow                     8
+#define X_MapSubwindows                 9
+#define X_UnmapWindow                  10
+#define X_UnmapSubwindows              11  
+#define X_ConfigureWindow              12  
+#define X_CirculateWindow              13  
+#define X_GetGeometry                  14
+#define X_QueryTree                    15
+#define X_InternAtom                   16
+#define X_GetAtomName                  17
+#define X_ChangeProperty               18 
+#define X_DeleteProperty               19 
+#define X_GetProperty                  20
+#define X_ListProperties               21 
+#define X_SetSelectionOwner            22    
+#define X_GetSelectionOwner            23    
+#define X_ConvertSelection             24   
+#define X_SendEvent                    25
+#define X_GrabPointer                  26
+#define X_UngrabPointer                27
+#define X_GrabButton                   28
+#define X_UngrabButton                 29
+#define X_ChangeActivePointerGrab      30          
+#define X_GrabKeyboard                 31
+#define X_UngrabKeyboard               32 
+#define X_GrabKey                      33
+#define X_UngrabKey                    34
+#define X_AllowEvents                  35       
+#define X_GrabServer                   36      
+#define X_UngrabServer                 37        
+#define X_QueryPointer                 38        
+#define X_GetMotionEvents              39           
+#define X_TranslateCoords              40                
+#define X_WarpPointer                  41       
+#define X_SetInputFocus                42         
+#define X_GetInputFocus                43         
+#define X_QueryKeymap                  44       
+#define X_OpenFont                     45    
+#define X_CloseFont                    46     
+#define X_QueryFont                    47
+#define X_QueryTextExtents             48     
+#define X_ListFonts                    49  
+#define X_ListFontsWithInfo    	       50 
+#define X_SetFontPath                  51 
+#define X_GetFontPath                  52 
+#define X_CreatePixmap                 53        
+#define X_FreePixmap                   54      
+#define X_CreateGC                     55    
+#define X_ChangeGC                     56    
+#define X_CopyGC                       57  
+#define X_SetDashes                    58     
+#define X_SetClipRectangles            59             
+#define X_FreeGC                       60  
+#define X_ClearArea                    61             
+#define X_CopyArea                     62    
+#define X_CopyPlane                    63     
+#define X_PolyPoint                    64     
+#define X_PolyLine                     65    
+#define X_PolySegment                  66       
+#define X_PolyRectangle                67         
+#define X_PolyArc                      68   
+#define X_FillPoly                     69    
+#define X_PolyFillRectangle            70             
+#define X_PolyFillArc                  71       
+#define X_PutImage                     72    
+#define X_GetImage                     73 
+#define X_PolyText8                    74     
+#define X_PolyText16                   75      
+#define X_ImageText8                   76      
+#define X_ImageText16                  77       
+#define X_CreateColormap               78          
+#define X_FreeColormap                 79        
+#define X_CopyColormapAndFree          80               
+#define X_InstallColormap              81           
+#define X_UninstallColormap            82             
+#define X_ListInstalledColormaps       83                  
+#define X_AllocColor                   84      
+#define X_AllocNamedColor              85           
+#define X_AllocColorCells              86           
+#define X_AllocColorPlanes             87            
+#define X_FreeColors                   88      
+#define X_StoreColors                  89       
+#define X_StoreNamedColor              90           
+#define X_QueryColors                  91       
+#define X_LookupColor                  92       
+#define X_CreateCursor                 93        
+#define X_CreateGlyphCursor            94             
+#define X_FreeCursor                   95      
+#define X_RecolorCursor                96         
+#define X_QueryBestSize                97         
+#define X_QueryExtension               98          
+#define X_ListExtensions               99          
+#define X_ChangeKeyboardMapping        100
+#define X_GetKeyboardMapping           101
+#define X_ChangeKeyboardControl        102                
+#define X_GetKeyboardControl           103             
+#define X_Bell                         104
+#define X_ChangePointerControl         105
+#define X_GetPointerControl            106
+#define X_SetScreenSaver               107          
+#define X_GetScreenSaver               108          
+#define X_ChangeHosts                  109       
+#define X_ListHosts                    110     
+#define X_SetAccessControl             111               
+#define X_SetCloseDownMode             112
+#define X_KillClient                   113 
+#define X_RotateProperties	       114
+#define X_ForceScreenSaver	       115
+#define X_SetPointerMapping            116
+#define X_GetPointerMapping            117
+#define X_SetModifierMapping	       118
+#define X_GetModifierMapping	       119
+#define X_NoOperation                  127
+
+/* restore these definitions back to the typedefs in X.h */
+#undef Window
+#undef Drawable
+#undef Font
+#undef Pixmap
+#undef Cursor
+#undef Colormap
+#undef GContext
+#undef Atom
+#undef VisualID
+#undef Time
+#undef KeyCode
+#undef KeySym
+
+#endif /* XPROTO_H */
Index: trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xprotostr.h
===================================================================
--- trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xprotostr.h	(revision 11548)
+++ trunk/src/VBox/Additions/x11/x11include/1.3/X11/Xprotostr.h	(revision 11548)
@@ -0,0 +1,78 @@
+/* $Xorg: Xprotostr.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */
+#ifndef XPROTOSTRUCTS_H
+#define XPROTOSTRUCTS_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.
+
+******************************************************************/
+#include <X11/Xmd.h>
+
+/* Used by PolySegment */
+
+typedef struct _xSegment {
+    INT16 x1 B16, y1 B16, x2 B16, y2 B16;
+} xSegment;
+
+/* POINT */
+
+typedef struct _xPoint {
+	INT16		x B16, y B16;
+} xPoint;
+
+typedef struct _xRectangle {
+    INT16 x B16, y B16;
+    CARD16  width B16, height B16;
+} xRectangle;
+
+/*  ARC  */
+
+typedef struct _xArc {
+    INT16 x B16, y B16;
+    CARD16   width B16, height B16;
+    INT16   angle1 B16, angle2 B16;
+} xArc;
+
+#endif /* XPROTOSTRUCTS_H */
Index: trunk/src/VBox/Additions/x11/x11include/1.4/X11/extensions/XI.h
===================================================================
--- trunk/src/VBox/Additions/x11/x11include/1.4/X11/extensions/XI.h	(revision 11548)
+++ trunk/src/VBox/Additions/x11/x11include/1.4/X11/extensions/XI.h	(revision 11548)
@@ -0,0 +1,287 @@
+/* $Xorg: XI.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */
+
+/************************************************************
+
+Copyright 1989, 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 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+			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 Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD 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.
+
+********************************************************/
+/* $XFree86: xc/include/extensions/XI.h,v 1.4 2001/01/17 17:53:16 dawes Exp $ */
+
+/* Definitions used by the server, library and client */
+
+#ifndef _XI_H_
+
+#define _XI_H_
+
+#define sz_xGetExtensionVersionReq		8
+#define sz_xGetExtensionVersionReply		32
+#define sz_xListInputDevicesReq			4
+#define sz_xListInputDevicesReply		32
+#define sz_xOpenDeviceReq			8
+#define sz_xOpenDeviceReply			32
+#define sz_xCloseDeviceReq			8
+#define sz_xSetDeviceModeReq			8
+#define sz_xSetDeviceModeReply			32
+#define sz_xSelectExtensionEventReq		12
+#define sz_xGetSelectedExtensionEventsReq	8
+#define sz_xGetSelectedExtensionEventsReply	32
+#define sz_xChangeDeviceDontPropagateListReq	12
+#define sz_xGetDeviceDontPropagateListReq	8
+#define sz_xGetDeviceDontPropagateListReply	32
+#define sz_xGetDeviceMotionEventsReq		16
+#define sz_xGetDeviceMotionEventsReply		32
+#define sz_xChangeKeyboardDeviceReq		8
+#define sz_xChangeKeyboardDeviceReply		32
+#define sz_xChangePointerDeviceReq		8
+#define sz_xChangePointerDeviceReply		32
+#define sz_xGrabDeviceReq			20
+#define sz_xGrabDeviceReply			32
+#define sz_xUngrabDeviceReq			12
+#define sz_xGrabDeviceKeyReq			20
+#define sz_xGrabDeviceKeyReply			32
+#define sz_xUngrabDeviceKeyReq			16
+#define sz_xGrabDeviceButtonReq			20
+#define sz_xGrabDeviceButtonReply		32
+#define sz_xUngrabDeviceButtonReq		16
+#define sz_xAllowDeviceEventsReq		12
+#define sz_xGetDeviceFocusReq			8
+#define sz_xGetDeviceFocusReply			32
+#define sz_xSetDeviceFocusReq			16
+#define sz_xGetFeedbackControlReq		8
+#define sz_xGetFeedbackControlReply		32
+#define sz_xChangeFeedbackControlReq		12
+#define sz_xGetDeviceKeyMappingReq		8
+#define sz_xGetDeviceKeyMappingReply		32
+#define sz_xChangeDeviceKeyMappingReq		8
+#define sz_xGetDeviceModifierMappingReq		8
+#define sz_xSetDeviceModifierMappingReq		8
+#define sz_xSetDeviceModifierMappingReply	32
+#define sz_xGetDeviceButtonMappingReq		8
+#define sz_xGetDeviceButtonMappingReply		32
+#define sz_xSetDeviceButtonMappingReq		8
+#define sz_xSetDeviceButtonMappingReply		32
+#define sz_xQueryDeviceStateReq			8
+#define sz_xQueryDeviceStateReply		32
+#define sz_xSendExtensionEventReq		16
+#define sz_xDeviceBellReq			8
+#define sz_xSetDeviceValuatorsReq		8
+#define sz_xSetDeviceValuatorsReply		32
+#define sz_xGetDeviceControlReq			8
+#define sz_xGetDeviceControlReply		32
+#define sz_xChangeDeviceControlReq		8
+#define sz_xChangeDeviceControlReply		32
+
+#define INAME 			"XInputExtension"
+
+#define XI_KEYBOARD	"KEYBOARD"
+#define XI_MOUSE	"MOUSE"
+#define XI_TABLET	"TABLET"
+#define XI_TOUCHSCREEN	"TOUCHSCREEN"
+#define XI_TOUCHPAD	"TOUCHPAD"
+#define XI_BARCODE	"BARCODE"
+#define XI_BUTTONBOX	"BUTTONBOX"
+#define XI_KNOB_BOX	"KNOB_BOX"
+#define XI_ONE_KNOB	"ONE_KNOB"
+#define XI_NINE_KNOB	"NINE_KNOB"
+#define XI_TRACKBALL	"TRACKBALL"
+#define XI_QUADRATURE	"QUADRATURE"
+#define XI_ID_MODULE	"ID_MODULE"
+#define XI_SPACEBALL	"SPACEBALL"
+#define XI_DATAGLOVE	"DATAGLOVE"
+#define XI_EYETRACKER	"EYETRACKER"
+#define XI_CURSORKEYS	"CURSORKEYS"
+#define XI_FOOTMOUSE	"FOOTMOUSE"
+
+#define Dont_Check			0
+#define XInput_Initial_Release		1
+#define XInput_Add_XDeviceBell		2
+#define XInput_Add_XSetDeviceValuators	3
+#define XInput_Add_XChangeDeviceControl	4
+#define XInput_Add_DevicePresenceNotify	5
+
+#define XI_Absent		0
+#define XI_Present		1
+
+#define XI_Initial_Release_Major		1
+#define XI_Initial_Release_Minor		0
+
+#define XI_Add_XDeviceBell_Major		1
+#define XI_Add_XDeviceBell_Minor		1
+
+#define XI_Add_XSetDeviceValuators_Major	1
+#define XI_Add_XSetDeviceValuators_Minor	2
+
+#define XI_Add_XChangeDeviceControl_Major	1
+#define XI_Add_XChangeDeviceControl_Minor	3
+
+#define XI_Add_DevicePresenceNotify_Major	1
+#define XI_Add_DevicePresenceNotify_Minor	4
+
+#define DEVICE_RESOLUTION	1
+#define DEVICE_ABS_CALIB        2
+#define DEVICE_CORE             3
+#define DEVICE_ENABLE           4
+#define DEVICE_ABS_AREA         5
+
+#define NoSuchExtension		1
+
+#define COUNT			0
+#define CREATE			1
+
+#define NewPointer		0
+#define NewKeyboard		1
+
+#define XPOINTER		0
+#define XKEYBOARD		1
+
+#define UseXKeyboard		0xFF
+
+#define IsXPointer		0
+#define IsXKeyboard		1
+#define IsXExtensionDevice	2
+#define IsXExtensionKeyboard    3
+#define IsXExtensionPointer     4
+
+#define AsyncThisDevice		0
+#define SyncThisDevice		1
+#define ReplayThisDevice	2
+#define AsyncOtherDevices	3
+#define AsyncAll		4
+#define SyncAll			5
+
+#define FollowKeyboard 		3
+#ifndef RevertToFollowKeyboard
+#define RevertToFollowKeyboard 	3
+#endif
+
+#define DvAccelNum              (1L << 0)
+#define DvAccelDenom            (1L << 1)
+#define DvThreshold             (1L << 2)
+
+#define DvKeyClickPercent	(1L<<0)
+#define DvPercent		(1L<<1)
+#define DvPitch			(1L<<2)
+#define DvDuration		(1L<<3)
+#define DvLed			(1L<<4)
+#define DvLedMode		(1L<<5)
+#define DvKey			(1L<<6)
+#define DvAutoRepeatMode	(1L<<7)
+
+#define DvString                (1L << 0)
+
+#define DvInteger               (1L << 0)
+
+#define DeviceMode              (1L << 0)
+#define Relative                0
+#define Absolute                1
+
+#define ProximityState          (1L << 1)
+#define InProximity             (0L << 1)
+#define OutOfProximity          (1L << 1)
+
+#define AddToList               0
+#define DeleteFromList          1
+
+#define KeyClass  		0
+#define ButtonClass  		1
+#define ValuatorClass  		2
+#define FeedbackClass  		3
+#define ProximityClass  	4
+#define FocusClass  		5
+#define OtherClass  		6
+
+#define KbdFeedbackClass  	0
+#define PtrFeedbackClass  	1
+#define StringFeedbackClass  	2
+#define IntegerFeedbackClass  	3
+#define LedFeedbackClass  	4
+#define BellFeedbackClass  	5
+
+#define _devicePointerMotionHint 0
+#define _deviceButton1Motion	 1
+#define _deviceButton2Motion	 2
+#define _deviceButton3Motion	 3
+#define _deviceButton4Motion	 4
+#define _deviceButton5Motion	 5
+#define _deviceButtonMotion	 6
+#define _deviceButtonGrab	 7
+#define _deviceOwnerGrabButton	 8
+#define _noExtensionEvent	 9
+
+#define _devicePresence		 0
+
+#define DeviceAdded              0
+#define DeviceRemoved            1
+#define DeviceEnabled            2
+#define DeviceDisabled           3
+#define DeviceUnrecoverable      4  
+
+#define XI_BadDevice	0
+#define XI_BadEvent	1
+#define XI_BadMode	2
+#define XI_DeviceBusy	3
+#define XI_BadClass	4
+
+/* Make XEventClass be a CARD32 for 64 bit servers.  Don't affect client
+ * definition of XEventClass since that would be a library interface change.
+ * See the top of X.h for more _XSERVER64 magic.
+ */
+#ifdef _XSERVER64
+typedef	CARD32		XEventClass;
+#else
+typedef	unsigned long	XEventClass;
+#endif
+
+/*******************************************************************
+ *
+ * Extension version structure.
+ *
+ */
+
+typedef struct {
+        int   	present;
+        short	major_version;
+        short	minor_version;
+} XExtensionVersion;
+
+#endif /* _XI_H_ */
Index: trunk/src/VBox/Additions/x11/x11include/1.4/X11/extensions/XInput.h
===================================================================
--- trunk/src/VBox/Additions/x11/x11include/1.4/X11/extensions/XInput.h	(revision 11548)
+++ trunk/src/VBox/Additions/x11/x11include/1.4/X11/extensions/XInput.h	(revision 11548)
@@ -0,0 +1,1200 @@
+/* $Xorg: XInput.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */
+
+/************************************************************
+
+Copyright 1989, 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 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+			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 Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD 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.
+
+********************************************************/
+/* $XFree86: xc/include/extensions/XInput.h,v 1.3 2001/12/14 19:53:28 dawes Exp $ */
+
+/* Definitions used by the library and client */
+
+#ifndef _XINPUT_H_
+#define _XINPUT_H_
+
+#include <X11/Xlib.h>
+#include <X11/extensions/XI.h>
+
+#define _deviceKeyPress		0
+#define _deviceKeyRelease	1
+
+#define _deviceButtonPress	0
+#define _deviceButtonRelease	1
+
+#define _deviceMotionNotify	0
+
+#define _deviceFocusIn		0
+#define _deviceFocusOut		1
+
+#define _proximityIn		0
+#define _proximityOut		1
+
+#define _deviceStateNotify	0
+#define _deviceMappingNotify	1
+#define _changeDeviceNotify	2
+
+#define FindTypeAndClass(d,type,_class,classid,offset) \
+    { int _i; XInputClassInfo *_ip; \
+    type = 0; _class = 0; \
+    for (_i=0, _ip= ((XDevice *) d)->classes; \
+	 _i< ((XDevice *) d)->num_classes; \
+	 _i++, _ip++) \
+	if (_ip->input_class == classid) \
+	    {type =  _ip->event_type_base + offset; \
+	     _class =  ((XDevice *) d)->device_id << 8 | type;}}
+
+#define DeviceKeyPress(d,type,_class) \
+    FindTypeAndClass(d, type, _class, KeyClass, _deviceKeyPress)
+
+#define DeviceKeyRelease(d,type,_class) \
+    FindTypeAndClass(d, type, _class, KeyClass, _deviceKeyRelease)
+
+#define DeviceButtonPress(d,type,_class) \
+    FindTypeAndClass(d, type, _class, ButtonClass, _deviceButtonPress)
+
+#define DeviceButtonRelease(d,type,_class) \
+    FindTypeAndClass(d, type, _class, ButtonClass, _deviceButtonRelease)
+
+#define DeviceMotionNotify(d,type,_class) \
+    FindTypeAndClass(d, type, _class, ValuatorClass, _deviceMotionNotify)
+
+#define DeviceFocusIn(d,type,_class) \
+    FindTypeAndClass(d, type, _class, FocusClass, _deviceFocusIn)
+
+#define DeviceFocusOut(d,type,_class) \
+    FindTypeAndClass(d, type, _class, FocusClass, _deviceFocusOut)
+
+#define ProximityIn(d,type,_class) \
+    FindTypeAndClass(d, type, _class, ProximityClass, _proximityIn)
+
+#define ProximityOut(d,type,_class) \
+    FindTypeAndClass(d, type, _class, ProximityClass, _proximityOut)
+
+#define DeviceStateNotify(d,type,_class) \
+    FindTypeAndClass(d, type, _class, OtherClass, _deviceStateNotify)
+
+#define DeviceMappingNotify(d,type,_class) \
+    FindTypeAndClass(d, type, _class, OtherClass, _deviceMappingNotify)
+
+#define ChangeDeviceNotify(d,type,_class) \
+    FindTypeAndClass(d, type, _class, OtherClass, _changeDeviceNotify)
+
+#define DevicePointerMotionHint(d,type,_class) \
+    { _class =  ((XDevice *) d)->device_id << 8 | _devicePointerMotionHint;}
+
+#define DeviceButton1Motion(d,type,_class) \
+    { _class =  ((XDevice *) d)->device_id << 8 | _deviceButton1Motion;}
+
+#define DeviceButton2Motion(d,type,_class) \
+    { _class =  ((XDevice *) d)->device_id << 8 | _deviceButton2Motion;}
+
+#define DeviceButton3Motion(d,type,_class) \
+    { _class =  ((XDevice *) d)->device_id << 8 | _deviceButton3Motion;}
+
+#define DeviceButton4Motion(d,type, _class) \
+    { _class =  ((XDevice *) d)->device_id << 8 | _deviceButton4Motion;}
+
+#define DeviceButton5Motion(d,type,_class) \
+    { _class =  ((XDevice *) d)->device_id << 8 | _deviceButton5Motion;}
+
+#define DeviceButtonMotion(d,type, _class) \
+    { _class =  ((XDevice *) d)->device_id << 8 | _deviceButtonMotion;}
+
+#define DeviceOwnerGrabButton(d,type,_class) \
+    { _class =  ((XDevice *) d)->device_id << 8 | _deviceOwnerGrabButton;}
+
+#define DeviceButtonPressGrab(d,type,_class) \
+    { _class =  ((XDevice *) d)->device_id << 8 | _deviceButtonGrab;}
+
+#define NoExtensionEvent(d,type,_class) \
+    { _class =  ((XDevice *) d)->device_id << 8 | _noExtensionEvent;}
+
+#define DevicePresence(dpy, type, _class)                       \
+    {                                                           \
+        extern int _XiGetDevicePresenceNotifyEvent(Display *);  \
+        type = _XiGetDevicePresenceNotifyEvent(dpy);            \
+        _class =  (0x10000 | _devicePresence);                  \
+    }
+
+#define BadDevice(dpy,error) _xibaddevice(dpy, &error)
+
+#define BadClass(dpy,error) _xibadclass(dpy, &error)
+
+#define BadEvent(dpy,error) _xibadevent(dpy, &error)
+
+#define BadMode(dpy,error) _xibadmode(dpy, &error)
+
+#define DeviceBusy(dpy,error) _xidevicebusy(dpy, &error)
+
+/***************************************************************
+ *
+ * DeviceKey events.  These events are sent by input devices that
+ * support input class Keys.
+ * The location of the X pointer is reported in the coordinate
+ * fields of the x,y and x_root,y_root fields.
+ *
+ */
+
+typedef struct 
+    {
+    int            type;         /* of event */
+    unsigned long  serial;       /* # of last request processed */
+    Bool           send_event;   /* true if from SendEvent request */
+    Display        *display;     /* Display the event was read from */
+    Window         window;       /* "event" window reported relative to */
+    XID            deviceid;
+    Window         root;         /* root window event occured on */
+    Window         subwindow;    /* child window */
+    Time           time;         /* milliseconds */
+    int            x, y;         /* x, y coordinates in event window */
+    int            x_root;       /* coordinates relative to root */
+    int            y_root;       /* coordinates relative to root */
+    unsigned int   state;        /* key or button mask */
+    unsigned int   keycode;      /* detail */
+    Bool           same_screen;  /* same screen flag */
+    unsigned int   device_state; /* device key or button mask */
+    unsigned char  axes_count;
+    unsigned char  first_axis;
+    int            axis_data[6];
+    } XDeviceKeyEvent;
+
+typedef XDeviceKeyEvent XDeviceKeyPressedEvent;
+typedef XDeviceKeyEvent XDeviceKeyReleasedEvent;
+
+/*******************************************************************
+ *
+ * DeviceButton events.  These events are sent by extension devices
+ * that support input class Buttons.
+ *
+ */
+
+typedef struct {
+    int           type;         /* of event */
+    unsigned long serial;       /* # of last request processed by server */
+    Bool          send_event;   /* true if from a SendEvent request */
+    Display       *display;     /* Display the event was read from */
+    Window        window;       /* "event" window reported relative to */
+    XID           deviceid;
+    Window        root;         /* root window that the event occured on */
+    Window        subwindow;    /* child window */
+    Time          time;         /* milliseconds */
+    int           x, y;         /* x, y coordinates in event window */
+    int           x_root;       /* coordinates relative to root */
+    int           y_root;       /* coordinates relative to root */
+    unsigned int  state;        /* key or button mask */
+    unsigned int  button;       /* detail */
+    Bool          same_screen;  /* same screen flag */
+    unsigned int  device_state; /* device key or button mask */
+    unsigned char axes_count;
+    unsigned char first_axis;
+    int           axis_data[6];
+    } XDeviceButtonEvent;
+
+typedef XDeviceButtonEvent XDeviceButtonPressedEvent;
+typedef XDeviceButtonEvent XDeviceButtonReleasedEvent;
+
+/*******************************************************************
+ *
+ * DeviceMotionNotify event.  These events are sent by extension devices
+ * that support input class Valuators.
+ *
+ */
+
+typedef struct 
+    {
+    int           type;        /* of event */
+    unsigned long serial;      /* # of last request processed by server */
+    Bool          send_event;  /* true if from a SendEvent request */
+    Display       *display;    /* Display the event was read from */
+    Window        window;      /* "event" window reported relative to */
+    XID           deviceid;
+    Window        root;        /* root window that the event occured on */
+    Window        subwindow;   /* child window */
+    Time          time;        /* milliseconds */
+    int           x, y;        /* x, y coordinates in event window */
+    int           x_root;      /* coordinates relative to root */
+    int           y_root;      /* coordinates relative to root */
+    unsigned int  state;       /* key or button mask */
+    char          is_hint;     /* detail */
+    Bool          same_screen; /* same screen flag */
+    unsigned int  device_state; /* device key or button mask */
+    unsigned char axes_count;
+    unsigned char first_axis;
+    int           axis_data[6];
+    } XDeviceMotionEvent;
+
+/*******************************************************************
+ *
+ * DeviceFocusChange events.  These events are sent when the focus
+ * of an extension device that can be focused is changed.
+ *
+ */
+
+typedef struct 
+    {
+    int           type;       /* of event */
+    unsigned long serial;     /* # of last request processed by server */
+    Bool          send_event; /* true if from a SendEvent request */
+    Display       *display;   /* Display the event was read from */
+    Window        window;     /* "event" window reported relative to */
+    XID           deviceid;
+    int           mode;       /* NotifyNormal, NotifyGrab, NotifyUngrab */
+    int           detail;
+	/*
+	 * NotifyAncestor, NotifyVirtual, NotifyInferior, 
+	 * NotifyNonLinear,NotifyNonLinearVirtual, NotifyPointer,
+	 * NotifyPointerRoot, NotifyDetailNone 
+	 */
+    Time                time;
+    } XDeviceFocusChangeEvent;
+
+typedef XDeviceFocusChangeEvent XDeviceFocusInEvent;
+typedef XDeviceFocusChangeEvent XDeviceFocusOutEvent;
+
+/*******************************************************************
+ *
+ * ProximityNotify events.  These events are sent by those absolute
+ * positioning devices that are capable of generating proximity information.
+ *
+ */
+
+typedef struct 
+    {
+    int             type;      /* ProximityIn or ProximityOut */        
+    unsigned long   serial;    /* # of last request processed by server */
+    Bool            send_event; /* true if this came from a SendEvent request */
+    Display         *display;  /* Display the event was read from */
+    Window          window;      
+    XID	            deviceid;
+    Window          root;            
+    Window          subwindow;      
+    Time            time;            
+    int             x, y;            
+    int             x_root, y_root;  
+    unsigned int    state;           
+    Bool            same_screen;     
+    unsigned int    device_state; /* device key or button mask */
+    unsigned char   axes_count;
+    unsigned char   first_axis;
+    int             axis_data[6];
+    } XProximityNotifyEvent;
+typedef XProximityNotifyEvent XProximityInEvent;
+typedef XProximityNotifyEvent XProximityOutEvent;
+
+/*******************************************************************
+ *
+ * DeviceStateNotify events are generated on EnterWindow and FocusIn 
+ * for those clients who have selected DeviceState.
+ *
+ */
+
+typedef struct
+    {
+#if defined(__cplusplus) || defined(c_plusplus)
+    unsigned char	c_class;
+#else
+    unsigned char	class;
+#endif
+    unsigned char	length;
+    } XInputClass;
+
+typedef struct {
+    int           type;
+    unsigned long serial;       /* # of last request processed by server */
+    Bool          send_event;   /* true if this came from a SendEvent request */
+    Display       *display;     /* Display the event was read from */
+    Window        window;
+    XID           deviceid;
+    Time          time;
+    int           num_classes;
+    char	  data[64];
+} XDeviceStateNotifyEvent;	
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    unsigned char	c_class;
+#else
+    unsigned char	class;
+#endif
+    unsigned char	length;
+    unsigned char	num_valuators;
+    unsigned char	mode;
+    int        		valuators[6];
+} XValuatorStatus;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    unsigned char	c_class;
+#else
+    unsigned char	class;
+#endif
+    unsigned char	length;
+    short		num_keys;
+    char        	keys[32];
+} XKeyStatus;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    unsigned char	c_class;
+#else
+    unsigned char	class;
+#endif
+    unsigned char	length;
+    short		num_buttons;
+    char        	buttons[32];
+} XButtonStatus;
+
+/*******************************************************************
+ *
+ * DeviceMappingNotify event.  This event is sent when the key mapping,
+ * modifier mapping, or button mapping of an extension device is changed.
+ *
+ */
+
+typedef struct {
+    int           type;
+    unsigned long serial;       /* # of last request processed by server */
+    Bool          send_event;   /* true if this came from a SendEvent request */
+    Display       *display;     /* Display the event was read from */
+    Window        window;       /* unused */
+    XID           deviceid;
+    Time          time;
+    int           request;      /* one of MappingModifier, MappingKeyboard,
+                                    MappingPointer */
+    int           first_keycode;/* first keycode */
+    int           count;        /* defines range of change w. first_keycode*/
+} XDeviceMappingEvent;
+
+/*******************************************************************
+ *
+ * ChangeDeviceNotify event.  This event is sent when an 
+ * XChangeKeyboard or XChangePointer request is made.
+ *
+ */
+
+typedef struct {
+    int           type;
+    unsigned long serial;       /* # of last request processed by server */
+    Bool          send_event;   /* true if this came from a SendEvent request */
+    Display       *display;     /* Display the event was read from */
+    Window        window;       /* unused */
+    XID           deviceid;
+    Time          time;
+    int           request;      /* NewPointer or NewKeyboard */
+} XChangeDeviceNotifyEvent;
+
+/*******************************************************************
+ *
+ * DevicePresenceNotify event.  This event is sent when the list of
+ * input devices changes, in which case devchange will be false, and
+ * no information about the change will be contained in the event;
+ * the client should use XListInputDevices() to learn what has changed.
+ *
+ * If devchange is true, an attribute that the server believes is
+ * important has changed on a device, and the client should use
+ * XGetDeviceControl to examine the device.  If control is non-zero,
+ * then that control has changed meaningfully.
+ */
+
+typedef struct {
+    int           type;
+    unsigned long serial;       /* # of last request processed by server */
+    Bool          send_event;   /* true if this came from a SendEvent request */
+    Display       *display;     /* Display the event was read from */
+    Window        window;       /* unused */
+    Time          time;
+    Bool          devchange;
+    XID           deviceid;
+    XID           control;
+} XDevicePresenceNotifyEvent;
+
+/*******************************************************************
+ *
+ * Control structures for input devices that support input class
+ * Feedback.  These are used by the XGetFeedbackControl and 
+ * XChangeFeedbackControl functions.
+ *
+ */
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+     XID            c_class;
+#else
+     XID            class;
+#endif
+     int            length;
+     XID            id;
+} XFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    XID     c_class;
+#else
+    XID     class;
+#endif
+    int     length;
+    XID     id;
+    int     click;
+    int     percent;
+    int     pitch;
+    int     duration;
+    int     led_mask;
+    int     global_auto_repeat;
+    char    auto_repeats[32];
+} XKbdFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    XID     c_class;
+#else
+    XID     class;
+#endif
+    int     length;
+    XID     id;
+    int     accelNum;
+    int     accelDenom;
+    int     threshold;
+} XPtrFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    XID     c_class;
+#else
+    XID     class;
+#endif
+    int     length;
+    XID     id;
+    int     resolution;
+    int     minVal;
+    int     maxVal;
+} XIntegerFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    XID     c_class;
+#else
+    XID     class;
+#endif
+    int     length;
+    XID     id;
+    int     max_symbols;
+    int     num_syms_supported;
+    KeySym  *syms_supported;
+} XStringFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    XID     c_class;
+#else
+    XID     class;
+#endif
+    int     length;
+    XID     id;
+    int     percent;
+    int     pitch;
+    int     duration;
+} XBellFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    XID     c_class;
+#else
+    XID     class;
+#endif
+    int     length;
+    XID     id;
+    int     led_values;
+    int     led_mask;
+} XLedFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+     XID            c_class;
+#else
+     XID            class;
+#endif
+     int            length;
+     XID	    id;
+} XFeedbackControl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    XID     c_class;
+#else
+    XID     class;
+#endif
+    int     length;
+    XID     id;
+    int     accelNum;
+    int     accelDenom;
+    int     threshold;
+} XPtrFeedbackControl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    XID     c_class;
+#else
+    XID     class;
+#endif
+    int     length;
+    XID     id;
+    int     click;
+    int     percent;
+    int     pitch;
+    int     duration;
+    int     led_mask;
+    int     led_value;
+    int     key;
+    int     auto_repeat_mode;
+} XKbdFeedbackControl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    XID     c_class;
+#else
+    XID     class;
+#endif
+    int     length;
+    XID     id;
+    int     num_keysyms;
+    KeySym  *syms_to_display;
+} XStringFeedbackControl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    XID     c_class;
+#else
+    XID     class;
+#endif
+    int     length;
+    XID     id;
+    int     int_to_display;
+} XIntegerFeedbackControl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    XID     c_class;
+#else
+    XID     class;
+#endif
+    int     length;
+    XID     id;
+    int     percent;
+    int     pitch;
+    int     duration;
+} XBellFeedbackControl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    XID     c_class;
+#else
+    XID     class;
+#endif
+    int     length;
+    XID     id;
+    int     led_mask;
+    int     led_values;
+} XLedFeedbackControl;
+
+/*******************************************************************
+ *
+ * Device control structures.
+ *
+ */
+
+typedef struct {
+     XID            control;
+     int            length;
+} XDeviceControl;
+
+typedef struct {
+     XID            control;
+     int            length;
+     int            first_valuator;
+     int            num_valuators;
+     int            *resolutions;
+} XDeviceResolutionControl;
+
+typedef struct {
+     XID            control;
+     int            length;
+     int            num_valuators;
+     int            *resolutions;
+     int            *min_resolutions;
+     int            *max_resolutions;
+} XDeviceResolutionState;
+
+typedef struct {
+    XID             control;
+    int             length;
+    int             min_x;
+    int             max_x;
+    int             min_y;
+    int             max_y;
+    int             flip_x;
+    int             flip_y;
+    int             rotation;
+    int             button_threshold;
+} XDeviceAbsCalibControl, XDeviceAbsCalibState;
+
+typedef struct {
+    XID             control;
+    int             length;
+    int             offset_x;
+    int             offset_y;
+    int             width;
+    int             height;
+    int             screen;
+    XID             following;
+} XDeviceAbsAreaControl, XDeviceAbsAreaState;
+
+typedef struct {
+    XID             control;
+    int             length;
+    int             status;
+} XDeviceCoreControl;
+
+typedef struct {
+    XID             control;
+    int             length;
+    int             status;
+    int             iscore;
+} XDeviceCoreState;
+
+typedef struct {
+    XID             control;
+    int             length;
+    int             enable;
+} XDeviceEnableControl, XDeviceEnableState;
+
+/*******************************************************************
+ *
+ * An array of XDeviceList structures is returned by the 
+ * XListInputDevices function.  Each entry contains information
+ * about one input device.  Among that information is an array of 
+ * pointers to structures that describe the characteristics of 
+ * the input device.
+ *
+ */
+
+typedef struct _XAnyClassinfo *XAnyClassPtr;
+
+typedef struct _XAnyClassinfo {
+#if defined(__cplusplus) || defined(c_plusplus)
+    XID 	c_class;
+#else
+    XID 	class;
+#endif
+    int 	length;
+    } XAnyClassInfo;
+
+typedef struct _XDeviceInfo *XDeviceInfoPtr;
+
+typedef struct _XDeviceInfo
+    {
+    XID                 id;        
+    Atom                type;
+    char                *name;
+    int                 num_classes;
+    int                 use;
+    XAnyClassPtr 	inputclassinfo;
+    } XDeviceInfo;
+
+typedef struct _XKeyInfo *XKeyInfoPtr;
+
+typedef struct _XKeyInfo
+    {
+#if defined(__cplusplus) || defined(c_plusplus)
+    XID			c_class;
+#else
+    XID			class;
+#endif
+    int			length;
+    unsigned short      min_keycode;
+    unsigned short      max_keycode;
+    unsigned short      num_keys;
+    } XKeyInfo;
+
+typedef struct _XButtonInfo *XButtonInfoPtr;
+
+typedef struct _XButtonInfo {
+#if defined(__cplusplus) || defined(c_plusplus)
+    XID		c_class;
+#else
+    XID		class;
+#endif
+    int		length;
+    short 	num_buttons;
+    } XButtonInfo;
+
+typedef struct _XAxisInfo *XAxisInfoPtr;
+
+typedef struct _XAxisInfo {
+    int 	resolution;
+    int 	min_value;
+    int 	max_value;
+    } XAxisInfo;
+
+typedef struct _XValuatorInfo *XValuatorInfoPtr;
+
+typedef struct	_XValuatorInfo
+    {
+#if defined(__cplusplus) || defined(c_plusplus)
+    XID			c_class;
+#else
+    XID			class;
+#endif
+    int			length;
+    unsigned char       num_axes;
+    unsigned char       mode;
+    unsigned long       motion_buffer;
+    XAxisInfoPtr        axes;
+    } XValuatorInfo;
+
+
+/*******************************************************************
+ *
+ * An XDevice structure is returned by the XOpenDevice function.  
+ * It contains an array of pointers to XInputClassInfo structures.
+ * Each contains information about a class of input supported by the
+ * device, including a pointer to an array of data for each type of event
+ * the device reports.
+ *
+ */
+
+
+typedef struct {
+        unsigned char   input_class;
+        unsigned char   event_type_base;
+} XInputClassInfo;
+
+typedef struct {
+        XID                    device_id;
+        int                    num_classes;
+        XInputClassInfo        *classes;
+} XDevice;
+
+
+/*******************************************************************
+ *
+ * The following structure is used to return information for the 
+ * XGetSelectedExtensionEvents function.
+ *
+ */
+
+typedef struct {
+        XEventClass     event_type;
+        XID             device;
+} XEventList;
+
+/*******************************************************************
+ *
+ * The following structure is used to return motion history data from 
+ * an input device that supports the input class Valuators.
+ * This information is returned by the XGetDeviceMotionEvents function.
+ *
+ */
+
+typedef struct {
+        Time   time;
+        int    *data;
+} XDeviceTimeCoord;
+
+
+/*******************************************************************
+ *
+ * Device state structure.
+ * This is returned by the XQueryDeviceState request.
+ *
+ */
+
+typedef struct {
+        XID		device_id;
+        int		num_classes;
+        XInputClass	*data;
+} XDeviceState;
+
+/*******************************************************************
+ *
+ * Note that the mode field is a bitfield that reports the Proximity
+ * status of the device as well as the mode.  The mode field should
+ * be OR'd with the mask DeviceMode and compared with the values
+ * Absolute and Relative to determine the mode, and should be OR'd
+ * with the mask ProximityState and compared with the values InProximity
+ * and OutOfProximity to determine the proximity state.
+ *
+ */
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    unsigned char	c_class;
+#else
+    unsigned char	class;
+#endif
+    unsigned char	length;
+    unsigned char	num_valuators;
+    unsigned char	mode;
+    int        		*valuators;
+} XValuatorState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    unsigned char	c_class;
+#else
+    unsigned char	class;
+#endif
+    unsigned char	length;
+    short		num_keys;
+    char        	keys[32];
+} XKeyState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    unsigned char	c_class;
+#else
+    unsigned char	class;
+#endif
+    unsigned char	length;
+    short		num_buttons;
+    char        	buttons[32];
+} XButtonState;
+
+/*******************************************************************
+ *
+ * Function definitions.
+ *
+ */
+
+_XFUNCPROTOBEGIN
+
+extern int	XChangeKeyboardDevice(
+    Display*		/* display */,
+    XDevice*		/* device */
+);
+
+extern int	XChangePointerDevice(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    int			/* xaxis */,
+    int			/* yaxis */
+);
+
+extern int	XGrabDevice(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    Window		/* grab_window */,
+    Bool		/* ownerEvents */,
+    int			/* event count */,
+    XEventClass*	/* event_list */,
+    int			/* this_device_mode */,
+    int			/* other_devices_mode */,
+    Time		/* time */
+);
+
+extern int	XUngrabDevice(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    Time 		/* time */
+);
+
+extern int	XGrabDeviceKey(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    unsigned int	/* key */,
+    unsigned int	/* modifiers */,
+    XDevice*		/* modifier_device */,
+    Window		/* grab_window */,
+    Bool		/* owner_events */,
+    unsigned int	/* event_count */,
+    XEventClass*	/* event_list */,
+    int			/* this_device_mode */,
+    int			/* other_devices_mode */
+);
+
+extern int	XUngrabDeviceKey(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    unsigned int	/* key */,
+    unsigned int	/* modifiers */,
+    XDevice*		/* modifier_dev */,
+    Window		/* grab_window */
+);
+
+extern int	XGrabDeviceButton(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    unsigned int	/* button */,
+    unsigned int	/* modifiers */,
+    XDevice*		/* modifier_device */,
+    Window		/* grab_window */,
+    Bool		/* owner_events */,
+    unsigned int	/* event_count */,
+    XEventClass*	/* event_list */,
+    int			/* this_device_mode */,
+    int			/* other_devices_mode */
+);
+
+extern int	XUngrabDeviceButton(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    unsigned int	/* button */,
+    unsigned int	/* modifiers */,
+    XDevice*		/* modifier_dev */,
+    Window		/* grab_window */
+);
+
+extern int	XAllowDeviceEvents(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    int			/* event_mode */,
+    Time		/* time */
+);
+
+extern int	XGetDeviceFocus(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    Window*		/* focus */,
+    int*		/* revert_to */,
+    Time*		/* time */
+);
+
+extern int	XSetDeviceFocus(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    Window		/* focus */,
+    int			/* revert_to */,
+    Time		/* time */
+);
+
+extern XFeedbackState	*XGetFeedbackControl(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    int*		/* num_feedbacks */
+);
+
+extern void	XFreeFeedbackList(
+    XFeedbackState*	/* list */
+);
+
+extern int	XChangeFeedbackControl(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    unsigned long	/* mask */,
+    XFeedbackControl*	/* f */
+);
+
+extern int	XDeviceBell(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    XID			/* feedbackclass */,
+    XID			/* feedbackid */,
+    int			/* percent */
+);
+
+extern KeySym	*XGetDeviceKeyMapping(
+    Display*		/* display */,
+    XDevice*		/* device */,
+#if NeedWidePrototypes
+    unsigned int	/* first */,
+#else
+    KeyCode		/* first */,
+#endif
+    int			/* keycount */,
+    int*		/* syms_per_code */
+);
+
+extern int	XChangeDeviceKeyMapping(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    int			/* first */,
+    int			/* syms_per_code */,
+    KeySym*		/* keysyms */,
+    int			/* count */
+);
+
+extern XModifierKeymap	*XGetDeviceModifierMapping(
+    Display*		/* display */,
+    XDevice*		/* device */
+);
+
+extern int	XSetDeviceModifierMapping(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    XModifierKeymap*	/* modmap */
+);
+
+extern int	XSetDeviceButtonMapping(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    unsigned char*	/* map[] */,
+    int			/* nmap */
+);
+
+extern int	XGetDeviceButtonMapping(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    unsigned char*	/* map[] */,
+    unsigned int	/* nmap */
+);
+
+extern XDeviceState	*XQueryDeviceState(
+    Display*		/* display */,
+    XDevice*		/* device */
+);
+
+extern void	XFreeDeviceState(
+    XDeviceState*	/* list */
+);
+
+extern XExtensionVersion	*XGetExtensionVersion(
+    Display*		/* display */,
+    _Xconst char*	/* name */
+);
+
+extern XDeviceInfo	*XListInputDevices(
+    Display*		/* display */,
+    int*		/* ndevices */
+);
+
+extern void	XFreeDeviceList(
+    XDeviceInfo*	/* list */
+);
+
+extern XDevice	*XOpenDevice(
+    Display*		/* display */,
+    XID			/* id */
+);
+
+extern int	XCloseDevice(
+    Display*		/* display */,
+    XDevice*		/* device */
+);
+
+extern int	XSetDeviceMode(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    int			/* mode */
+);
+
+extern int	XSetDeviceValuators(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    int*		/* valuators */,
+    int			/* first_valuator */,
+    int			/* num_valuators */
+);
+
+extern XDeviceControl	*XGetDeviceControl(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    int			/* control */
+);
+
+extern int	XChangeDeviceControl(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    int			/* control */,
+    XDeviceControl*	/* d */
+);
+
+extern int	XSelectExtensionEvent(
+    Display*		/* display */,
+    Window		/* w */,
+    XEventClass*	/* event_list */,
+    int			/* count */
+);
+
+extern int XGetSelectedExtensionEvents(
+    Display*		/* display */,
+    Window		/* w */,
+    int*		/* this_client_count */,
+    XEventClass**	/* this_client_list */,
+    int*		/* all_clients_count */,
+    XEventClass**	/* all_clients_list */
+);
+
+extern int	XChangeDeviceDontPropagateList(
+    Display*		/* display */,
+    Window		/* window */,
+    int			/* count */,
+    XEventClass*	/* events */,
+    int			/* mode */
+);
+
+extern XEventClass	*XGetDeviceDontPropagateList(
+    Display*		/* display */,
+    Window		/* window */,
+    int*		/* count */
+);
+
+extern Status	XSendExtensionEvent(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    Window		/* dest */,
+    Bool		/* prop */,
+    int			/* count */,
+    XEventClass*	/* list */,
+    XEvent*		/* event */
+);
+
+extern XDeviceTimeCoord	*XGetDeviceMotionEvents(
+    Display*		/* display */,
+    XDevice*		/* device */,
+    Time		/* start */,
+    Time		/* stop */,
+    int*		/* nEvents */,
+    int*		/* mode */,
+    int*		/* axis_count */
+);
+
+extern void	XFreeDeviceMotionEvents(
+    XDeviceTimeCoord*	/* events */
+);
+
+extern void	XFreeDeviceControl(
+    XDeviceControl*	/* control */
+);
+
+_XFUNCPROTOEND
+
+#endif /* _XINPUT_H_ */
Index: trunk/src/VBox/Additions/x11/x11include/1.4/X11/extensions/XIproto.h
===================================================================
--- trunk/src/VBox/Additions/x11/x11include/1.4/X11/extensions/XIproto.h	(revision 11548)
+++ trunk/src/VBox/Additions/x11/x11include/1.4/X11/extensions/XIproto.h	(revision 11548)
@@ -0,0 +1,1617 @@
+/* $Xorg: XIproto.h,v 1.5 2001/02/09 02:03:24 xorgcvs Exp $ */
+
+/************************************************************
+
+Copyright 1989, 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 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+			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 Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD 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.
+
+********************************************************/
+/* $XFree86: xc/include/extensions/XIproto.h,v 1.4 2001/01/17 17:53:17 dawes Exp $ */
+
+#ifndef _XIPROTO_H
+#define _XIPROTO_H
+
+#include <X11/Xproto.h>
+#include <X11/X.h>
+
+/* make sure types have right sizes for protocol structures. */
+#define Window CARD32
+#define Time CARD32
+#define KeyCode CARD8
+
+/*********************************************************
+ *
+ * number of events, errors, and extension name.
+ *
+ */
+
+#define MORE_EVENTS	0x80
+#define DEVICE_BITS	0x7F
+
+#define InputClassBits	0x3F	/* bits in mode field for input classes */
+#define ModeBitsShift	6	/* amount to shift the remaining bits   */
+
+#define numInputClasses 7
+
+#define IEVENTS		16
+#define IERRORS		5
+
+#define CLIENT_REQ		1
+
+typedef struct  _XExtEventInfo
+    {
+    Mask	mask;
+    BYTE 	type;
+    BYTE	word;
+    } XExtEventInfo;
+
+typedef unsigned char *Pointer;
+
+struct tmask
+    {
+    Mask	mask;
+    Pointer     dev;
+    };
+
+/*********************************************************
+ *
+ * Event constants used by library.
+ *
+ */
+
+#define XI_DeviceValuator		0
+#define XI_DeviceKeyPress		1
+#define XI_DeviceKeyRelease		2
+#define XI_DeviceButtonPress		3
+#define XI_DeviceButtonRelease		4
+#define XI_DeviceMotionNotify		5
+#define XI_DeviceFocusIn		6
+#define XI_DeviceFocusOut		7
+#define XI_ProximityIn			8
+#define XI_ProximityOut			9
+#define XI_DeviceStateNotify		10
+#define XI_DeviceMappingNotify		11
+#define XI_ChangeDeviceNotify		12
+#define XI_DeviceKeystateNotify		13
+#define XI_DeviceButtonstateNotify	14
+#define XI_DevicePresenceNotify		15
+
+/*********************************************************
+ *
+ * Protocol request constants
+ *
+ */
+
+#define X_GetExtensionVersion		1
+#define X_ListInputDevices		2
+#define X_OpenDevice			3
+#define X_CloseDevice			4
+#define X_SetDeviceMode			5
+#define X_SelectExtensionEvent  	6
+#define X_GetSelectedExtensionEvents	7
+#define X_ChangeDeviceDontPropagateList 8
+#define X_GetDeviceDontPropagateList 	9
+#define X_GetDeviceMotionEvents 	10
+#define X_ChangeKeyboardDevice		11
+#define X_ChangePointerDevice		12
+#define X_GrabDevice 			13
+#define X_UngrabDevice  		14
+#define X_GrabDeviceKey			15
+#define X_UngrabDeviceKey		16
+#define X_GrabDeviceButton		17
+#define X_UngrabDeviceButton		18
+#define X_AllowDeviceEvents		19
+#define X_GetDeviceFocus		20
+#define X_SetDeviceFocus		21
+#define X_GetFeedbackControl		22
+#define X_ChangeFeedbackControl		23
+#define X_GetDeviceKeyMapping		24
+#define X_ChangeDeviceKeyMapping	25
+#define X_GetDeviceModifierMapping	26
+#define X_SetDeviceModifierMapping	27
+#define X_GetDeviceButtonMapping	28
+#define X_SetDeviceButtonMapping	29
+#define X_QueryDeviceState 		30
+#define X_SendExtensionEvent 		31
+#define X_DeviceBell			32
+#define X_SetDeviceValuators		33
+#define X_GetDeviceControl		34
+#define X_ChangeDeviceControl		35
+
+/*********************************************************
+ *
+ * Protocol request and reply structures.
+ *
+ * GetExtensionVersion.
+ *
+ */
+
+typedef struct {
+    CARD8 	reqType;       /* input extension major code   */
+    CARD8 	ReqType;       /* always X_GetExtensionVersion */
+    CARD16 	length B16;
+    CARD16 	nbytes B16;
+    CARD8 	pad1, pad2;
+} xGetExtensionVersionReq;
+
+typedef struct {
+    CARD8 	repType;  	/* X_Reply 			*/
+    CARD8 	RepType;       	/* always X_GetExtensionVersion */
+    CARD16 	sequenceNumber B16;
+    CARD32 	length B32;
+    CARD16 	major_version B16;
+    CARD16 	minor_version B16;
+    BOOL 	present;
+    CARD8 	pad1, pad2, pad3;
+    CARD32 	pad01 B32;
+    CARD32 	pad02 B32;
+    CARD32 	pad03 B32;
+    CARD32 	pad04 B32;
+} xGetExtensionVersionReply;
+
+/*********************************************************
+ *
+ * ListInputDevices.
+ *
+ */
+
+typedef struct {
+    CARD8 	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;	/* always X_ListInputDevices 	*/
+    CARD16 	length B16;
+} xListInputDevicesReq;
+
+typedef struct {
+    CARD8 	repType;  	/* X_Reply 			*/
+    CARD8 	RepType;        /* always X_ListInputDevices  	*/
+    CARD16 	sequenceNumber B16;
+    CARD32 	length B32;
+    CARD8 	ndevices;
+    CARD8 	pad1, pad2, pad3;
+    CARD32 	pad01 B32;
+    CARD32 	pad02 B32;
+    CARD32 	pad03 B32;
+    CARD32 	pad04 B32;
+    CARD32 	pad05 B32;
+} xListInputDevicesReply;
+
+typedef struct _xDeviceInfo *xDeviceInfoPtr;
+
+typedef struct _xAnyClassinfo *xAnyClassPtr;
+
+typedef struct _xAnyClassinfo {
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8 	c_class;
+#else
+    CARD8 	class;
+#endif
+    CARD8 	length;
+    } xAnyClassInfo;
+
+typedef struct _xDeviceInfo {
+    CARD32	type B32;
+    CARD8	id;
+    CARD8 	num_classes;
+    CARD8 	use;
+    CARD8 	pad1;
+    } xDeviceInfo;
+
+typedef struct _xKeyInfo *xKeyInfoPtr;
+
+typedef struct _xKeyInfo {
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8 	c_class;
+#else
+    CARD8 	class;
+#endif
+    CARD8 	length;
+    KeyCode 	min_keycode; 
+    KeyCode 	max_keycode; 
+    CARD16 	num_keys B16;
+    CARD8 	pad1,pad2;
+    } xKeyInfo;
+
+typedef struct _xButtonInfo *xButtonInfoPtr;
+
+typedef struct _xButtonInfo {
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8 	c_class;
+#else
+    CARD8 	class;
+#endif
+    CARD8 	length;
+    CARD16 	num_buttons B16;
+    } xButtonInfo;
+
+typedef struct _xValuatorInfo *xValuatorInfoPtr;
+
+typedef struct _xValuatorInfo {
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8 	c_class;
+#else
+    CARD8 	class;
+#endif
+    CARD8 	length;
+    CARD8 	num_axes;
+    CARD8 	mode;
+    CARD32 	motion_buffer_size B32;
+    } xValuatorInfo;
+
+typedef struct _xAxisInfo *xAxisInfoPtr;
+
+typedef struct _xAxisInfo {
+    CARD32 	resolution B32;
+    CARD32 	min_value B32;
+    CARD32 	max_value B32;
+    } xAxisInfo;
+
+/*********************************************************
+ *
+ * OpenDevice.
+ *
+ */
+
+typedef struct {
+    CARD8	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;        /* always X_OpenDevice 		*/
+    CARD16 	length B16;
+    CARD8       deviceid;
+    BYTE	pad1, pad2, pad3;
+} xOpenDeviceReq;
+
+typedef struct {
+    CARD8 	repType;  	/* X_Reply 			*/
+    CARD8 	RepType;       	/* always X_OpenDevice        	*/
+    CARD16 	sequenceNumber B16;
+    CARD32 	length B32;
+    CARD8 	num_classes;
+    BYTE 	pad1, pad2, pad3;
+    CARD32 	pad00 B32;
+    CARD32 	pad01 B32;
+    CARD32 	pad02 B32;
+    CARD32 	pad03 B32;
+    CARD32 	pad04 B32;
+    } xOpenDeviceReply;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8 	c_class;
+#else
+    CARD8 	class;
+#endif
+    CARD8 	event_type_base;
+    } xInputClassInfo;
+
+/*********************************************************
+ *
+ * CloseDevice.
+ *
+ */
+
+typedef struct {
+    CARD8	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;        /* always X_CloseDevice 	*/
+    CARD16 	length B16;
+    CARD8       deviceid;
+    BYTE	pad1, pad2, pad3;
+} xCloseDeviceReq;
+
+/*********************************************************
+ *
+ * SetDeviceMode.
+ *
+ */
+
+typedef struct {
+    CARD8 	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;     	/* always X_SetDeviceMode 	*/
+    CARD16 	length B16;
+    CARD8       deviceid;
+    CARD8       mode;
+    BYTE 	pad1, pad2;
+} xSetDeviceModeReq;
+
+typedef struct {
+    CARD8 	repType;  	/* X_Reply 			*/
+    CARD8 	RepType;     	/* always X_SetDeviceMode  	*/
+    CARD16 	sequenceNumber B16;
+    CARD32 	length B32;
+    CARD8 	status;
+    BYTE	pad1, pad2, pad3;
+    CARD32 	pad01 B32;
+    CARD32 	pad02 B32;
+    CARD32 	pad03 B32;
+    CARD32 	pad04 B32;
+    CARD32 	pad05 B32;
+} xSetDeviceModeReply;
+
+/*********************************************************
+ *
+ * SelectExtensionEvent.
+ *
+ */
+
+typedef struct {
+    CARD8	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;        /* always X_SelectExtensionEvent */
+    CARD16 	length B16;
+    Window 	window B32;
+    CARD16	count B16;
+    CARD16	pad00 B16;
+} xSelectExtensionEventReq;
+
+/*********************************************************
+ *
+ * GetSelectedExtensionEvent.
+ *
+ */
+
+typedef struct {
+    CARD8	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;        /* X_GetSelectedExtensionEvents */
+    CARD16 	length B16;
+    Window	window B32;
+} xGetSelectedExtensionEventsReq;
+
+typedef struct {
+    CARD8 	repType;  	/* X_Reply 			*/
+    CARD8 	RepType;       	/* GetSelectedExtensionEvents	*/
+    CARD16 	sequenceNumber B16;
+    CARD32 	length B32;
+    CARD16 	this_client_count B16;
+    CARD16 	all_clients_count B16;
+    CARD32 	pad01 B32;
+    CARD32 	pad02 B32;
+    CARD32 	pad03 B32;
+    CARD32 	pad04 B32;
+    CARD32 	pad05 B32;
+} xGetSelectedExtensionEventsReply;
+
+/*********************************************************
+ *
+ * ChangeDeviceDontPropagateList.
+ *
+ */
+
+typedef struct {
+    CARD8	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;        /* X_ChangeDeviceDontPropagateList */
+    CARD16 	length B16;
+    Window	window B32;
+    CARD16 	count B16;
+    CARD8 	mode;
+    BYTE	pad;
+} xChangeDeviceDontPropagateListReq;
+
+/*********************************************************
+ *
+ * GetDeviceDontPropagateList.
+ *
+ */
+
+typedef struct {
+    CARD8	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;        /* X_GetDeviceDontPropagateList */
+    CARD16 	length B16;
+    Window	window B32;
+} xGetDeviceDontPropagateListReq;
+
+typedef struct {
+    CARD8 	repType;  	/* X_Reply 			*/
+    CARD8 	RepType;        /* GetDeviceDontPropagateList   */
+    CARD16 	sequenceNumber B16;
+    CARD32 	length B32;
+    CARD16 	count B16;
+    CARD16 	pad00 B16;
+    CARD32 	pad01 B32;
+    CARD32 	pad02 B32;
+    CARD32 	pad03 B32;
+    CARD32 	pad04 B32;
+    CARD32 	pad05 B32;
+    } xGetDeviceDontPropagateListReply;
+
+/*********************************************************
+ *
+ * GetDeviceMotionEvents.
+ *
+ */
+
+typedef struct {
+    CARD8 	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;        /* always X_GetDeviceMotionEvents*/
+    CARD16 	length B16;
+    Time 	start B32;
+    Time	stop B32;
+    CARD8	deviceid;
+    BYTE	pad1, pad2, pad3;
+} xGetDeviceMotionEventsReq;
+
+typedef struct {
+    CARD8 	repType;  	/* X_Reply */
+    CARD8 	RepType;        /* always X_GetDeviceMotionEvents  */
+    CARD16 	sequenceNumber B16;
+    CARD32 	length B32;
+    CARD32 	nEvents B32;
+    CARD8  	axes;
+    CARD8  	mode;
+    BYTE	pad1, pad2;
+    CARD32 	pad01 B32;
+    CARD32 	pad02 B32;
+    CARD32 	pad03 B32;
+    CARD32 	pad04 B32;
+} xGetDeviceMotionEventsReply;
+
+/*********************************************************
+ *
+ * ChangeKeyboardDevice.
+ *
+ */
+
+typedef struct {
+    CARD8	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;        /* X_ChangeKeyboardDevice 	*/
+    CARD16 	length B16;
+    CARD8 	deviceid;
+    BYTE	pad1, pad2, pad3;
+} xChangeKeyboardDeviceReq;
+
+typedef struct {
+    CARD8 	repType;  	/* X_Reply 			*/
+    CARD8 	RepType;        /* always X_ChangeKeyboardDevice*/
+    CARD16 	sequenceNumber B16;
+    CARD32 	length B32;  /* 0 */
+    CARD8 	status;
+    BYTE	pad1, pad2, pad3;
+    CARD32 	pad01 B32;
+    CARD32 	pad02 B32;
+    CARD32 	pad03 B32;
+    CARD32 	pad04 B32;
+    CARD32 	pad05 B32;
+    } xChangeKeyboardDeviceReply;
+
+/*********************************************************
+ *
+ * ChangePointerDevice.
+ *
+ */
+
+typedef struct {
+    CARD8	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;        /* X_ChangePointerDevice 	*/
+    CARD16 	length B16;
+    CARD8 	xaxis;
+    CARD8 	yaxis;
+    CARD8 	deviceid;
+    BYTE	pad1;
+} xChangePointerDeviceReq;
+
+typedef struct {
+    CARD8 	repType;  	/* X_Reply 			*/
+    CARD8 	RepType;        /* always X_ChangePointerDevice */
+    CARD16 	sequenceNumber B16;
+    CARD32 	length B32;  /* 0 */
+    CARD8 	status;
+    BYTE	pad1, pad2, pad3;
+    CARD32 	pad01 B32;
+    CARD32 	pad02 B32;
+    CARD32 	pad03 B32;
+    CARD32 	pad04 B32;
+    CARD32 	pad05 B32;
+    } xChangePointerDeviceReply;
+
+/*********************************************************
+ *
+ * GrabDevice.
+ *
+ */
+
+typedef struct {
+    CARD8	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;        /* always X_GrabDevice */
+    CARD16 	length B16;
+    Window 	grabWindow B32;
+    Time 	time B32;
+    CARD16	event_count B16;
+    CARD8	this_device_mode;
+    CARD8	other_devices_mode;
+    BOOL 	ownerEvents;
+    CARD8 	deviceid;
+    CARD16 	pad01 B16;
+} xGrabDeviceReq;
+
+typedef struct {
+    CARD8 	repType;  	/* X_Reply 			*/
+    CARD8 	RepType;        /* always X_GrabDevice  	*/
+    CARD16 	sequenceNumber B16;
+    CARD32 	length B32;  /* 0 */
+    CARD8 	status;
+    BYTE	pad1, pad2, pad3;
+    CARD32 	pad01 B32;
+    CARD32 	pad02 B32;
+    CARD32 	pad03 B32;
+    CARD32 	pad04 B32;
+    CARD32 	pad05 B32;
+    } xGrabDeviceReply;
+
+/*********************************************************
+ *
+ * UngrabDevice.
+ *
+ */
+
+typedef struct {
+    CARD8	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;        /* always X_UnGrabDevice 	*/
+    CARD16 	length B16;
+    Time 	time B32;
+    CARD8 	deviceid;
+    BYTE	pad1, pad2, pad3;
+} xUngrabDeviceReq;
+
+/*********************************************************
+ *
+ * GrabDeviceKey.
+ *
+ */
+
+typedef struct {
+    CARD8	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;        /* always X_GrabDeviceKey 	*/
+    CARD16 	length B16;
+    Window 	grabWindow B32;
+    CARD16	event_count B16;
+    CARD16 	modifiers B16;
+    CARD8	modifier_device;
+    CARD8	grabbed_device;
+    CARD8	key;
+    BYTE 	this_device_mode;  
+    BYTE 	other_devices_mode;  
+    BOOL 	ownerEvents;
+    BYTE	pad1, pad2;
+} xGrabDeviceKeyReq;
+
+/*********************************************************
+ *
+ * UngrabDeviceKey.
+ *
+ */
+
+typedef struct {
+    CARD8	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;        /* always X_UngrabDeviceKey 	*/
+    CARD16 	length B16;
+    Window 	grabWindow B32;
+    CARD16	modifiers B16;
+    CARD8 	modifier_device;
+    CARD8	key;
+    CARD8	grabbed_device;
+    BYTE	pad1, pad2, pad3;
+} xUngrabDeviceKeyReq;
+
+/*********************************************************
+ *
+ * GrabDeviceButton.
+ *
+ */
+
+typedef struct {
+    CARD8	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;        /* always X_GrabDeviceButton 	*/
+    CARD16 	length B16;
+    Window 	grabWindow B32;
+    CARD8	grabbed_device;
+    CARD8	modifier_device;
+    CARD16 	event_count B16;
+    CARD16 	modifiers B16;
+    BYTE 	this_device_mode;  
+    BYTE 	other_devices_mode;  
+    CARD8 	button;
+    BOOL 	ownerEvents;
+    BYTE	pad1, pad2;
+} xGrabDeviceButtonReq;
+
+/*********************************************************
+ *
+ * UngrabDeviceButton.
+ *
+ */
+
+typedef struct {
+    CARD8	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;        /* always X_UngrabDeviceButton 	*/
+    CARD16 	length B16;
+    Window 	grabWindow B32;
+    CARD16 	modifiers B16;
+    CARD8 	modifier_device;
+    CARD8 	button;
+    CARD8 	grabbed_device;
+    BYTE	pad1, pad2, pad3;
+} xUngrabDeviceButtonReq;
+
+/*********************************************************
+ *
+ * AllowDeviceEvents.
+ *
+ */
+
+typedef struct {
+    CARD8	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;        /* always X_AllowDeviceEvents 	*/
+    CARD16 	length B16;
+    Time 	time B32;
+    CARD8	mode;
+    CARD8 	deviceid;
+    BYTE	pad1, pad2;
+} xAllowDeviceEventsReq;
+
+/*********************************************************
+ *
+ * GetDeviceFocus.
+ *
+ */
+
+typedef struct {
+    CARD8 	reqType;        /* input extension major code   */
+    CARD8 	ReqType;        /* always X_GetDeviceFocus 	*/
+    CARD16 	length B16;
+    CARD8 	deviceid;
+    BYTE 	pad1, pad2, pad3;
+} xGetDeviceFocusReq;
+
+typedef struct {
+    CARD8 	repType;  	/* X_Reply 			*/
+    CARD8 	RepType;        /* always X_GetDeviceFocus  	*/
+    CARD16 	sequenceNumber B16;
+    CARD32 	length B32;
+    CARD32 	focus B32;
+    Time 	time B32;
+    CARD8  	revertTo;
+    BYTE 	pad1, pad2, pad3;
+    CARD32 	pad01 B32;
+    CARD32 	pad02 B32;
+    CARD32 	pad03 B32;
+    } xGetDeviceFocusReply;
+
+/*********************************************************
+ *
+ * SetDeviceFocus.
+ *
+ */
+
+typedef struct {
+    CARD8 	reqType;        /* input extension major code   */
+    CARD8 	ReqType;        /* always X_SetDeviceFocus 	*/
+    CARD16 	length B16;
+    Window 	focus B32;
+    Time   	time B32;
+    CARD8  	revertTo;
+    CARD8  	device;
+    CARD16 	pad01 B16;
+} xSetDeviceFocusReq;
+
+/*********************************************************
+ *
+ * GetFeedbackControl.
+ *
+ */
+
+typedef struct {
+    CARD8	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;        /* X_GetFeedbackControl  	*/
+    CARD16 	length B16;
+    CARD8 	deviceid;
+    BYTE	pad1, pad2, pad3;
+} xGetFeedbackControlReq;
+
+typedef struct {
+    CARD8  	repType;  	/* X_Reply 			*/
+    CARD8  	RepType;        /* always X_GetFeedbackControl 	*/
+    CARD16 	sequenceNumber B16;
+    CARD32 	length B32;
+    CARD16	num_feedbacks B16;
+    CARD16	pad01 B16;
+    CARD32	pad02 B32;
+    CARD32	pad03 B32;
+    CARD32	pad04 B32;
+    CARD32	pad05 B32;
+    CARD32	pad06 B32;
+} xGetFeedbackControlReply;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8  	c_class; 	/* feedback class		*/
+#else
+    CARD8  	class; 		/* feedback class		*/
+#endif
+    CARD8  	id; 		/* feedback id    		*/
+    CARD16  	length B16; 	/* feedback length		*/
+} xFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8   c_class;
+#else
+    CARD8   class;
+#endif
+    CARD8   id;
+    CARD16  length B16;
+    CARD16  pitch B16;
+    CARD16  duration B16;
+    CARD32  led_mask B32;
+    CARD32  led_values B32;
+    BOOL    global_auto_repeat;
+    CARD8   click;
+    CARD8   percent;
+    BYTE    pad;
+    BYTE    auto_repeats[32];
+} xKbdFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8   c_class;
+#else
+    CARD8   class;
+#endif
+    CARD8   id;
+    CARD16  length B16;
+    CARD8   pad1,pad2;
+    CARD16  accelNum B16;
+    CARD16  accelDenom B16;
+    CARD16  threshold B16;
+} xPtrFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8  	c_class;  	/* feedback class id		*/
+#else
+    CARD8  	class;  	/* feedback class id		*/
+#endif
+    CARD8   	id;
+    CARD16  	length B16; 	/* feedback length  		*/
+    CARD32	resolution B32;
+    INT32	min_value B32;
+    INT32	max_value B32;
+} xIntegerFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8  	c_class;  	/* feedback class id		*/
+#else
+    CARD8  	class;  	/* feedback class id		*/
+#endif
+    CARD8   	id;
+    CARD16  	length B16; 	/* feedback length  		*/
+    CARD16	max_symbols B16;
+    CARD16	num_syms_supported B16;
+} xStringFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8  	c_class;  	/* feedback class id		*/
+#else
+    CARD8  	class;  	/* feedback class id		*/
+#endif
+    CARD8	id;
+    CARD16  	length B16; 	/* feedback length  		*/
+    CARD8	percent;
+    BYTE	pad1, pad2, pad3;
+    CARD16	pitch B16;
+    CARD16	duration B16;
+} xBellFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8  	c_class;  	/* feedback class id		*/
+#else
+    CARD8  	class;  	/* feedback class id		*/
+#endif
+    CARD8	id;
+    CARD16  	length B16; 	/* feedback length  		*/
+    CARD32	led_mask B32;
+    CARD32	led_values B32;
+} xLedFeedbackState;
+
+/*********************************************************
+ *
+ * ChangeFeedbackControl.
+ *
+ */
+
+typedef struct {
+    CARD8	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;        /* X_ChangeFeedbackControl  	*/
+    CARD16 	length B16;
+    CARD32	mask B32;
+    CARD8  	deviceid;
+    CARD8  	feedbackid;
+    BYTE	pad1, pad2;
+} xChangeFeedbackControlReq;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8  	c_class;  	/* feedback class id		*/
+#else
+    CARD8  	class;  	/* feedback class id		*/
+#endif
+    CARD8  	id; 		/* feedback id      		*/
+    CARD16  	length B16; 	/* feedback length  		*/
+} xFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8  	c_class;  	/* feedback class id		*/
+#else
+    CARD8  	class;  	/* feedback class id		*/
+#endif
+    CARD8  	id; 		/* feedback length  		*/
+    CARD16  	length B16; 	/* feedback length  		*/
+    KeyCode 	key; 
+    CARD8	auto_repeat_mode;
+    INT8	click;
+    INT8	percent;
+    INT16	pitch B16;
+    INT16	duration B16;
+    CARD32	led_mask B32;
+    CARD32	led_values B32;
+} xKbdFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8  	c_class;  	/* feedback class id		*/
+#else
+    CARD8  	class;  	/* feedback class id		*/
+#endif
+    CARD8  	id; 		/* feedback id      		*/
+    CARD16  	length B16; 	/* feedback length  		*/
+    CARD8  	pad1,pad2;
+    INT16	num B16;
+    INT16	denom B16;
+    INT16	thresh B16;
+} xPtrFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8  	c_class;  	/* feedback class id		*/
+#else
+    CARD8  	class;  	/* feedback class id		*/
+#endif
+    CARD8  	id; 		/* feedback id      		*/
+    CARD16  	length B16; 	/* feedback length  		*/
+    INT32	int_to_display B32;
+} xIntegerFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8  	c_class;  	/* feedback class id		*/
+#else
+    CARD8  	class;  	/* feedback class id		*/
+#endif
+    CARD8  	id; 		/* feedback id      		*/
+    CARD16  	length B16; 	/* feedback length  		*/
+    CARD8  	pad1,pad2;
+    CARD16	num_keysyms B16;
+} xStringFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8  	c_class;  	/* feedback class id		*/
+#else
+    CARD8  	class;  	/* feedback class id		*/
+#endif
+    CARD8  	id; 		/* feedback id      		*/
+    CARD16  	length B16; 	/* feedback length  		*/
+    INT8	percent;
+    BYTE	pad1, pad2, pad3;
+    INT16	pitch B16;
+    INT16	duration B16;
+} xBellFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8  	c_class;  	/* feedback class id		*/
+#else
+    CARD8  	class;  	/* feedback class id		*/
+#endif
+    CARD8  	id; 		/* feedback id      		*/
+    CARD16  	length B16; 	/* feedback length  		*/
+    CARD32	led_mask B32;
+    CARD32	led_values B32;
+} xLedFeedbackCtl;
+
+/*********************************************************
+ *
+ * GetDeviceKeyMapping.
+ *
+ */
+
+typedef struct {
+    CARD8 	reqType;        /* input extension major code   */
+    CARD8 	ReqType;     	/* always X_GetDeviceKeyMapping */
+    CARD16 	length B16;
+    CARD8   	deviceid;
+    KeyCode 	firstKeyCode; 
+    CARD8 	count;
+    BYTE	pad1;
+} xGetDeviceKeyMappingReq;
+
+typedef struct {
+    CARD8  	repType;  	/* X_Reply 			*/
+    CARD8  	RepType;       	/* always X_GetDeviceKeyMapping */
+    CARD16 	sequenceNumber B16;
+    CARD32 	length B32;
+    CARD8  	keySymsPerKeyCode;
+    CARD8  	pad0;
+    CARD16 	pad1 B16;
+    CARD32 	pad2 B32;
+    CARD32 	pad3 B32;
+    CARD32 	pad4 B32;
+    CARD32 	pad5 B32;
+    CARD32 	pad6 B32;
+} xGetDeviceKeyMappingReply;
+
+/*********************************************************
+ *
+ * ChangeDeviceKeyMapping.
+ *
+ */
+
+typedef struct {
+    CARD8 	reqType;        /* input extension major code   */
+    CARD8 	ReqType;        /* always X_ChangeDeviceKeyMapping */
+    CARD16 	length B16;
+    CARD8   	deviceid;
+    KeyCode 	firstKeyCode;
+    CARD8 	keySymsPerKeyCode;
+    CARD8 	keyCodes;
+} xChangeDeviceKeyMappingReq;
+
+/*********************************************************
+ *
+ * GetDeviceModifierMapping.
+ *
+ */
+
+typedef struct {
+    CARD8 	reqType;        /* input extension major code   */
+    CARD8 	ReqType;        /* always X_GetDeviceModifierMapping */
+    CARD16 	length B16;
+    CARD8   	deviceid;
+    BYTE	pad1, pad2, pad3;
+} xGetDeviceModifierMappingReq;
+
+typedef struct {
+    CARD8  	repType;  	/* X_Reply */
+    CARD8  	RepType;        /* always X_GetDeviceModifierMapping */
+    CARD16 	sequenceNumber B16;
+    CARD32 	length B32;
+    CARD8  	numKeyPerModifier;
+    CARD8  	pad0;
+    CARD16 	pad1 B16;
+    CARD32 	pad2 B32;
+    CARD32 	pad3 B32;
+    CARD32 	pad4 B32;
+    CARD32 	pad5 B32;
+    CARD32 	pad6 B32;
+} xGetDeviceModifierMappingReply;
+
+/*********************************************************
+ *
+ * SetDeviceModifierMapping.
+ *
+ */
+
+typedef struct {
+    CARD8 	reqType;        /* input extension major code   */
+    CARD8 	ReqType;        /* always X_SetDeviceModifierMapping */
+    CARD16 	length B16;
+    CARD8   	deviceid;
+    CARD8   	numKeyPerModifier;
+    CARD16  	pad1 B16;
+} xSetDeviceModifierMappingReq;
+
+typedef struct {
+    CARD8  	repType;  	/* X_Reply */
+    CARD8  	RepType;        /* always X_SetDeviceModifierMapping */
+    CARD16 	sequenceNumber B16;
+    CARD32 	length B32;
+    CARD8  	success;
+    CARD8  	pad0;
+    CARD16 	pad1 B16;
+    CARD32 	pad2 B32;
+    CARD32 	pad3 B32;
+    CARD32 	pad4 B32;
+    CARD32 	pad5 B32;
+    CARD32 	pad6 B32;
+} xSetDeviceModifierMappingReply;
+
+/*********************************************************
+ *
+ * GetDeviceButtonMapping.
+ *
+ */
+
+typedef struct {
+    CARD8	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;        /* X_GetDeviceButtonMapping     */
+    CARD16 	length B16;
+    CARD8   	deviceid;
+    BYTE	pad1, pad2, pad3;
+} xGetDeviceButtonMappingReq;
+
+typedef struct {
+    CARD8  	repType;  	/* X_Reply */
+    CARD8  	RepType;        /* always X_GetDeviceButtonMapping */
+    CARD16 	sequenceNumber B16;
+    CARD32 	length B32;
+    CARD8 	nElts;
+    BYTE	pad1, pad2, pad3;
+    CARD32 	pad01 B32;
+    CARD32 	pad02 B32;
+    CARD32 	pad03 B32;
+    CARD32 	pad04 B32;
+    CARD32 	pad05 B32;
+} xGetDeviceButtonMappingReply;
+
+/*********************************************************
+ *
+ * SetDeviceButtonMapping.
+ *
+ */
+
+typedef struct {
+    CARD8	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;        /* X_SetDeviceButtonMapping     */
+    CARD16 	length B16;
+    CARD8   	deviceid;
+    CARD8   	map_length;
+    BYTE	pad1, pad2;
+} xSetDeviceButtonMappingReq;
+
+typedef struct {
+    CARD8  	repType;  		/* X_Reply */
+    CARD8  	RepType;        	/* always X_SetDeviceButtonMapping */
+    CARD16 	sequenceNumber B16;
+    CARD32 	length B32;
+    CARD8 	status;
+    BYTE 	pad0;
+    CARD16 	pad1 B16;
+    CARD32 	pad2 B32;
+    CARD32 	pad3 B32;
+    CARD32 	pad4 B32;
+    CARD32 	pad5 B32;
+    CARD32 	pad6 B32;
+} xSetDeviceButtonMappingReply;
+
+/*********************************************************
+ *
+ * QueryDeviceState.
+ *
+ */
+
+typedef struct {
+    CARD8	reqType;
+    CARD8 	ReqType;        /* always X_QueryDeviceState */
+    CARD16 	length B16;
+    CARD8   	deviceid;
+    BYTE	pad1, pad2, pad3;
+} xQueryDeviceStateReq;
+
+typedef struct {
+    CARD8  	repType;  		/* X_Reply */
+    CARD8  	RepType;        	/* always X_QueryDeviceState	*/
+    CARD16 	sequenceNumber B16;
+    CARD32 	length B32;
+    CARD8 	num_classes;
+    BYTE 	pad0;
+    CARD16 	pad1 B16;
+    CARD32 	pad2 B32;
+    CARD32 	pad3 B32;
+    CARD32 	pad4 B32;
+    CARD32 	pad5 B32;
+    CARD32 	pad6 B32;
+} xQueryDeviceStateReply;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8  	c_class;
+#else
+    CARD8  	class;
+#endif
+    CARD8  	length;
+    CARD8	num_keys;
+    BYTE   	pad1;
+    CARD8  	keys[32];
+} xKeyState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8  	c_class;
+#else
+    CARD8  	class;
+#endif
+    CARD8  	length;
+    CARD8	num_buttons;
+    BYTE   	pad1;
+    CARD8  	buttons[32];
+} xButtonState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8  	c_class;
+#else
+    CARD8  	class;
+#endif
+    CARD8  	length;
+    CARD8  	num_valuators;
+    CARD8	mode;
+} xValuatorState;
+
+/*********************************************************
+ *
+ * SendExtensionEvent.
+ * THIS REQUEST MUST BE KEPT A MULTIPLE OF 8 BYTES IN LENGTH!
+ * MORE EVENTS MAY FOLLOW AND THEY MUST BE QUAD-ALIGNED!
+ *
+ */
+
+typedef struct {
+    CARD8	reqType;
+    CARD8 	ReqType;        /* always X_SendExtensionEvent */
+    CARD16 	length B16;
+    Window	destination B32;
+    CARD8   	deviceid;
+    BOOL   	propagate;
+    CARD16	count B16;
+    CARD8	num_events;
+    BYTE	pad1,pad2,pad3;
+} xSendExtensionEventReq;
+
+/*********************************************************
+ *
+ * DeviceBell.
+ *
+ */
+
+typedef struct {
+    CARD8	reqType;
+    CARD8 	ReqType;        /* always X_DeviceBell */
+    CARD16 	length B16;
+    CARD8   	deviceid;
+    CARD8	feedbackid;
+    CARD8	feedbackclass;
+    INT8	percent;
+} xDeviceBellReq;
+
+/*********************************************************
+ *
+ * SetDeviceValuators.
+ *
+ */
+
+typedef struct {
+    CARD8 	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;     	/* always X_SetDeviceValuators 	*/
+    CARD16 	length B16;
+    CARD8       deviceid;
+    CARD8       first_valuator;
+    CARD8       num_valuators;
+    BYTE 	pad1;
+} xSetDeviceValuatorsReq;
+
+typedef struct {
+    CARD8 	repType;  	/* X_Reply 			*/
+    CARD8 	RepType;     	/* always X_SetDeviceValuators 	*/
+    CARD16 	sequenceNumber B16;
+    CARD32 	length B32;
+    CARD8 	status;
+    BYTE	pad1, pad2, pad3;
+    CARD32 	pad01 B32;
+    CARD32 	pad02 B32;
+    CARD32 	pad03 B32;
+    CARD32 	pad04 B32;
+    CARD32 	pad05 B32;
+} xSetDeviceValuatorsReply;
+
+/*********************************************************
+ *
+ * GetDeviceControl.
+ *
+ */
+
+typedef struct {
+    CARD8 	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;     	/* always X_GetDeviceControl 	*/
+    CARD16 	length B16;
+    CARD16      control B16;
+    CARD8       deviceid;
+    BYTE 	pad2;
+} xGetDeviceControlReq;
+
+typedef struct {
+    CARD8 	repType;  	/* X_Reply 			*/
+    CARD8 	RepType;     	/* always X_GetDeviceControl 	*/
+    CARD16 	sequenceNumber B16;
+    CARD32 	length B32;
+    CARD8 	status;
+    BYTE	pad1, pad2, pad3;
+    CARD32 	pad01 B32;
+    CARD32 	pad02 B32;
+    CARD32 	pad03 B32;
+    CARD32 	pad04 B32;
+    CARD32 	pad05 B32;
+} xGetDeviceControlReply;
+
+typedef struct {
+    CARD16  	control B16; 	/* control type     	 	*/
+    CARD16  	length B16; 	/* control length  		*/
+} xDeviceState;
+
+typedef struct {
+    CARD16  	control B16; 		/* control type     	 	*/
+    CARD16  	length B16; 		/* control length  		*/
+    CARD32  	num_valuators B32; 	/* number of valuators		*/
+} xDeviceResolutionState;
+
+typedef struct {
+     CARD16         control B16;
+     CARD16         length B16;
+     INT32          min_x B32;
+     INT32          max_x B32;
+     INT32          min_y B32;
+     INT32          max_y B32;
+     CARD32         flip_x B32;
+     CARD32         flip_y B32;
+     CARD32         rotation B32;
+     CARD32         button_threshold B32;
+} xDeviceAbsCalibState;
+
+typedef struct {
+     CARD16         control B16;
+     CARD16         length B16;
+     CARD32         offset_x B32;
+     CARD32         offset_y B32;
+     CARD32         width B32;
+     CARD32         height B32;
+     CARD32         screen B32;
+     CARD32         following B32;
+} xDeviceAbsAreaState;
+
+typedef struct {
+    CARD16      control B16;            /* control type                 */
+    CARD16      length  B16;            /* control length               */
+    CARD8       status;
+    CARD8       iscore;
+    CARD16      pad1 B16;
+} xDeviceCoreState;
+
+typedef struct {
+    CARD16      control B16;            /* control type                 */
+    CARD16      length  B16;            /* control length               */
+    CARD8       enable;
+    CARD8       pad0;
+    CARD16      pad1 B16;
+} xDeviceEnableState;
+
+/*********************************************************
+ *
+ * ChangeDeviceControl.
+ *
+ */
+
+typedef struct {
+    CARD8 	reqType;	/* input extension major code	*/
+    CARD8 	ReqType;     	/* always X_ChangeDeviceControl */
+    CARD16 	length B16;
+    CARD16      control B16;
+    CARD8       deviceid;
+    BYTE        pad0;
+} xChangeDeviceControlReq;
+
+typedef struct {
+    CARD8 	repType;  	/* X_Reply 			*/
+    CARD8 	RepType;     	/* always X_ChangeDeviceControl	*/
+    CARD16 	sequenceNumber B16;
+    CARD32 	length B32;
+    CARD8 	status;
+    BYTE	pad1, pad2, pad3;
+    CARD32 	pad01 B32;
+    CARD32 	pad02 B32;
+    CARD32 	pad03 B32;
+    CARD32 	pad04 B32;
+    CARD32 	pad05 B32;
+} xChangeDeviceControlReply;
+
+typedef struct {
+    CARD16  	control B16; 	/* control type     	 	*/
+    CARD16  	length B16; 	/* control length  		*/
+} xDeviceCtl;
+
+typedef struct {
+    CARD16  	control B16; 		/* control type     	 	*/
+    CARD16  	length B16; 		/* control length  		*/
+    CARD8  	first_valuator; 	/* first valuator to change     */
+    CARD8  	num_valuators; 		/* number of valuators to change*/
+    CARD8  	pad1,pad2;
+} xDeviceResolutionCtl;
+
+typedef struct {
+     CARD16         control B16;
+     CARD16         length B16;
+     INT32          min_x;
+     INT32          max_x;
+     INT32          min_y;
+     INT32          max_y;
+     CARD32         flip_x;
+     CARD32         flip_y;
+     CARD32         rotation;
+     CARD32         button_threshold;
+} xDeviceAbsCalibCtl;
+
+typedef struct {
+     CARD16         control B16;
+     CARD16         length B16;
+     CARD32         offset_x;
+     CARD32         offset_y;
+     INT32          width;
+     INT32          height;
+     INT32          screen;
+     CARD32         following;
+} xDeviceAbsAreaCtl;
+
+typedef struct {
+    CARD16          control B16;
+    CARD16          length  B16;
+    CARD8           status;
+    CARD8           pad0;
+    CARD16          pad1 B16;
+} xDeviceCoreCtl;
+
+typedef struct {
+    CARD16          control B16;
+    CARD16          length  B16;
+    CARD8           enable;
+    CARD8           pad0;
+    CARD16          pad1 B16;
+} xDeviceEnableCtl;
+
+/**********************************************************
+ *
+ * Input extension events.
+ *
+ * DeviceValuator
+ *
+ */
+
+typedef struct
+    {
+    BYTE 	type;
+    CARD8       deviceid;
+    CARD16 	sequenceNumber B16;
+    KeyButMask  device_state B16;
+    CARD8	num_valuators;
+    CARD8       first_valuator;
+    INT32 	valuator0 B32;
+    INT32 	valuator1 B32;
+    INT32 	valuator2 B32;
+    INT32 	valuator3 B32;
+    INT32 	valuator4 B32;
+    INT32 	valuator5 B32;
+    }  deviceValuator;
+
+/**********************************************************
+ *
+ * DeviceKeyButtonPointer.
+ *
+ * Used for: DeviceKeyPress, DeviceKeyRelease,
+ *	     DeviceButtonPress, DeviceButtonRelease,
+ *	     ProximityIn, ProximityOut
+ *	     DeviceMotionNotify,
+ * 
+ */
+
+typedef struct
+    {
+    BYTE 	type;
+    BYTE        detail;
+    CARD16 	sequenceNumber B16;
+    Time        time B32;
+    Window      root B32;
+    Window      event B32;
+    Window      child B32;
+    INT16       root_x B16;
+    INT16       root_y B16;
+    INT16       event_x B16;
+    INT16       event_y B16;
+    KeyButMask  state B16;
+    BOOL        same_screen;
+    CARD8       deviceid;
+    }  deviceKeyButtonPointer;
+
+/**********************************************************
+ *
+ * DeviceFocus.
+ *
+ */
+
+typedef struct
+    {
+    BYTE 	type;
+    BYTE        detail;
+    CARD16 	sequenceNumber B16;
+    Time        time B32;
+    Window      window B32;
+    BYTE	mode;
+    CARD8       deviceid;
+    BYTE	pad1, pad2;
+    CARD32	pad00 B32;
+    CARD32	pad01 B32;
+    CARD32	pad02 B32;
+    CARD32	pad03 B32;
+    }  deviceFocus;
+
+/**********************************************************
+ *
+ * DeviceStateNotify.
+ *
+ * Note that the two high-order bits in the classes_reported
+ * field are the proximity state (InProximity or OutOfProximity),
+ * and the device mode (Absolute or Relative), respectively.
+ *
+ */
+
+typedef struct
+    {
+    BYTE 	type;
+    BYTE        deviceid;
+    CARD16 	sequenceNumber B16;
+    Time        time B32;
+    CARD8	num_keys;
+    CARD8	num_buttons;
+    CARD8	num_valuators;
+    CARD8       classes_reported;
+    CARD8       buttons[4];
+    CARD8       keys[4];
+    INT32	valuator0 B32;
+    INT32	valuator1 B32;
+    INT32	valuator2 B32;
+    }  deviceStateNotify;
+
+/**********************************************************
+ *
+ * DeviceKeyStateNotify.
+ *
+ */
+
+typedef struct
+    {
+    BYTE 	type;
+    BYTE        deviceid;
+    CARD16 	sequenceNumber B16;
+    CARD8       keys[28];
+    }  deviceKeyStateNotify;
+
+/**********************************************************
+ *
+ * DeviceButtonStateNotify.
+ *
+ */
+
+typedef struct
+    {
+    BYTE 	type;
+    BYTE        deviceid;
+    CARD16 	sequenceNumber B16;
+    CARD8       buttons[28];
+    }  deviceButtonStateNotify;
+
+/**********************************************************
+ *
+ * DeviceMappingNotify.
+ * Fields must be kept in sync with core mappingnotify event.
+ *
+ */
+
+typedef struct
+    {
+    BYTE 	type;
+    BYTE        deviceid;
+    CARD16 	sequenceNumber B16;
+    CARD8       request;
+    KeyCode     firstKeyCode;
+    CARD8       count;
+    BYTE        pad1;
+    Time        time B32;
+    CARD32	pad00 B32;
+    CARD32	pad01 B32;
+    CARD32	pad02 B32;
+    CARD32	pad03 B32;
+    CARD32	pad04 B32;
+    }  deviceMappingNotify;
+
+/**********************************************************
+ *
+ * ChangeDeviceNotify.
+ *
+ */
+
+typedef struct
+    {
+    BYTE 	type;
+    BYTE        deviceid;
+    CARD16 	sequenceNumber B16;
+    Time        time B32;
+    CARD8       request;
+    BYTE        pad1, pad2, pad3;
+    CARD32	pad00 B32;
+    CARD32	pad01 B32;
+    CARD32	pad02 B32;
+    CARD32	pad03 B32;
+    CARD32	pad04 B32;
+    }  changeDeviceNotify;
+
+/**********************************************************
+ *
+ * devicePresenceNotify.
+ *
+ */
+
+typedef struct
+    {
+    BYTE 	type;
+    BYTE        pad00;
+    CARD16 	sequenceNumber B16;
+    Time        time B32;
+    BYTE        devchange; /* Device{Added|Removed|Enabled|Disabled} */
+    BYTE        deviceid;
+    CARD16      control B16;
+    CARD32	pad02 B32;
+    CARD32	pad03 B32;
+    CARD32	pad04 B32;
+    CARD32	pad05 B32;
+    CARD32	pad06 B32;
+    }  devicePresenceNotify;
+
+#undef Window
+#undef Time
+#undef KeyCode
+
+#endif
Index: trunk/src/VBox/Additions/x11/x11include/1.4/xf86Xinput.h
===================================================================
--- trunk/src/VBox/Additions/x11/x11include/1.4/xf86Xinput.h	(revision 11548)
+++ trunk/src/VBox/Additions/x11/x11include/1.4/xf86Xinput.h	(revision 11548)
@@ -0,0 +1,215 @@
+/*
+ * Copyright 1995-1999 by Frederic Lepied, France. <Lepied@XFree86.org>
+ *                                                                            
+ * 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, and that   the  name of  Frederic   Lepied not  be  used  in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific,  written      prior  permission.     Frederic  Lepied   makes  no
+ * representations about the suitability of this software for any purpose.  It
+ * is provided "as is" without express or implied warranty.                   
+ *                                                                            
+ * FREDERIC  LEPIED DISCLAIMS ALL   WARRANTIES WITH REGARD  TO  THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED   WARRANTIES OF MERCHANTABILITY  AND   FITNESS, IN NO
+ * EVENT  SHALL FREDERIC  LEPIED 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.
+ *
+ */
+
+/*
+ * Copyright (c) 2000-2002 by The XFree86 Project, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
+ * and author(s) 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 copyright holder(s) and author(s).
+ */
+
+
+#ifndef _xf86Xinput_h
+#define _xf86Xinput_h
+
+#ifndef NEED_EVENTS
+#define NEED_EVENTS
+#endif
+#include "xf86str.h"
+#include "inputstr.h"
+#ifdef XINPUT
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "XIstubs.h"
+#endif
+
+/* Input device flags */
+#define XI86_OPEN_ON_INIT       0x01 /* open the device at startup time */
+#define XI86_CONFIGURED         0x02 /* the device has been configured */
+#define XI86_ALWAYS_CORE	0x04 /* device always controls the pointer */
+/* the device sends Xinput and core pointer events */
+#define XI86_SEND_CORE_EVENTS	XI86_ALWAYS_CORE
+/* if the device is the core pointer or is sending core events, and
+ * SEND_DRAG_EVENTS is false, and a buttons is done, then no motion events
+ * (mouse drag action) are sent. This is mainly to allow a touch screen to be
+ * used with netscape and other browsers which do strange things if the mouse
+ * moves between button down and button up. With a touch screen, this motion
+ * is common due to the user's finger moving slightly.
+ */
+#define XI86_SEND_DRAG_EVENTS	0x08
+#define XI86_CORE_POINTER	0x10 /* device is the core pointer */
+#define XI86_CORE_KEYBOARD	0x20 /* device is the core keyboard */
+#define XI86_POINTER_CAPABLE	0x40 /* capable of being a core pointer */
+#define XI86_KEYBOARD_CAPABLE	0x80 /* capable of being a core keyboard */
+
+#define XI_PRIVATE(dev) \
+	(((LocalDevicePtr)((dev)->public.devicePrivate))->private)
+
+/* Stupid API backwards-compatibility. */
+#define TS_Raw 60
+#define TS_Scaled 61
+
+#ifdef XINPUT
+/* This holds the input driver entry and module information. */
+typedef struct _InputDriverRec {
+    int			    driverVersion;
+    char *		    driverName;
+    void		    (*Identify)(int flags);
+    struct _LocalDeviceRec *(*PreInit)(struct _InputDriverRec *drv,
+				       IDevPtr dev, int flags);
+    void		    (*UnInit)(struct _InputDriverRec *drv,
+				      struct _LocalDeviceRec *pInfo,
+				      int flags);
+    pointer		    module;
+    int			    refCount;
+} InputDriverRec, *InputDriverPtr;
+#endif
+
+/* This is to input devices what the ScrnInfoRec is to screens. */
+
+typedef struct _LocalDeviceRec {
+    struct _LocalDeviceRec *next;
+    char *		    name;
+    int			    flags;
+
+    Bool		    (*device_control)(DeviceIntPtr device, int what);
+    void		    (*read_input)(struct _LocalDeviceRec *local);
+    int			    (*control_proc)(struct _LocalDeviceRec *local,
+					   xDeviceCtl *control);
+    void		    (*close_proc)(struct _LocalDeviceRec *local);
+    int			    (*switch_mode)(ClientPtr client, DeviceIntPtr dev,
+					  int mode);
+    Bool		    (*conversion_proc)(struct _LocalDeviceRec *local,
+					      int first, int num, int v0,
+					      int v1, int v2, int v3, int v4,
+					      int v5, int *x, int *y);
+    Bool		    (*reverse_conversion_proc)(
+					struct _LocalDeviceRec *local,
+					int x, int y, int *valuators);
+    int                     (*set_device_valuators)
+				(struct _LocalDeviceRec *local,
+				 int *valuators, int first_valuator,
+				 int num_valuators);
+
+    int			    fd;
+    Atom		    atom;
+    DeviceIntPtr	    dev;
+    pointer		    private;
+    int			    private_flags;
+    unsigned int	    first;
+    unsigned int	    last;
+    int			    old_x;
+    int			    old_y;
+    char *		    type_name;
+    IntegerFeedbackPtr	    always_core_feedback;
+    IDevPtr		    conf_idev;
+    InputDriverPtr	    drv;
+    pointer		    module;
+    pointer		    options;
+    unsigned int            history_size;
+} LocalDeviceRec, *LocalDevicePtr, InputInfoRec, *InputInfoPtr;
+
+typedef struct _DeviceAssocRec 
+{
+    char *		    config_section_name;
+    LocalDevicePtr	    (*device_allocate)(void);
+} DeviceAssocRec, *DeviceAssocPtr;
+
+/* xf86Globals.c */
+extern InputInfoPtr xf86InputDevs;
+
+/* xf86Xinput.c */
+void InitExtInput(void);
+void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute,
+			 int first_valuator, int num_valuators, ...);
+void xf86PostMotionEventP(DeviceIntPtr device, int is_absolute,
+			 int first_valuator, int num_valuators, int *valuators);
+void xf86PostProximityEvent(DeviceIntPtr device, int is_in,
+			    int first_valuator, int num_valuators, ...);
+void xf86PostButtonEvent(DeviceIntPtr device, int is_absolute, int button,
+		    	 int is_down, int first_valuator, int num_valuators,
+			 ...);
+void xf86PostKeyEvent(DeviceIntPtr device, unsigned int key_code, int is_down,
+		      int is_absolute, int first_valuator, int num_valuators,
+		      ...);
+void xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int key_code,
+                           int is_down);
+void xf86XinputFinalizeInit(DeviceIntPtr dev);
+void xf86ActivateDevice(LocalDevicePtr local);
+Bool xf86CheckButton(int button, int down);
+void xf86SwitchCoreDevice(LocalDevicePtr device, DeviceIntPtr core);
+LocalDevicePtr xf86FirstLocalDevice(void);
+int xf86ScaleAxis(int Cx, int Sxhigh, int Sxlow, int Rxhigh, int Rxlow);
+void xf86XInputSetScreen(LocalDevicePtr local, int screen_number, int x, int y);
+void xf86ProcessCommonOptions(InputInfoPtr pInfo, pointer options);
+void xf86InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, int minval,
+				int maxval, int resolution, int min_res,
+				int max_res);
+void xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum);
+void xf86AddEnabledDevice(InputInfoPtr pInfo);
+void xf86RemoveEnabledDevice(InputInfoPtr pInfo);
+void xf86DisableDevice(DeviceIntPtr dev, Bool panic);
+void xf86EnableDevice(DeviceIntPtr dev);
+
+/* xf86Helper.c */
+void xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags);
+void xf86DeleteInputDriver(int drvIndex);
+InputInfoPtr xf86AllocateInput(InputDriverPtr drv, int flags);
+InputDriverPtr xf86LookupInputDriver(const char *name);
+InputInfoPtr xf86LookupInput(const char *name);
+void xf86DeleteInput(InputInfoPtr pInp, int flags);
+void xf86MotionHistoryAllocate(LocalDevicePtr local);
+int xf86GetMotionEvents(DeviceIntPtr dev, xTimecoord *buff,
+                        unsigned long start, unsigned long stop,
+                        ScreenPtr pScreen);
+
+/* xf86Option.c */
+void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
+			     pointer extraOpts);
+
+
+/* Legacy hatred */
+#define SendCoreEvents 59
+#define DontSendCoreEvents 60
+
+#endif /* _xf86Xinput_h */
Index: trunk/src/VBox/Additions/x11/x11include/1.5/X11/X.h
===================================================================
--- trunk/src/VBox/Additions/x11/x11include/1.5/X11/X.h	(revision 11548)
+++ trunk/src/VBox/Additions/x11/x11include/1.5/X11/X.h	(revision 11548)
@@ -0,0 +1,721 @@
+/*
+ *	$Xorg: X.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $
+ */
+
+/* Definitions for the X window system likely to be used by applications */
+
+#ifndef X_H
+#define X_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.
+
+******************************************************************/
+/* $XFree86: xc/include/X.h,v 1.6 2003/07/09 15:27:28 tsi Exp $ */
+
+#define X_PROTOCOL	11		/* current protocol version */
+#define X_PROTOCOL_REVISION 0		/* current minor version */
+
+/* Resources */
+
+/*
+ * _XSERVER64 must ONLY be defined when compiling X server sources on
+ * systems where unsigned long is not 32 bits, must NOT be used in
+ * client or library code.
+ */
+#ifndef _XSERVER64
+#  ifndef _XTYPEDEF_XID
+#    define _XTYPEDEF_XID
+typedef unsigned long XID;
+#  endif
+#  ifndef _XTYPEDEF_MASK
+#    define _XTYPEDEF_MASK
+typedef unsigned long Mask;
+#  endif
+#  ifndef _XTYPEDEF_ATOM
+#    define _XTYPEDEF_ATOM
+typedef unsigned long Atom;		/* Also in Xdefs.h */
+#  endif
+typedef unsigned long VisualID;
+typedef unsigned long Time;
+#else
+#  include <X11/Xmd.h>
+#  ifndef _XTYPEDEF_XID
+#    define _XTYPEDEF_XID
+typedef CARD32 XID;
+#  endif
+#  ifndef _XTYPEDEF_MASK
+#    define _XTYPEDEF_MASK
+typedef CARD32 Mask;
+#  endif
+#  ifndef _XTYPEDEF_ATOM
+#    define _XTYPEDEF_ATOM
+typedef CARD32 Atom;
+#  endif
+typedef CARD32 VisualID;
+typedef CARD32 Time;
+#endif
+
+typedef XID Window;
+typedef XID Drawable;
+#ifndef _XTYPEDEF_FONT
+#  define _XTYPEDEF_FONT
+typedef XID Font;
+#endif
+typedef XID Pixmap;
+typedef XID Cursor;
+typedef XID Colormap;
+typedef XID GContext;
+typedef XID KeySym;
+
+typedef unsigned char KeyCode;
+
+/*****************************************************************
+ * RESERVED RESOURCE AND CONSTANT DEFINITIONS
+ *****************************************************************/
+
+#ifndef None
+#define None                 0L	/* universal null resource or null atom */
+#endif
+
+#define ParentRelative       1L	/* background pixmap in CreateWindow
+				    and ChangeWindowAttributes */
+
+#define CopyFromParent       0L	/* border pixmap in CreateWindow
+				       and ChangeWindowAttributes
+				   special VisualID and special window
+				       class passed to CreateWindow */
+
+#define PointerWindow        0L	/* destination window in SendEvent */
+#define InputFocus           1L	/* destination window in SendEvent */
+
+#define PointerRoot          1L	/* focus window in SetInputFocus */
+
+#define AnyPropertyType      0L	/* special Atom, passed to GetProperty */
+
+#define AnyKey		     0L	/* special Key Code, passed to GrabKey */
+
+#define AnyButton            0L	/* special Button Code, passed to GrabButton */
+
+#define AllTemporary         0L	/* special Resource ID passed to KillClient */
+
+#define CurrentTime          0L	/* special Time */
+
+#define NoSymbol	     0L	/* special KeySym */
+
+/***************************************************************** 
+ * EVENT DEFINITIONS 
+ *****************************************************************/
+
+/* Input Event Masks. Used as event-mask window attribute and as arguments
+   to Grab requests.  Not to be confused with event names.  */
+
+#define NoEventMask			0L
+#define KeyPressMask			(1L<<0)  
+#define KeyReleaseMask			(1L<<1)  
+#define ButtonPressMask			(1L<<2)  
+#define ButtonReleaseMask		(1L<<3)  
+#define EnterWindowMask			(1L<<4)  
+#define LeaveWindowMask			(1L<<5)  
+#define PointerMotionMask		(1L<<6)  
+#define PointerMotionHintMask		(1L<<7)  
+#define Button1MotionMask		(1L<<8)  
+#define Button2MotionMask		(1L<<9)  
+#define Button3MotionMask		(1L<<10) 
+#define Button4MotionMask		(1L<<11) 
+#define Button5MotionMask		(1L<<12) 
+#define ButtonMotionMask		(1L<<13) 
+#define KeymapStateMask			(1L<<14)
+#define ExposureMask			(1L<<15) 
+#define VisibilityChangeMask		(1L<<16) 
+#define StructureNotifyMask		(1L<<17) 
+#define ResizeRedirectMask		(1L<<18) 
+#define SubstructureNotifyMask		(1L<<19) 
+#define SubstructureRedirectMask	(1L<<20) 
+#define FocusChangeMask			(1L<<21) 
+#define PropertyChangeMask		(1L<<22) 
+#define ColormapChangeMask		(1L<<23) 
+#define OwnerGrabButtonMask		(1L<<24) 
+
+/* Event names.  Used in "type" field in XEvent structures.  Not to be
+confused with event masks above.  They start from 2 because 0 and 1
+are reserved in the protocol for errors and replies. */
+
+#define KeyPress		2
+#define KeyRelease		3
+#define ButtonPress		4
+#define ButtonRelease		5
+#define MotionNotify		6
+#define EnterNotify		7
+#define LeaveNotify		8
+#define FocusIn			9
+#define FocusOut		10
+#define KeymapNotify		11
+#define Expose			12
+#define GraphicsExpose		13
+#define NoExpose		14
+#define VisibilityNotify	15
+#define CreateNotify		16
+#define DestroyNotify		17
+#define UnmapNotify		18
+#define MapNotify		19
+#define MapRequest		20
+#define ReparentNotify		21
+#define ConfigureNotify		22
+#define ConfigureRequest	23
+#define GravityNotify		24
+#define ResizeRequest		25
+#define CirculateNotify		26
+#define CirculateRequest	27
+#define PropertyNotify		28
+#define SelectionClear		29
+#define SelectionRequest	30
+#define SelectionNotify		31
+#define ColormapNotify		32
+#define ClientMessage		33
+#define MappingNotify		34
+#define LASTEvent		35	/* must be bigger than any event # */
+
+
+/* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
+   state in various key-, mouse-, and button-related events. */
+
+#define ShiftMask		(1<<0)
+#define LockMask		(1<<1)
+#define ControlMask		(1<<2)
+#define Mod1Mask		(1<<3)
+#define Mod2Mask		(1<<4)
+#define Mod3Mask		(1<<5)
+#define Mod4Mask		(1<<6)
+#define Mod5Mask		(1<<7)
+
+/* modifier names.  Used to build a SetModifierMapping request or
+   to read a GetModifierMapping request.  These correspond to the
+   masks defined above. */
+#define ShiftMapIndex		0
+#define LockMapIndex		1
+#define ControlMapIndex		2
+#define Mod1MapIndex		3
+#define Mod2MapIndex		4
+#define Mod3MapIndex		5
+#define Mod4MapIndex		6
+#define Mod5MapIndex		7
+
+
+/* button masks.  Used in same manner as Key masks above. Not to be confused
+   with button names below. */
+
+#define Button1Mask		(1<<8)
+#define Button2Mask		(1<<9)
+#define Button3Mask		(1<<10)
+#define Button4Mask		(1<<11)
+#define Button5Mask		(1<<12)
+
+#define AnyModifier		(1<<15)  /* used in GrabButton, GrabKey */
+
+
+/* button names. Used as arguments to GrabButton and as detail in ButtonPress
+   and ButtonRelease events.  Not to be confused with button masks above.
+   Note that 0 is already defined above as "AnyButton".  */
+
+#define Button1			1
+#define Button2			2
+#define Button3			3
+#define Button4			4
+#define Button5			5
+
+/* Notify modes */
+
+#define NotifyNormal		0
+#define NotifyGrab		1
+#define NotifyUngrab		2
+#define NotifyWhileGrabbed	3
+
+#define NotifyHint		1	/* for MotionNotify events */
+		       
+/* Notify detail */
+
+#define NotifyAncestor		0
+#define NotifyVirtual		1
+#define NotifyInferior		2
+#define NotifyNonlinear		3
+#define NotifyNonlinearVirtual	4
+#define NotifyPointer		5
+#define NotifyPointerRoot	6
+#define NotifyDetailNone	7
+
+/* Visibility notify */
+
+#define VisibilityUnobscured		0
+#define VisibilityPartiallyObscured	1
+#define VisibilityFullyObscured		2
+
+/* Circulation request */
+
+#define PlaceOnTop		0
+#define PlaceOnBottom		1
+
+/* protocol families */
+
+#define FamilyInternet		0	/* IPv4 */
+#define FamilyDECnet		1
+#define FamilyChaos		2
+#define FamilyInternet6		6	/* IPv6 */
+
+/* authentication families not tied to a specific protocol */
+#define FamilyServerInterpreted 5
+
+/* Property notification */
+
+#define PropertyNewValue	0
+#define PropertyDelete		1
+
+/* Color Map notification */
+
+#define ColormapUninstalled	0
+#define ColormapInstalled	1
+
+/* GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes */
+
+#define GrabModeSync		0
+#define GrabModeAsync		1
+
+/* GrabPointer, GrabKeyboard reply status */
+
+#define GrabSuccess		0
+#define AlreadyGrabbed		1
+#define GrabInvalidTime		2
+#define GrabNotViewable		3
+#define GrabFrozen		4
+
+/* AllowEvents modes */
+
+#define AsyncPointer		0
+#define SyncPointer		1
+#define ReplayPointer		2
+#define AsyncKeyboard		3
+#define SyncKeyboard		4
+#define ReplayKeyboard		5
+#define AsyncBoth		6
+#define SyncBoth		7
+
+/* Used in SetInputFocus, GetInputFocus */
+
+#define RevertToNone		(int)None
+#define RevertToPointerRoot	(int)PointerRoot
+#define RevertToParent		2
+
+/*****************************************************************
+ * ERROR CODES 
+ *****************************************************************/
+
+#define Success		   0	/* everything's okay */
+#define BadRequest	   1	/* bad request code */
+#define BadValue	   2	/* int parameter out of range */
+#define BadWindow	   3	/* parameter not a Window */
+#define BadPixmap	   4	/* parameter not a Pixmap */
+#define BadAtom		   5	/* parameter not an Atom */
+#define BadCursor	   6	/* parameter not a Cursor */
+#define BadFont		   7	/* parameter not a Font */
+#define BadMatch	   8	/* parameter mismatch */
+#define BadDrawable	   9	/* parameter not a Pixmap or Window */
+#define BadAccess	  10	/* depending on context:
+				 - key/button already grabbed
+				 - attempt to free an illegal 
+				   cmap entry 
+				- attempt to store into a read-only 
+				   color map entry.
+ 				- attempt to modify the access control
+				   list from other than the local host.
+				*/
+#define BadAlloc	  11	/* insufficient resources */
+#define BadColor	  12	/* no such colormap */
+#define BadGC		  13	/* parameter not a GC */
+#define BadIDChoice	  14	/* choice not in range or already used */
+#define BadName		  15	/* font or color name doesn't exist */
+#define BadLength	  16	/* Request length incorrect */
+#define BadImplementation 17	/* server is defective */
+
+#define FirstExtensionError	128
+#define LastExtensionError	255
+
+/*****************************************************************
+ * WINDOW DEFINITIONS 
+ *****************************************************************/
+
+/* Window classes used by CreateWindow */
+/* Note that CopyFromParent is already defined as 0 above */
+
+#define InputOutput		1
+#define InputOnly		2
+
+/* Window attributes for CreateWindow and ChangeWindowAttributes */
+
+#define CWBackPixmap		(1L<<0)
+#define CWBackPixel		(1L<<1)
+#define CWBorderPixmap		(1L<<2)
+#define CWBorderPixel           (1L<<3)
+#define CWBitGravity		(1L<<4)
+#define CWWinGravity		(1L<<5)
+#define CWBackingStore          (1L<<6)
+#define CWBackingPlanes	        (1L<<7)
+#define CWBackingPixel	        (1L<<8)
+#define CWOverrideRedirect	(1L<<9)
+#define CWSaveUnder		(1L<<10)
+#define CWEventMask		(1L<<11)
+#define CWDontPropagate	        (1L<<12)
+#define CWColormap		(1L<<13)
+#define CWCursor	        (1L<<14)
+
+/* ConfigureWindow structure */
+
+#define CWX			(1<<0)
+#define CWY			(1<<1)
+#define CWWidth			(1<<2)
+#define CWHeight		(1<<3)
+#define CWBorderWidth		(1<<4)
+#define CWSibling		(1<<5)
+#define CWStackMode		(1<<6)
+
+
+/* Bit Gravity */
+
+#define ForgetGravity		0
+#define NorthWestGravity	1
+#define NorthGravity		2
+#define NorthEastGravity	3
+#define WestGravity		4
+#define CenterGravity		5
+#define EastGravity		6
+#define SouthWestGravity	7
+#define SouthGravity		8
+#define SouthEastGravity	9
+#define StaticGravity		10
+
+/* Window gravity + bit gravity above */
+
+#define UnmapGravity		0
+
+/* Used in CreateWindow for backing-store hint */
+
+#define NotUseful               0
+#define WhenMapped              1
+#define Always                  2
+
+/* Used in GetWindowAttributes reply */
+
+#define IsUnmapped		0
+#define IsUnviewable		1
+#define IsViewable		2
+
+/* Used in ChangeSaveSet */
+
+#define SetModeInsert           0
+#define SetModeDelete           1
+
+/* Used in ChangeCloseDownMode */
+
+#define DestroyAll              0
+#define RetainPermanent         1
+#define RetainTemporary         2
+
+/* Window stacking method (in configureWindow) */
+
+#define Above                   0
+#define Below                   1
+#define TopIf                   2
+#define BottomIf                3
+#define Opposite                4
+
+/* Circulation direction */
+
+#define RaiseLowest             0
+#define LowerHighest            1
+
+/* Property modes */
+
+#define PropModeReplace         0
+#define PropModePrepend         1
+#define PropModeAppend          2
+
+/*****************************************************************
+ * GRAPHICS DEFINITIONS
+ *****************************************************************/
+
+/* graphics functions, as in GC.alu */
+
+#define	GXclear			0x0		/* 0 */
+#define GXand			0x1		/* src AND dst */
+#define GXandReverse		0x2		/* src AND NOT dst */
+#define GXcopy			0x3		/* src */
+#define GXandInverted		0x4		/* NOT src AND dst */
+#define	GXnoop			0x5		/* dst */
+#define GXxor			0x6		/* src XOR dst */
+#define GXor			0x7		/* src OR dst */
+#define GXnor			0x8		/* NOT src AND NOT dst */
+#define GXequiv			0x9		/* NOT src XOR dst */
+#define GXinvert		0xa		/* NOT dst */
+#define GXorReverse		0xb		/* src OR NOT dst */
+#define GXcopyInverted		0xc		/* NOT src */
+#define GXorInverted		0xd		/* NOT src OR dst */
+#define GXnand			0xe		/* NOT src OR NOT dst */
+#define GXset			0xf		/* 1 */
+
+/* LineStyle */
+
+#define LineSolid		0
+#define LineOnOffDash		1
+#define LineDoubleDash		2
+
+/* capStyle */
+
+#define CapNotLast		0
+#define CapButt			1
+#define CapRound		2
+#define CapProjecting		3
+
+/* joinStyle */
+
+#define JoinMiter		0
+#define JoinRound		1
+#define JoinBevel		2
+
+/* fillStyle */
+
+#define FillSolid		0
+#define FillTiled		1
+#define FillStippled		2
+#define FillOpaqueStippled	3
+
+/* fillRule */
+
+#define EvenOddRule		0
+#define WindingRule		1
+
+/* subwindow mode */
+
+#define ClipByChildren		0
+#define IncludeInferiors	1
+
+/* SetClipRectangles ordering */
+
+#define Unsorted		0
+#define YSorted			1
+#define YXSorted		2
+#define YXBanded		3
+
+/* CoordinateMode for drawing routines */
+
+#define CoordModeOrigin		0	/* relative to the origin */
+#define CoordModePrevious       1	/* relative to previous point */
+
+/* Polygon shapes */
+
+#define Complex			0	/* paths may intersect */
+#define Nonconvex		1	/* no paths intersect, but not convex */
+#define Convex			2	/* wholly convex */
+
+/* Arc modes for PolyFillArc */
+
+#define ArcChord		0	/* join endpoints of arc */
+#define ArcPieSlice		1	/* join endpoints to center of arc */
+
+/* GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into
+   GC.stateChanges */
+
+#define GCFunction              (1L<<0)
+#define GCPlaneMask             (1L<<1)
+#define GCForeground            (1L<<2)
+#define GCBackground            (1L<<3)
+#define GCLineWidth             (1L<<4)
+#define GCLineStyle             (1L<<5)
+#define GCCapStyle              (1L<<6)
+#define GCJoinStyle		(1L<<7)
+#define GCFillStyle		(1L<<8)
+#define GCFillRule		(1L<<9) 
+#define GCTile			(1L<<10)
+#define GCStipple		(1L<<11)
+#define GCTileStipXOrigin	(1L<<12)
+#define GCTileStipYOrigin	(1L<<13)
+#define GCFont 			(1L<<14)
+#define GCSubwindowMode		(1L<<15)
+#define GCGraphicsExposures     (1L<<16)
+#define GCClipXOrigin		(1L<<17)
+#define GCClipYOrigin		(1L<<18)
+#define GCClipMask		(1L<<19)
+#define GCDashOffset		(1L<<20)
+#define GCDashList		(1L<<21)
+#define GCArcMode		(1L<<22)
+
+#define GCLastBit		22
+/*****************************************************************
+ * FONTS 
+ *****************************************************************/
+
+/* used in QueryFont -- draw direction */
+
+#define FontLeftToRight		0
+#define FontRightToLeft		1
+
+#define FontChange		255
+
+/*****************************************************************
+ *  IMAGING 
+ *****************************************************************/
+
+/* ImageFormat -- PutImage, GetImage */
+
+#define XYBitmap		0	/* depth 1, XYFormat */
+#define XYPixmap		1	/* depth == drawable depth */
+#define ZPixmap			2	/* depth == drawable depth */
+
+/*****************************************************************
+ *  COLOR MAP STUFF 
+ *****************************************************************/
+
+/* For CreateColormap */
+
+#define AllocNone		0	/* create map with no entries */
+#define AllocAll		1	/* allocate entire map writeable */
+
+
+/* Flags used in StoreNamedColor, StoreColors */
+
+#define DoRed			(1<<0)
+#define DoGreen			(1<<1)
+#define DoBlue			(1<<2)
+
+/*****************************************************************
+ * CURSOR STUFF
+ *****************************************************************/
+
+/* QueryBestSize Class */
+
+#define CursorShape		0	/* largest size that can be displayed */
+#define TileShape		1	/* size tiled fastest */
+#define StippleShape		2	/* size stippled fastest */
+
+/***************************************************************** 
+ * KEYBOARD/POINTER STUFF
+ *****************************************************************/
+
+#define AutoRepeatModeOff	0
+#define AutoRepeatModeOn	1
+#define AutoRepeatModeDefault	2
+
+#define LedModeOff		0
+#define LedModeOn		1
+
+/* masks for ChangeKeyboardControl */
+
+#define KBKeyClickPercent	(1L<<0)
+#define KBBellPercent		(1L<<1)
+#define KBBellPitch		(1L<<2)
+#define KBBellDuration		(1L<<3)
+#define KBLed			(1L<<4)
+#define KBLedMode		(1L<<5)
+#define KBKey			(1L<<6)
+#define KBAutoRepeatMode	(1L<<7)
+
+#define MappingSuccess     	0
+#define MappingBusy        	1
+#define MappingFailed		2
+
+#define MappingModifier		0
+#define MappingKeyboard		1
+#define MappingPointer		2
+
+/*****************************************************************
+ * SCREEN SAVER STUFF 
+ *****************************************************************/
+
+#define DontPreferBlanking	0
+#define PreferBlanking		1
+#define DefaultBlanking		2
+
+#define DisableScreenSaver	0
+#define DisableScreenInterval	0
+
+#define DontAllowExposures	0
+#define AllowExposures		1
+#define DefaultExposures	2
+
+/* for ForceScreenSaver */
+
+#define ScreenSaverReset 0
+#define ScreenSaverActive 1
+
+/*****************************************************************
+ * HOSTS AND CONNECTIONS
+ *****************************************************************/
+
+/* for ChangeHosts */
+
+#define HostInsert		0
+#define HostDelete		1
+
+/* for ChangeAccessControl */
+
+#define EnableAccess		1      
+#define DisableAccess		0
+
+/* Display classes  used in opening the connection 
+ * Note that the statically allocated ones are even numbered and the
+ * dynamically changeable ones are odd numbered */
+
+#define StaticGray		0
+#define GrayScale		1
+#define StaticColor		2
+#define PseudoColor		3
+#define TrueColor		4
+#define DirectColor		5
+
+
+/* Byte order  used in imageByteOrder and bitmapBitOrder */
+
+#define LSBFirst		0
+#define MSBFirst		1
+
+#endif /* X_H */
Index: trunk/src/VBox/Additions/x11/x11include/1.5/X11/Xarch.h
===================================================================
--- trunk/src/VBox/Additions/x11/x11include/1.5/X11/Xarch.h	(revision 11548)
+++ trunk/src/VBox/Additions/x11/x11include/1.5/X11/Xarch.h	(revision 11548)
@@ -0,0 +1,126 @@
+#ifndef _XARCH_H_
+#define _XARCH_H_
+
+/*
+ * Copyright 1997 Metro Link Incorporated
+ *
+ *                           All Rights Reserved
+ *
+ * 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, and that the names of the above listed copyright holder(s)
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission.  The above listed
+ * copyright holder(s) make(s) no representations about the suitability of
+ * this software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ *
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ */
+/* $XFree86: xc/include/Xarch.h,v 1.10tsi Exp $ */
+
+
+/*
+ * Determine the machine's byte order.
+ */
+
+/* See if it is set in the imake config first */
+#ifdef X_BYTE_ORDER
+
+#define X_BIG_ENDIAN 4321
+#define X_LITTLE_ENDIAN 1234
+
+#else
+
+#ifdef SVR4
+#if defined(NCR) || defined(Mips) || defined(__sgi)
+#include <sys/endian.h>
+#else
+#if !defined(sun)
+#include <sys/byteorder.h>
+#endif
+#endif
+#elif defined(CSRG_BASED)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
+#include <sys/types.h>
+#endif
+#include <machine/endian.h>
+#elif defined(linux)
+#if defined __STRICT_ANSI__
+#undef __STRICT_ANSI__
+#include <endian.h>
+#define __STRICT_ANSI__
+#else
+#include <endian.h>
+#endif
+/* 'endian.h' might have been included before 'Xarch.h' */
+#if !defined(LITTLE_ENDIAN) && defined(__LITTLE_ENDIAN)
+#define LITTLE_ENDIAN __LITTLE_ENDIAN
+#endif
+#if !defined(BIG_ENDIAN) && defined(__BIG_ENDIAN)
+#define BIG_ENDIAN __BIG_ENDIAN
+#endif
+#if !defined(PDP_ENDIAN) && defined(__PDP_ENDIAN)
+#define PDP_ENDIAN __PDP_ENDIAN
+#endif
+#if !defined(BYTE_ORDER) && defined(__BYTE_ORDER)
+#define BYTE_ORDER __BYTE_ORDER
+#endif
+#elif defined(Lynx)
+#if 0
+/* LynxOS 2.4.0 has wrong defines in bsd/ip.h */
+#include <bsd/in.h>
+#include <bsd/in_systm.h>
+#include <bsd/ip.h>
+#endif
+#endif
+
+#ifndef BYTE_ORDER
+#define LITTLE_ENDIAN 1234
+#define BIG_ENDIAN    4321
+
+#if defined(__QNX__) && !defined(__QNXNTO__)
+#define BYTE_ORDER LITTLE_ENDIAN
+#endif
+
+#if defined(__QNXNTO__)
+#if defined(i386) || defined(__i386__) || defined(__x86__)
+#define BYTE_ORDER LITTLE_ENDIAN
+#else
+#define BYTE_ORDER BIG_ENDIAN
+#endif
+#endif
+
+#ifdef Lynx
+#if defined(i386) || defined(__i386__) || defined(__x86__)
+#define BYTE_ORDER LITTLE_ENDIAN
+#else
+#define BYTE_ORDER BIG_ENDIAN
+#endif
+#endif
+#if (defined(sun) && defined(SVR4)) && !defined(Lynx)
+#include <sys/isa_defs.h>
+#ifdef _LITTLE_ENDIAN
+#define BYTE_ORDER LITTLE_ENDIAN
+#endif
+#ifdef _BIG_ENDIAN
+#define BYTE_ORDER BIG_ENDIAN
+#endif
+#endif /* sun */
+#endif /* BYTE_ORDER */
+
+#define X_BYTE_ORDER BYTE_ORDER
+#define X_BIG_ENDIAN BIG_ENDIAN
+#define X_LITTLE_ENDIAN LITTLE_ENDIAN
+
+#endif /* not in imake config */
+
+#endif /* _XARCH_H_ */
Index: trunk/src/VBox/Additions/x11/x11include/1.5/X11/Xdefs.h
===================================================================
--- trunk/src/VBox/Additions/x11/x11include/1.5/X11/Xdefs.h	(revision 11548)
+++ trunk/src/VBox/Additions/x11/x11include/1.5/X11/Xdefs.h	(revision 11548)
@@ -0,0 +1,110 @@
+/* $XFree86: xc/include/Xdefs.h,v 1.2 1999/08/22 06:21:20 dawes Exp $ */
+
+/***********************************************************
+
+Copyright (c) 1999  The XFree86 Project Inc.
+
+All Rights Reserved.
+
+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 XFree86 Project
+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 The XFree86 Project Inc..
+
+*/
+
+/**
+ ** Types definitions shared between server and clients 
+ **/
+
+#ifndef _XDEFS_H
+#define _XDEFS_H
+
+#ifdef _XSERVER64
+#include <X11/Xmd.h>
+#endif 
+
+#ifndef _XTYPEDEF_ATOM
+#  define _XTYPEDEF_ATOM
+#  ifndef _XSERVER64
+typedef unsigned long Atom;
+#  else
+typedef CARD32 Atom;
+#  endif
+#endif
+
+#ifndef Bool
+#  ifndef _XTYPEDEF_BOOL
+#   define _XTYPEDEF_BOOL
+typedef int Bool;
+#  endif
+#endif
+
+#ifndef _XTYPEDEF_POINTER
+#  define _XTYPEDEF_POINTER
+typedef void *pointer;
+#endif
+
+#ifndef _XTYPEDEF_CLIENTPTR
+typedef struct _Client *ClientPtr;
+#  define _XTYPEDEF_CLIENTPTR
+#endif
+
+#ifndef _XTYPEDEF_XID
+#  define _XTYPEDEF_XID
+#  ifndef _XSERVER64
+typedef unsigned long XID;
+#  else
+typedef CARD32 XID;
+#  endif
+#endif
+
+#ifndef _XTYPEDEF_MASK
+#  define _XTYPEDEF_MASK
+#  ifndef _XSERVER64
+typedef unsigned long Mask;
+#  else
+typedef CARD32 Mask;
+#  endif
+#endif
+
+#ifndef _XTYPEDEF_FONTPTR
+#  define _XTYPEDEF_FONTPTR
+typedef struct _Font *FontPtr; /* also in fonts/include/font.h */
+#endif
+
+#ifndef _XTYPEDEF_FONT
+#  define _XTYPEDEF_FONT
+typedef XID	Font;
+#endif
+
+#ifndef _XTYPEDEF_FSID
+#  ifndef _XSERVER64
+typedef unsigned long FSID;
+#  else
+typedef CARD32 FSID;
+#  endif
+#endif
+
+typedef FSID AccContext;
+
+/* OS independent time value 
+   XXX Should probably go in Xos.h */
+typedef struct timeval **OSTimePtr;
+
+
+typedef void (* BlockHandlerProcPtr)(pointer /* blockData */,
+				     OSTimePtr /* pTimeout */,
+				     pointer /* pReadmask */);
+
+#endif
Index: trunk/src/VBox/Additions/x11/x11include/1.5/X11/Xfuncs.h
===================================================================
--- trunk/src/VBox/Additions/x11/x11include/1.5/X11/Xfuncs.h	(revision 11548)
+++ trunk/src/VBox/Additions/x11/x11include/1.5/X11/Xfuncs.h	(revision 11548)
@@ -0,0 +1,94 @@
+/*
+ * $XdotOrg: xc/include/Xfuncs.h,v 1.2 2004/04/23 18:43:05 eich Exp $
+ * $Xorg: Xfuncs.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $
+ * 
+ * 
+Copyright 1990, 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.
+ *
+ */
+/* $XFree86: xc/include/Xfuncs.h,v 3.10 2002/05/31 18:45:38 dawes Exp $ */
+
+#ifndef _XFUNCS_H_
+#define _XFUNCS_H_
+
+#include <X11/Xosdefs.h>
+
+/* the old Xfuncs.h, for pre-R6 */
+#if !(defined(XFree86LOADER) && defined(IN_MODULE))
+
+#ifdef X_USEBFUNCS
+void bcopy();
+void bzero();
+int bcmp();
+#else
+#if defined(SYSV) && !defined(__SCO__) && !defined(sun) && !defined(__UNIXWARE__)
+#include <memory.h>
+void bcopy();
+#define bzero(b,len) memset(b, 0, len)
+#define bcmp(b1,b2,len) memcmp(b1, b2, len)
+#else
+#include <string.h>
+#if defined(__SCO__) || defined(sun) || defined(__UNIXWARE__)
+#include <strings.h>
+#endif
+#define _XFUNCS_H_INCLUDED_STRING_H
+#if defined(sun)
+#define bcopy(b1,b2,len) memmove(b2, b1, (size_t)(len))
+#define bzero(b,len) memset(b, 0, (size_t)(len))
+#define bcmp(b1,b2,len) memcmp(b1, b2, (size_t)(len))
+#endif
+#endif
+#endif /* X_USEBFUNCS */
+
+/* the new Xfuncs.h */
+
+#if !defined(X_NOT_STDC_ENV) && (!defined(sun) || defined(SVR4))
+/* the ANSI C way */
+#ifndef _XFUNCS_H_INCLUDED_STRING_H
+#include <string.h>
+#endif
+#undef bzero
+#define bzero(b,len) memset(b,0,len)
+#else /* else X_NOT_STDC_ENV or SunOS 4 */
+#if defined(SYSV) || defined(luna) || defined(sun) || defined(__sxg__)
+#include <memory.h>
+#define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
+#if defined(SYSV) && defined(_XBCOPYFUNC)
+#undef memmove
+#define memmove(dst,src,len) _XBCOPYFUNC((char *)(src),(char *)(dst),(int)(len))
+#define _XNEEDBCOPYFUNC
+#endif
+#else /* else vanilla BSD */
+#define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
+#define memcpy(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
+#define memcmp(b1,b2,len) bcmp((char *)(b1),(char *)(b2),(int)(len))
+#endif /* SYSV else */
+#endif /* ! X_NOT_STDC_ENV else */
+
+#if defined(X_NOT_STDC_ENV) || (defined(sun) && !defined(SVR4))
+#define atexit(f) on_exit(f, 0)
+#endif
+
+#endif /* !(defined(XFree86LOADER) && defined(IN_MODULE)) */
+
+#endif /* _XFUNCS_H_ */
Index: trunk/src/VBox/Additions/x11/x11include/1.5/X11/Xmd.h
===================================================================
--- trunk/src/VBox/Additions/x11/x11include/1.5/X11/Xmd.h	(revision 11548)
+++ trunk/src/VBox/Additions/x11/x11include/1.5/X11/Xmd.h	(revision 11548)
@@ -0,0 +1,211 @@
+/* $XdotOrg: $ */
+/* $XFree86: xc/include/Xmd.h,v 3.18tsi Exp $ */
+/***********************************************************
+
+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.
+
+******************************************************************/
+#ifndef XMD_H
+#define XMD_H 1
+/* $Xorg: Xmd.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ */
+/*
+ *  Xmd.h: MACHINE DEPENDENT DECLARATIONS.
+ */
+
+/*
+ * Special per-machine configuration flags.
+ */
+#if defined(sun) && defined(__SVR4)
+# include <sys/isa_defs.h> /* Solaris: defines _LP64 if necessary */
+#endif
+
+#ifdef CRAY
+#define WORD64				/* 64-bit architecture */
+#endif
+#if defined (_LP64) || \
+    defined(__alpha) || defined(__alpha__) || \
+    defined(__ia64__) || defined(ia64) || \
+    defined(__sparc64__) || \
+    defined(__s390x__) || \
+    (defined(__hppa__) && defined(__LP64__)) || \
+    defined(__amd64__) || defined(amd64) || \
+    defined(__powerpc64__) || \
+    (defined(sgi) && (_MIPS_SZLONG == 64))
+#define LONG64				/* 32/64-bit architecture */
+#endif
+
+/*
+ * Stuff to handle large architecture machines; the constants were generated
+ * on a 32-bit machine and must correspond to the protocol.
+ */
+#ifdef WORD64
+#define MUSTCOPY
+#endif /* WORD64 */
+
+
+/*
+ * Definition of macro used to set constants for size of network structures;
+ * machines with preprocessors that can't handle all of the sz_ symbols
+ * can define this macro to be sizeof(x) if and only if their compiler doesn't
+ * pad out structures (esp. the xTextElt structure which contains only two
+ * one-byte fields).  Network structures should always define sz_symbols.
+ *
+ * The sz_ prefix is used instead of something more descriptive so that the
+ * symbols are no more than 32 characters long (which causes problems for some
+ * compilers and preprocessors).
+ *
+ * The extra indirection in the __STDC__ case is to get macro arguments to
+ * expand correctly before the concatenation, rather than afterward.
+ */
+#if ((defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)) && !defined(UNIXCPP)) || defined(ANSICPP)
+#define _SIZEOF(x) sz_##x
+#define SIZEOF(x) _SIZEOF(x)
+#else
+#define SIZEOF(x) sz_/**/x
+#endif /* if ANSI C compiler else not */
+
+/*
+ * Bitfield suffixes for the protocol structure elements, if you
+ * need them.  Note that bitfields are not guaranteed to be signed
+ * (or even unsigned) according to ANSI C.
+ */
+#ifdef WORD64
+typedef long INT64;
+typedef unsigned long CARD64;
+#define B32 :32
+#define B16 :16
+#ifdef UNSIGNEDBITFIELDS
+typedef unsigned int INT32;
+typedef unsigned int INT16;
+#else
+#ifdef __STDC__
+typedef signed int INT32;
+typedef signed int INT16;
+#else
+typedef int INT32;
+typedef int INT16;
+#endif
+#endif
+#else
+#define B32
+#define B16
+#ifdef LONG64
+typedef long INT64;
+typedef int INT32;
+#else
+typedef long INT32;
+#endif
+typedef short INT16;
+#endif
+
+#if defined(__STDC__) || defined(sgi) || defined(_AIX)
+typedef signed char    INT8;
+#else
+typedef char           INT8;
+#endif
+
+#ifdef LONG64
+typedef unsigned long CARD64;
+typedef unsigned int CARD32;
+#else
+typedef unsigned long CARD32;
+#endif
+#if !defined(WORD64) && !defined(LONG64)
+typedef unsigned long long CARD64;
+#endif
+typedef unsigned short CARD16;
+typedef unsigned char  CARD8;
+
+typedef CARD32		BITS32;
+typedef CARD16		BITS16;
+
+#ifndef I_NEED_OS2_H
+typedef CARD8		BYTE;
+typedef CARD8		BOOL;
+#else
+#define BYTE	CARD8
+#define BOOL	CARD8
+#endif
+
+/*
+ * definitions for sign-extending bitfields on 64-bit architectures
+ */
+#if defined(WORD64) && defined(UNSIGNEDBITFIELDS)
+#define cvtINT8toInt(val)   (((val) & 0x00000080) ? ((val) | 0xffffffffffffff00) : (val))
+#define cvtINT16toInt(val)  (((val) & 0x00008000) ? ((val) | 0xffffffffffff0000) : (val))
+#define cvtINT32toInt(val)  (((val) & 0x80000000) ? ((val) | 0xffffffff00000000) : (val))
+#define cvtINT8toShort(val)  cvtINT8toInt(val)
+#define cvtINT16toShort(val) cvtINT16toInt(val)
+#define cvtINT32toShort(val) cvtINT32toInt(val)
+#define cvtINT8toLong(val)  cvtINT8toInt(val)
+#define cvtINT16toLong(val) cvtINT16toInt(val)
+#define cvtINT32toLong(val) cvtINT32toInt(val)
+#else
+#define cvtINT8toInt(val) (val)
+#define cvtINT16toInt(val) (val)
+#define cvtINT32toInt(val) (val)
+#define cvtINT8toShort(val) (val)
+#define cvtINT16toShort(val) (val)
+#define cvtINT32toShort(val) (val)
+#define cvtINT8toLong(val) (val)
+#define cvtINT16toLong(val) (val)
+#define cvtINT32toLong(val) (val)
+#endif /* WORD64 and UNSIGNEDBITFIELDS */
+
+
+
+#ifdef MUSTCOPY
+/*
+ * This macro must not cast or else pointers will get aligned and be wrong
+ */
+#define NEXTPTR(p,t)  (((char *) p) + SIZEOF(t))
+#else /* else not MUSTCOPY, this is used for 32-bit machines */
+/*
+ * this version should leave result of type (t *), but that should only be
+ * used when not in MUSTCOPY
+ */
+#define NEXTPTR(p,t) (((t *)(p)) + 1)
+#endif /* MUSTCOPY - used machines whose C structs don't line up with proto */
+
+#endif /* XMD_H */
Index: trunk/src/VBox/Additions/x11/x11include/1.5/X11/Xosdefs.h
===================================================================
--- trunk/src/VBox/Additions/x11/x11include/1.5/X11/Xosdefs.h	(revision 11548)
+++ trunk/src/VBox/Additions/x11/x11include/1.5/X11/Xosdefs.h	(revision 11548)
@@ -0,0 +1,166 @@
+/*
+ * O/S-dependent (mis)feature macro definitions
+ *
+ * $XdotOrg: xc/include/Xosdefs.h,v 1.3 2005/04/28 22:04:12 alanc Exp $
+ * $Xorg: Xosdefs.h,v 1.5 2001/02/09 02:03:23 xorgcvs Exp $
+ *
+Copyright 1991, 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.
+ */
+/* $XFree86: xc/include/Xosdefs.h,v 3.20 2002/05/31 18:45:39 dawes Exp $ */
+
+#ifndef _XOSDEFS_H_
+#define _XOSDEFS_H_
+
+/*
+ * X_NOT_STDC_ENV means does not have ANSI C header files.  Lack of this
+ * symbol does NOT mean that the system has stdarg.h.
+ *
+ * X_NOT_POSIX means does not have POSIX header files.  Lack of this
+ * symbol does NOT mean that the POSIX environment is the default.
+ * You may still have to define _POSIX_SOURCE to get it.
+ */
+
+#ifdef NOSTDHDRS
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+
+#ifdef sony
+#if !defined(SYSTYPE_SYSV) && !defined(_SYSTYPE_SYSV)
+#define X_NOT_POSIX
+#endif
+#endif
+
+#ifdef UTEK
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+
+#ifdef vax
+#ifndef ultrix			/* assume vanilla BSD */
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+#endif
+
+#ifdef luna
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+
+#ifdef Mips
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+  
+#ifdef USL
+#ifdef SYSV /* (release 3.2) */
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+#endif
+
+#ifdef _SCO_DS
+#ifndef __SCO__
+#define __SCO__
+#endif
+#endif
+
+#ifdef i386
+#ifdef SYSV
+#if !defined(ISC) && !defined(__SCO__) && !defined(_SEQUENT_) && \
+	!defined(__UNIXWARE__) && !defined(sun)
+#if !defined(_POSIX_SOURCE)
+#define X_NOT_POSIX
+#endif
+#define X_NOT_STDC_ENV
+#endif
+#endif
+#endif
+
+#ifdef MOTOROLA
+#ifdef SYSV
+#define X_NOT_STDC_ENV
+#endif
+#endif
+
+#ifdef sun
+/* Imake configs define SVR4 on Solaris, but cc & gcc only define __SVR4
+ * This check allows non-Imake configured programs to build correctly.
+ */
+#if defined(__SVR4) && !defined(SVR4)
+#define SVR4 1
+#endif
+#ifdef SVR4
+/* define this to whatever it needs to be */
+#define X_POSIX_C_SOURCE 199300L
+#endif
+#endif
+
+#ifdef WIN32
+#ifndef _POSIX_
+#define X_NOT_POSIX
+#endif
+#endif
+
+#if defined(nec_ews_svr2) || defined(SX) || defined(PC_UX)
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+
+#ifdef __UNIXOS2__
+#define USGISH
+#define NULL_NOT_ZERO
+#endif
+
+#ifdef __DARWIN__
+#define NULL_NOT_ZERO
+#endif
+
+#ifdef __GNU__
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 4096
+#endif
+#endif
+
+#if defined(__SCO__) || defined(__UNIXWARE__)
+# ifndef PATH_MAX
+#  define PATH_MAX	1024
+# endif
+# ifndef MAXPATHLEN
+#  define MAXPATHLEN	1024
+# endif
+#endif
+
+#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) \
+	|| defined(__Darwin__) || defined(__DragonFly__)
+# ifndef CSRG_BASED
+#  define CSRG_BASED
+# endif
+#endif
+
+#endif /* _XOSDEFS_H_ */
+
Index: trunk/src/VBox/Additions/x11/x11include/1.5/X11/Xproto.h
===================================================================
--- trunk/src/VBox/Additions/x11/x11include/1.5/X11/Xproto.h	(revision 11548)
+++ trunk/src/VBox/Additions/x11/x11include/1.5/X11/Xproto.h	(revision 11548)
@@ -0,0 +1,2134 @@
+/*
+ *	$Xorg: Xproto.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $
+ */
+
+/* Definitions for the X window system used by server and c bindings */
+
+/*
+ * This packet-construction scheme makes the following assumptions:
+ *
+ * 1. The compiler is able
+ * to generate code which addresses one- and two-byte quantities.
+ * In the worst case, this would be done with bit-fields.  If bit-fields
+ * are used it may be necessary to reorder the request fields in this file,
+ * depending on the order in which the machine assigns bit fields to
+ * machine words.  There may also be a problem with sign extension,
+ * as K+R specify that bitfields are always unsigned.
+ *
+ * 2. 2- and 4-byte fields in packet structures must be ordered by hand
+ * such that they are naturally-aligned, so that no compiler will ever
+ * insert padding bytes.
+ *
+ * 3. All packets are hand-padded to a multiple of 4 bytes, for
+ * the same reason.
+ */
+
+#ifndef XPROTO_H
+#define XPROTO_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.
+
+******************************************************************/
+
+#include <X11/Xmd.h>
+#include <X11/Xprotostr.h>
+
+/*
+ * Define constants for the sizes of the network packets.  The sz_ prefix is
+ * used instead of something more descriptive so that the symbols are no more
+ * than 32 characters in length (which causes problems for some compilers).
+ */
+#define sz_xSegment 8
+#define sz_xPoint 4
+#define sz_xRectangle 8
+#define sz_xArc 12
+#define sz_xConnClientPrefix 12
+#define sz_xConnSetupPrefix 8
+#define sz_xConnSetup 32
+#define sz_xPixmapFormat 8
+#define sz_xDepth 8
+#define sz_xVisualType 24
+#define sz_xWindowRoot 40
+#define sz_xTimecoord 8
+#define sz_xHostEntry 4
+#define sz_xCharInfo 12
+#define sz_xFontProp 8
+#define sz_xTextElt 2
+#define sz_xColorItem 12
+#define sz_xrgb 8
+#define sz_xGenericReply 32
+#define sz_xGetWindowAttributesReply 44
+#define sz_xGetGeometryReply 32
+#define sz_xQueryTreeReply 32
+#define sz_xInternAtomReply 32
+#define sz_xGetAtomNameReply 32
+#define sz_xGetPropertyReply 32
+#define sz_xListPropertiesReply 32
+#define sz_xGetSelectionOwnerReply 32
+#define sz_xGrabPointerReply 32
+#define sz_xQueryPointerReply 32
+#define sz_xGetMotionEventsReply 32
+#define sz_xTranslateCoordsReply 32
+#define sz_xGetInputFocusReply 32
+#define sz_xQueryKeymapReply 40
+#define sz_xQueryFontReply 60
+#define sz_xQueryTextExtentsReply 32
+#define sz_xListFontsReply 32
+#define sz_xGetFontPathReply 32
+#define sz_xGetImageReply 32
+#define sz_xListInstalledColormapsReply 32
+#define sz_xAllocColorReply 32
+#define sz_xAllocNamedColorReply 32
+#define sz_xAllocColorCellsReply 32
+#define sz_xAllocColorPlanesReply 32
+#define sz_xQueryColorsReply 32
+#define sz_xLookupColorReply 32
+#define sz_xQueryBestSizeReply 32
+#define sz_xQueryExtensionReply 32
+#define sz_xListExtensionsReply 32
+#define sz_xSetMappingReply 32
+#define sz_xGetKeyboardControlReply 52
+#define sz_xGetPointerControlReply 32
+#define sz_xGetScreenSaverReply 32
+#define sz_xListHostsReply 32
+#define sz_xSetModifierMappingReply 32
+#define sz_xError 32
+#define sz_xEvent 32
+#define sz_xKeymapEvent 32
+#define sz_xReq 4
+#define sz_xResourceReq 8
+#define sz_xCreateWindowReq 32
+#define sz_xChangeWindowAttributesReq 12
+#define sz_xChangeSaveSetReq 8
+#define sz_xReparentWindowReq 16
+#define sz_xConfigureWindowReq 12
+#define sz_xCirculateWindowReq 8
+#define sz_xInternAtomReq 8
+#define sz_xChangePropertyReq 24
+#define sz_xDeletePropertyReq 12
+#define sz_xGetPropertyReq 24
+#define sz_xSetSelectionOwnerReq 16
+#define sz_xConvertSelectionReq 24
+#define sz_xSendEventReq 44
+#define sz_xGrabPointerReq 24
+#define sz_xGrabButtonReq 24
+#define sz_xUngrabButtonReq 12
+#define sz_xChangeActivePointerGrabReq 16
+#define sz_xGrabKeyboardReq 16
+#define sz_xGrabKeyReq 16
+#define sz_xUngrabKeyReq 12
+#define sz_xAllowEventsReq 8
+#define sz_xGetMotionEventsReq 16
+#define sz_xTranslateCoordsReq 16
+#define sz_xWarpPointerReq 24
+#define sz_xSetInputFocusReq 12
+#define sz_xOpenFontReq 12
+#define sz_xQueryTextExtentsReq 8
+#define sz_xListFontsReq 8
+#define sz_xSetFontPathReq 8
+#define sz_xCreatePixmapReq 16
+#define sz_xCreateGCReq 16
+#define sz_xChangeGCReq 12
+#define sz_xCopyGCReq 16
+#define sz_xSetDashesReq 12
+#define sz_xSetClipRectanglesReq 12
+#define sz_xCopyAreaReq 28
+#define sz_xCopyPlaneReq 32
+#define sz_xPolyPointReq 12
+#define sz_xPolySegmentReq 12
+#define sz_xFillPolyReq 16
+#define sz_xPutImageReq 24
+#define sz_xGetImageReq 20
+#define sz_xPolyTextReq 16
+#define sz_xImageTextReq 16
+#define sz_xCreateColormapReq 16
+#define sz_xCopyColormapAndFreeReq 12
+#define sz_xAllocColorReq 16
+#define sz_xAllocNamedColorReq 12
+#define sz_xAllocColorCellsReq 12
+#define sz_xAllocColorPlanesReq 16
+#define sz_xFreeColorsReq 12
+#define sz_xStoreColorsReq 8
+#define sz_xStoreNamedColorReq 16
+#define sz_xQueryColorsReq 8
+#define sz_xLookupColorReq 12
+#define sz_xCreateCursorReq 32
+#define sz_xCreateGlyphCursorReq 32
+#define sz_xRecolorCursorReq 20
+#define sz_xQueryBestSizeReq 12
+#define sz_xQueryExtensionReq 8
+#define sz_xChangeKeyboardControlReq 8
+#define sz_xBellReq 4
+#define sz_xChangePointerControlReq 12
+#define sz_xSetScreenSaverReq 12
+#define sz_xChangeHostsReq 8
+#define sz_xListHostsReq 4
+#define sz_xChangeModeReq 4
+#define sz_xRotatePropertiesReq 12
+#define sz_xReply 32
+#define sz_xGrabKeyboardReply 32
+#define sz_xListFontsWithInfoReply 60
+#define sz_xSetPointerMappingReply 32
+#define sz_xGetKeyboardMappingReply 32
+#define sz_xGetPointerMappingReply 32
+#define sz_xGetModifierMappingReply 32
+#define sz_xListFontsWithInfoReq 8
+#define sz_xPolyLineReq 12
+#define sz_xPolyArcReq 12
+#define sz_xPolyRectangleReq 12
+#define sz_xPolyFillRectangleReq 12
+#define sz_xPolyFillArcReq 12
+#define sz_xPolyText8Req 16
+#define sz_xPolyText16Req 16
+#define sz_xImageText8Req 16
+#define sz_xImageText16Req 16
+#define sz_xSetPointerMappingReq 4
+#define sz_xForceScreenSaverReq 4
+#define sz_xSetCloseDownModeReq 4
+#define sz_xClearAreaReq 16
+#define sz_xSetAccessControlReq 4
+#define sz_xGetKeyboardMappingReq 8
+#define sz_xSetModifierMappingReq 4
+#define sz_xPropIconSize 24
+#define sz_xChangeKeyboardMappingReq 8
+
+
+/* For the purpose of the structure definitions in this file,
+we must redefine the following types in terms of Xmd.h's types, which may
+include bit fields.  All of these are #undef'd at the end of this file,
+restoring the definitions in X.h.  */
+
+#define Window CARD32
+#define Drawable CARD32
+#define Font CARD32
+#define Pixmap CARD32
+#define Cursor CARD32
+#define Colormap CARD32
+#define GContext CARD32
+#define Atom CARD32
+#define VisualID CARD32
+#define Time CARD32
+#define KeyCode CARD8
+#define KeySym CARD32
+
+#define X_TCP_PORT 6000     /* add display number */
+
+#define xTrue        1
+#define xFalse       0
+
+
+typedef CARD16 KeyButMask;
+
+/***************** 
+   connection setup structure.  This is followed by
+   numRoots xWindowRoot structs.
+*****************/
+
+typedef struct {
+    CARD8	byteOrder;
+    BYTE	pad;
+    CARD16	majorVersion B16, minorVersion B16;
+    CARD16	nbytesAuthProto B16;	/* Authorization protocol */
+    CARD16	nbytesAuthString B16;	/* Authorization string */
+    CARD16	pad2 B16;
+} xConnClientPrefix;
+
+typedef struct {
+    CARD8          success;
+    BYTE           lengthReason; /*num bytes in string following if failure */
+    CARD16         majorVersion B16, 
+                   minorVersion B16;
+    CARD16         length B16;  /* 1/4 additional bytes in setup info */
+} xConnSetupPrefix;
+
+
+typedef struct {
+    CARD32         release B32;
+    CARD32         ridBase B32, 
+                   ridMask B32;
+    CARD32         motionBufferSize B32;
+    CARD16         nbytesVendor B16;  /* number of bytes in vendor string */
+    CARD16         maxRequestSize B16;
+    CARD8          numRoots;          /* number of roots structs to follow */
+    CARD8          numFormats;        /* number of pixmap formats */
+    CARD8          imageByteOrder;        /* LSBFirst, MSBFirst */
+    CARD8          bitmapBitOrder;        /* LeastSignificant, MostSign...*/
+    CARD8          bitmapScanlineUnit,     /* 8, 16, 32 */
+                   bitmapScanlinePad;     /* 8, 16, 32 */
+    KeyCode	   minKeyCode, maxKeyCode;
+    CARD32	   pad2 B32;
+} xConnSetup;
+
+typedef struct {
+    CARD8          depth;
+    CARD8          bitsPerPixel;
+    CARD8          scanLinePad;
+    CARD8          pad1;
+    CARD32	   pad2 B32;
+} xPixmapFormat;
+
+/* window root */
+
+typedef struct {
+    CARD8 	depth;
+    CARD8 	pad1;
+    CARD16	nVisuals B16;  /* number of xVisualType structures following */
+    CARD32	pad2 B32;
+    } xDepth;
+
+typedef struct {
+    VisualID visualID B32;
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8 c_class;
+#else
+    CARD8 class;
+#endif
+    CARD8 bitsPerRGB;
+    CARD16 colormapEntries B16;
+    CARD32 redMask B32, greenMask B32, blueMask B32;
+    CARD32 pad B32;
+    } xVisualType;
+
+typedef struct {
+    Window         windowId B32;
+    Colormap       defaultColormap B32;
+    CARD32         whitePixel B32, blackPixel B32;
+    CARD32         currentInputMask B32;   
+    CARD16         pixWidth B16, pixHeight B16;
+    CARD16         mmWidth B16, mmHeight B16;
+    CARD16         minInstalledMaps B16, maxInstalledMaps B16;
+    VisualID       rootVisualID B32;
+    CARD8          backingStore;
+    BOOL           saveUnders;
+    CARD8          rootDepth;
+    CARD8          nDepths;  /* number of xDepth structures following */
+} xWindowRoot;
+
+
+
+/*****************************************************************
+ * Structure Defns
+ *   Structures needed for replies 
+ *****************************************************************/
+
+/* Used in GetMotionEvents */
+
+typedef struct {
+    CARD32 time B32;
+    INT16 x B16, y B16;
+} xTimecoord;
+
+typedef struct {
+    CARD8 family;
+    BYTE pad;
+    CARD16 length B16;
+} xHostEntry;
+
+typedef struct {
+    INT16 leftSideBearing B16,
+	  rightSideBearing B16,
+	  characterWidth B16,
+	  ascent B16,
+	  descent B16;
+    CARD16 attributes B16;
+} xCharInfo;
+
+typedef struct {
+    Atom name B32;
+    CARD32 value B32;
+} xFontProp;
+
+/*
+ * non-aligned big-endian font ID follows this struct
+ */
+typedef struct {           /* followed by string */
+    CARD8 len;	/* number of *characters* in string, or FontChange (255)
+		   for font change, or 0 if just delta given */
+    INT8 delta;
+} xTextElt;
+
+
+typedef struct {        
+    CARD32 pixel B32;
+    CARD16 red B16, green B16, blue B16;
+    CARD8 flags;  /* DoRed, DoGreen, DoBlue booleans */
+    CARD8 pad;
+} xColorItem;
+
+
+typedef struct {
+    CARD16 red B16, green B16, blue B16, pad B16;
+} xrgb;
+
+typedef CARD8 KEYCODE;
+
+
+
+/*****************
+ * XRep:
+ *    meant to be 32 byte quantity 
+ *****************/
+
+/* GenericReply is the common format of all replies.  The "data" items
+   are specific to each individual reply type. */
+
+typedef struct {	
+    BYTE type;              /* X_Reply */
+    BYTE data1;             /* depends on reply type */
+    CARD16 sequenceNumber B16;  /* of last request received by server */
+    CARD32 length B32;      /* 4 byte quantities beyond size of GenericReply */
+    CARD32 data00 B32;
+    CARD32 data01 B32;
+    CARD32 data02 B32;
+    CARD32 data03 B32;
+    CARD32 data04 B32;
+    CARD32 data05 B32;
+    } xGenericReply;
+
+/* Individual reply formats. */
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    CARD8 backingStore;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;	/* NOT 0; this is an extra-large reply */
+    VisualID visualID B32;
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD16 c_class B16;
+#else
+    CARD16 class B16;
+#endif
+    CARD8 bitGravity;
+    CARD8 winGravity;
+    CARD32 backingBitPlanes B32;
+    CARD32 backingPixel B32;
+    BOOL saveUnder;
+    BOOL mapInstalled;
+    CARD8 mapState;
+    BOOL override;
+    Colormap colormap B32;
+    CARD32 allEventMasks B32;
+    CARD32 yourEventMask B32;
+    CARD16 doNotPropagateMask B16;
+    CARD16 pad B16;
+    } xGetWindowAttributesReply;
+
+typedef struct {
+    BYTE type;   /* X_Reply */
+    CARD8 depth;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 0 */
+    Window root B32;
+    INT16 x B16, y B16;
+    CARD16 width B16, height B16;
+    CARD16 borderWidth B16;
+    CARD16 pad1 B16;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    } xGetGeometryReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    Window root B32, parent B32;
+    CARD16 nChildren B16;
+    CARD16 pad2 B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    } xQueryTreeReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32; /* 0 */
+    Atom atom B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    } xInternAtomReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* of additional bytes */
+    CARD16 nameLength B16;  /* # of characters in name */
+    CARD16 pad2 B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xGetAtomNameReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    CARD8 format;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32; /* of additional bytes */
+    Atom propertyType B32;
+    CARD32 bytesAfter B32;
+    CARD32 nItems B32; /* # of 8, 16, or 32-bit entities in reply */
+    CARD32 pad1 B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    } xGetPropertyReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD16 nProperties B16;
+    CARD16 pad2 B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xListPropertiesReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 0 */
+    Window owner B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    } xGetSelectionOwnerReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE status;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 0 */
+    CARD32 pad1 B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    } xGrabPointerReply;
+
+typedef xGrabPointerReply xGrabKeyboardReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BOOL sameScreen;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 0 */
+    Window root B32, child B32;
+    INT16 rootX B16, rootY B16, winX B16, winY B16;
+    CARD16 mask B16;
+    CARD16 pad1 B16;
+    CARD32 pad B32;
+    } xQueryPointerReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD32 nEvents B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    } xGetMotionEventsReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BOOL sameScreen;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32; /* 0 */
+    Window child B32;
+    INT16 dstX B16, dstY B16;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    } xTranslateCoordsReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    CARD8 revertTo;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 0 */
+    Window focus B32;
+    CARD32 pad1 B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    } xGetInputFocusReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 2, NOT 0; this is an extra-large reply */
+    BYTE map[32];
+    } xQueryKeymapReply;
+
+/* Warning: this MUST match (up to component renaming) xListFontsWithInfoReply */
+typedef struct _xQueryFontReply {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* definitely > 0, even if "nCharInfos" is 0 */
+    xCharInfo minBounds; 
+#ifndef WORD64
+    CARD32 walign1 B32;
+#endif
+    xCharInfo maxBounds; 
+#ifndef WORD64
+    CARD32 walign2 B32;
+#endif
+    CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;
+    CARD16 defaultChar B16;
+    CARD16 nFontProps B16;  /* followed by this many xFontProp structures */
+    CARD8 drawDirection;
+    CARD8 minByte1, maxByte1;
+    BOOL allCharsExist;
+    INT16 fontAscent B16, fontDescent B16;
+    CARD32 nCharInfos B32; /* followed by this many xCharInfo structures */
+} xQueryFontReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    CARD8 drawDirection;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 0 */
+    INT16 fontAscent B16, fontDescent B16;
+    INT16 overallAscent B16, overallDescent B16;
+    INT32 overallWidth B32, overallLeft B32, overallRight B32;
+    CARD32 pad B32;
+    } xQueryTextExtentsReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD16 nFonts B16;
+    CARD16 pad2 B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xListFontsReply;
+
+/* Warning: this MUST match (up to component renaming) xQueryFontReply */
+typedef struct {
+    BYTE type;  /* X_Reply */
+    CARD8 nameLength;  /* 0 indicates end-of-reply-sequence */
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* definitely > 0, even if "nameLength" is 0 */
+    xCharInfo minBounds; 
+#ifndef WORD64
+    CARD32 walign1 B32;
+#endif
+    xCharInfo maxBounds; 
+#ifndef WORD64
+    CARD32 walign2 B32;
+#endif
+    CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;
+    CARD16 defaultChar B16;
+    CARD16 nFontProps B16;  /* followed by this many xFontProp structures */
+    CARD8 drawDirection;
+    CARD8 minByte1, maxByte1;
+    BOOL allCharsExist;
+    INT16 fontAscent B16, fontDescent B16;
+    CARD32 nReplies B32;   /* hint as to how many more replies might be coming */
+} xListFontsWithInfoReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD16 nPaths B16;
+    CARD16 pad2 B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xGetFontPathReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    CARD8 depth;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    VisualID visual B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xGetImageReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD16 nColormaps B16;
+    CARD16 pad2 B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xListInstalledColormapsReply;
+
+typedef struct {
+    BYTE type; /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;   /* 0 */
+    CARD16 red B16, green B16, blue B16;
+    CARD16 pad2 B16;
+    CARD32 pixel B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    } xAllocColorReply;
+
+typedef struct {
+    BYTE type; /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 0 */
+    CARD32 pixel B32;
+    CARD16 exactRed B16, exactGreen B16, exactBlue B16;
+    CARD16 screenRed B16, screenGreen B16, screenBlue B16;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    } xAllocNamedColorReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD16 nPixels B16, nMasks B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xAllocColorCellsReply;
+
+typedef struct {
+    BYTE type; /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD16 nPixels B16;
+    CARD16 pad2 B16;
+    CARD32 redMask B32, greenMask B32, blueMask B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    } xAllocColorPlanesReply;
+
+typedef struct {
+    BYTE type; /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD16 nColors B16;
+    CARD16 pad2 B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xQueryColorsReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 0 */
+    CARD16 exactRed B16, exactGreen B16, exactBlue B16;
+    CARD16 screenRed B16, screenGreen B16, screenBlue B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    } xLookupColorReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 0 */
+    CARD16 width B16, height B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xQueryBestSizeReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32; /* 0 */
+    BOOL  present;
+    CARD8 major_opcode;
+    CARD8 first_event;
+    CARD8 first_error;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xQueryExtensionReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    CARD8 nExtensions;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xListExtensionsReply;
+
+
+typedef struct {
+    BYTE   type;  /* X_Reply */
+    CARD8  success;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xSetMappingReply;
+typedef xSetMappingReply xSetPointerMappingReply;
+typedef xSetMappingReply xSetModifierMappingReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    CARD8 nElts;  /* how many elements does the map have */
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xGetPointerMappingReply;
+
+typedef struct {
+    BYTE type;
+    CARD8 keySymsPerKeyCode;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+} xGetKeyboardMappingReply;    
+
+typedef struct {
+    BYTE type;
+    CARD8 numKeyPerModifier;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD32 pad1 B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+} xGetModifierMappingReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BOOL globalAutoRepeat;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 5 */
+    CARD32 ledMask B32;
+    CARD8 keyClickPercent, bellPercent;
+    CARD16 bellPitch B16, bellDuration B16;
+    CARD16 pad B16;
+    BYTE map[32];  /* bit masks start here */
+    } xGetKeyboardControlReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 0 */
+    CARD16 accelNumerator B16, accelDenominator B16;
+    CARD16 threshold B16;
+    CARD16 pad2 B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    } xGetPointerControlReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BYTE pad1;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;  /* 0 */
+    CARD16 timeout B16, interval B16;
+    BOOL preferBlanking;
+    BOOL allowExposures;
+    CARD16 pad2 B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    } xGetScreenSaverReply;
+
+typedef struct {
+    BYTE type;  /* X_Reply */
+    BOOL enabled;
+    CARD16 sequenceNumber B16;
+    CARD32 length B32;
+    CARD16 nHosts B16;
+    CARD16 pad1 B16;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+    } xListHostsReply;
+
+
+
+
+
+/*****************************************************************
+ * Xerror
+ *    All errors  are 32 bytes 
+ *****************************************************************/
+
+typedef struct {
+    BYTE type;                  /* X_Error */
+    BYTE errorCode;
+    CARD16 sequenceNumber B16;       /* the nth request from this client */
+    CARD32 resourceID B32;
+    CARD16 minorCode B16;
+    CARD8 majorCode;
+    BYTE pad1;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+    CARD32 pad7 B32;
+} xError;
+
+/*****************************************************************
+ * xEvent
+ *    All events are 32 bytes
+ *****************************************************************/
+
+typedef struct _xEvent {
+    union {
+	struct {
+	    BYTE type;
+	    BYTE detail;
+	    CARD16 sequenceNumber B16;
+	    } u;
+	struct {
+            CARD32 pad00 B32;
+	    Time time B32;
+	    Window root B32, event B32, child B32;
+	    INT16 rootX B16, rootY B16, eventX B16, eventY B16;
+	    KeyButMask state B16;
+	    BOOL sameScreen;		
+	    BYTE pad1;
+	} keyButtonPointer;
+	struct {
+            CARD32 pad00 B32;
+            Time time B32;
+	    Window root B32, event B32, child B32;
+	    INT16 rootX B16, rootY B16, eventX B16, eventY B16;
+	    KeyButMask state B16;
+	    BYTE mode; 			/* really XMode */
+	    BYTE flags;		/* sameScreen and focus booleans, packed together */
+#define ELFlagFocus        (1<<0)
+#define ELFlagSameScreen   (1<<1)
+	} enterLeave;
+	struct {
+            CARD32 pad00 B32;
+	    Window window B32;
+	    BYTE mode; 			/* really XMode */
+	    BYTE pad1, pad2, pad3;
+	} focus;
+	struct {
+            CARD32 pad00 B32;
+	    Window window B32;
+	    CARD16 x B16, y B16, width B16, height B16;
+	    CARD16 count B16;
+	    CARD16 pad2 B16;
+	} expose;
+	struct {
+            CARD32 pad00 B32;
+	    Drawable drawable B32;
+	    CARD16 x B16, y B16, width B16, height B16;
+	    CARD16 minorEvent B16;
+	    CARD16 count B16;
+	    BYTE majorEvent;
+	    BYTE pad1, pad2, pad3;
+	} graphicsExposure;
+	struct {
+            CARD32 pad00 B32;
+	    Drawable drawable B32;
+	    CARD16 minorEvent B16;
+	    BYTE majorEvent;
+	    BYTE bpad;
+	} noExposure;
+	struct {
+            CARD32 pad00 B32;
+	    Window window B32;
+	    CARD8 state;
+	    BYTE pad1, pad2, pad3;
+	} visibility;
+	struct {
+            CARD32 pad00 B32;
+	    Window parent B32, window B32;
+	    INT16 x B16, y B16;
+	    CARD16 width B16, height B16, borderWidth B16;
+	    BOOL override;
+	    BYTE bpad;
+        } createNotify;
+/*
+ * The event fields in the structures for DestroyNotify, UnmapNotify,
+ * MapNotify, ReparentNotify, ConfigureNotify, CirculateNotify, GravityNotify,
+ * must be at the same offset because server internal code is depending upon
+ * this to patch up the events before they are delivered.
+ * Also note that MapRequest, ConfigureRequest and CirculateRequest have
+ * the same offset for the event window.
+ */
+	struct {
+            CARD32 pad00 B32;
+	    Window event B32, window B32;
+	} destroyNotify;
+	struct {
+            CARD32 pad00 B32;
+	    Window event B32, window B32;
+	    BOOL fromConfigure;
+	    BYTE pad1, pad2, pad3;
+        } unmapNotify;
+	struct {
+            CARD32 pad00 B32;
+	    Window event B32, window B32;
+	    BOOL override;
+	    BYTE pad1, pad2, pad3;
+        } mapNotify;
+	struct {
+            CARD32 pad00 B32;
+	    Window parent B32, window B32;
+        } mapRequest;
+	struct {
+            CARD32 pad00 B32;
+	    Window event B32, window B32, parent B32;
+	    INT16 x B16, y B16;
+	    BOOL override;
+	    BYTE pad1, pad2, pad3;
+	} reparent;
+	struct {
+            CARD32 pad00 B32;
+	    Window event B32, window B32, aboveSibling B32;
+	    INT16 x B16, y B16;
+	    CARD16 width B16, height B16, borderWidth B16;
+	    BOOL override;		
+	    BYTE bpad;
+	} configureNotify;
+	struct {
+            CARD32 pad00 B32;
+	    Window parent B32, window B32, sibling B32;
+	    INT16 x B16, y B16;
+	    CARD16 width B16, height B16, borderWidth B16;
+	    CARD16 valueMask B16;
+	    CARD32 pad1 B32;
+	} configureRequest;
+	struct {
+            CARD32 pad00 B32;
+	    Window event B32, window B32;
+	    INT16 x B16, y B16;
+	    CARD32 pad1 B32, pad2 B32, pad3 B32, pad4 B32;
+	} gravity;
+	struct {
+            CARD32 pad00 B32;
+	    Window window B32;
+	    CARD16 width B16, height B16;
+	} resizeRequest;
+	struct {
+/* The event field in the circulate record is really the parent when this
+   is used as a CirculateRequest instead of a CirculateNotify */
+            CARD32 pad00 B32;
+	    Window event B32, window B32, parent B32;
+	    BYTE place;			/* Top or Bottom */
+	    BYTE pad1, pad2, pad3;
+	} circulate;
+	struct {
+            CARD32 pad00 B32;
+	    Window window B32;
+	    Atom atom B32;
+	    Time time B32;
+	    BYTE state;			/* NewValue or Deleted */
+	    BYTE pad1;
+	    CARD16 pad2 B16;
+	} property;
+	struct {
+            CARD32 pad00 B32;
+            Time time B32;     
+	    Window window B32;
+	    Atom atom B32;
+	} selectionClear;
+	struct {
+            CARD32 pad00 B32;
+            Time time B32;    
+	    Window owner B32, requestor B32;
+	    Atom selection B32, target B32, property B32;
+	} selectionRequest;
+	struct {
+            CARD32 pad00 B32;
+            Time time B32;   
+	    Window requestor B32;
+	    Atom selection B32, target B32, property B32;
+	} selectionNotify;
+	struct {
+            CARD32 pad00 B32;
+	    Window window B32;
+	    Colormap colormap B32;
+#if defined(__cplusplus) || defined(c_plusplus)
+	    BOOL c_new;
+#else
+	    BOOL new;
+#endif
+	    BYTE state;			/* Installed or UnInstalled */
+	    BYTE pad1, pad2;
+	} colormap;
+	struct {
+	    CARD32 pad00 B32;
+	    CARD8 request;
+	    KeyCode firstKeyCode;
+	    CARD8 count;
+	    BYTE pad1;
+	} mappingNotify;
+	struct {
+            CARD32 pad00 B32;
+	    Window window B32;
+	    union {
+		struct {
+		    Atom type B32;
+		    INT32 longs0 B32;
+		    INT32 longs1 B32;
+		    INT32 longs2 B32;
+		    INT32 longs3 B32;
+		    INT32 longs4 B32;
+		} l;
+		struct {
+		    Atom type B32;
+		    INT16 shorts0 B16;
+		    INT16 shorts1 B16;
+		    INT16 shorts2 B16;
+		    INT16 shorts3 B16;
+		    INT16 shorts4 B16;
+		    INT16 shorts5 B16;
+		    INT16 shorts6 B16;
+		    INT16 shorts7 B16;
+		    INT16 shorts8 B16;
+		    INT16 shorts9 B16;
+		} s;
+		struct {
+		    Atom type B32;
+		    INT8 bytes[20];
+		} b;
+	    } u; 
+	} clientMessage;
+    } u;
+} xEvent;
+
+/* KeymapNotify events are not included in the above union because they
+   are different from all other events: they do not have a "detail"
+   or "sequenceNumber", so there is room for a 248-bit key mask. */
+
+typedef struct {
+    BYTE type;
+    BYTE map[31];
+    } xKeymapEvent;
+
+#define XEventSize (sizeof(xEvent))
+
+/* XReply is the union of all the replies above whose "fixed part"
+fits in 32 bytes.  It does NOT include GetWindowAttributesReply,
+QueryFontReply, QueryKeymapReply, or GetKeyboardControlReply 
+ListFontsWithInfoReply */
+
+typedef union {
+    xGenericReply generic;
+    xGetGeometryReply geom;
+    xQueryTreeReply tree;
+    xInternAtomReply atom;
+    xGetAtomNameReply atomName;
+    xGetPropertyReply property;
+    xListPropertiesReply listProperties;
+    xGetSelectionOwnerReply selection;
+    xGrabPointerReply grabPointer;
+    xGrabKeyboardReply grabKeyboard;
+    xQueryPointerReply pointer;
+    xGetMotionEventsReply motionEvents;
+    xTranslateCoordsReply coords;
+    xGetInputFocusReply inputFocus;
+    xQueryTextExtentsReply textExtents;
+    xListFontsReply fonts;
+    xGetFontPathReply fontPath;
+    xGetImageReply image;
+    xListInstalledColormapsReply colormaps;
+    xAllocColorReply allocColor;
+    xAllocNamedColorReply allocNamedColor;
+    xAllocColorCellsReply colorCells;
+    xAllocColorPlanesReply colorPlanes;
+    xQueryColorsReply colors;
+    xLookupColorReply lookupColor;
+    xQueryBestSizeReply bestSize;
+    xQueryExtensionReply extension;
+    xListExtensionsReply extensions;
+    xSetModifierMappingReply setModifierMapping;
+    xGetModifierMappingReply getModifierMapping;
+    xSetPointerMappingReply setPointerMapping;
+    xGetKeyboardMappingReply getKeyboardMapping;
+    xGetPointerMappingReply getPointerMapping;
+    xGetPointerControlReply pointerControl;
+    xGetScreenSaverReply screenSaver;
+    xListHostsReply hosts;
+    xError error;
+    xEvent event;
+} xReply;
+
+
+
+
+/*****************************************************************
+ * REQUESTS
+ *****************************************************************/
+
+
+/* Request structure */
+
+typedef struct _xReq {
+	CARD8 reqType;
+	CARD8 data;            /* meaning depends on request type */
+	CARD16 length B16;         /* length in 4 bytes quantities 
+				  of whole request, including this header */
+} xReq;
+
+/*****************************************************************
+ *  structures that follow request. 
+ *****************************************************************/
+
+/* ResourceReq is used for any request which has a resource ID 
+   (or Atom or Time) as its one and only argument.  */
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    CARD32 id B32;  /* a Window, Drawable, Font, GContext, Pixmap, etc. */
+    } xResourceReq;
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 depth;
+    CARD16 length B16;
+    Window wid B32, parent B32;
+    INT16 x B16, y B16;
+    CARD16 width B16, height B16, borderWidth B16;  
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD16 c_class B16;
+#else
+    CARD16 class B16;
+#endif
+    VisualID visual B32;
+    CARD32 mask B32;
+} xCreateWindowReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Window window B32;
+    CARD32 valueMask B32; 
+} xChangeWindowAttributesReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE mode;
+    CARD16 length B16;
+    Window window B32;
+} xChangeSaveSetReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Window window B32, parent B32;
+    INT16 x B16, y B16;
+} xReparentWindowReq;
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 pad;
+    CARD16 length B16;
+    Window window B32;
+    CARD16 mask B16;
+    CARD16 pad2 B16;
+} xConfigureWindowReq;
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 direction;
+    CARD16 length B16;
+    Window window B32;
+} xCirculateWindowReq;
+
+typedef struct {    /* followed by padded string */
+    CARD8 reqType;
+    BOOL onlyIfExists;
+    CARD16 length B16;
+    CARD16 nbytes  B16;    /* number of bytes in string */
+    CARD16 pad B16;
+} xInternAtomReq;
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 mode;
+    CARD16 length B16;
+    Window window B32;
+    Atom property B32, type B32;
+    CARD8 format;
+    BYTE pad[3];
+    CARD32 nUnits B32;     /* length of stuff following, depends on format */
+} xChangePropertyReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Window window B32;
+    Atom property B32;
+} xDeletePropertyReq;
+
+typedef struct {
+    CARD8 reqType;
+#if defined(__cplusplus) || defined(c_plusplus)
+    BOOL c_delete;
+#else
+    BOOL delete;
+#endif
+    CARD16 length B16;
+    Window window B32;
+    Atom property B32, type B32;
+    CARD32 longOffset B32;
+    CARD32 longLength B32;
+} xGetPropertyReq;
+ 
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Window window B32;
+    Atom selection B32;
+    Time time B32;
+} xSetSelectionOwnerReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Window requestor B32;
+    Atom selection B32, target B32, property B32;
+    Time time B32;
+    } xConvertSelectionReq;
+
+typedef struct {
+    CARD8 reqType;
+    BOOL propagate;
+    CARD16 length B16;
+    Window destination B32;
+    CARD32 eventMask B32;
+#ifdef WORD64
+    /* the structure should have been quad-aligned */
+    BYTE eventdata[SIZEOF(xEvent)];
+#else
+    xEvent event;
+#endif /* WORD64 */
+} xSendEventReq;
+
+typedef struct {
+    CARD8 reqType;
+    BOOL ownerEvents;
+    CARD16 length B16;
+    Window grabWindow B32;
+    CARD16 eventMask B16;
+    BYTE pointerMode, keyboardMode;
+    Window confineTo B32;
+    Cursor cursor B32;
+    Time time B32;
+} xGrabPointerReq;
+
+typedef struct {
+    CARD8 reqType;
+    BOOL ownerEvents;
+    CARD16 length B16;
+    Window grabWindow B32;
+    CARD16 eventMask B16;
+    BYTE pointerMode, keyboardMode;
+    Window confineTo B32;
+    Cursor cursor B32;
+    CARD8 button;
+    BYTE pad;
+    CARD16 modifiers B16;
+} xGrabButtonReq;
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 button;
+    CARD16 length B16;
+    Window grabWindow B32;
+    CARD16 modifiers B16;
+    CARD16 pad B16;
+} xUngrabButtonReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Cursor cursor B32;
+    Time time B32;
+    CARD16 eventMask B16;
+    CARD16 pad2 B16;
+} xChangeActivePointerGrabReq;
+
+typedef struct {
+    CARD8 reqType;
+    BOOL ownerEvents;
+    CARD16 length B16;
+    Window grabWindow B32;
+    Time time B32;
+    BYTE pointerMode, keyboardMode;  
+    CARD16 pad B16;
+} xGrabKeyboardReq;
+
+typedef struct {
+    CARD8 reqType;
+    BOOL ownerEvents;
+    CARD16 length B16;
+    Window grabWindow B32;
+    CARD16 modifiers B16;
+    CARD8 key;
+    BYTE pointerMode, keyboardMode;  
+    BYTE pad1, pad2, pad3;
+} xGrabKeyReq;
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 key;
+    CARD16 length B16;
+    Window grabWindow B32;
+    CARD16 modifiers B16;
+    CARD16 pad B16;
+} xUngrabKeyReq;
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 mode;
+    CARD16 length B16;
+    Time time B32;
+} xAllowEventsReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Window window B32;
+    Time start B32, stop B32;
+} xGetMotionEventsReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Window srcWid B32, dstWid B32;
+    INT16 srcX B16, srcY B16;
+} xTranslateCoordsReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Window srcWid B32, dstWid B32;
+    INT16 srcX B16, srcY B16;
+    CARD16 srcWidth B16, srcHeight B16;
+    INT16 dstX B16, dstY B16;
+} xWarpPointerReq;
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 revertTo;
+    CARD16 length B16;
+    Window focus B32;
+    Time time B32;
+} xSetInputFocusReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Font fid B32;
+    CARD16 nbytes B16;
+    BYTE pad1, pad2;	/* string follows on word boundary */
+} xOpenFontReq;
+
+typedef struct {
+    CARD8 reqType;
+    BOOL oddLength;
+    CARD16 length B16;
+    Font fid B32;
+    } xQueryTextExtentsReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    CARD16 maxNames B16;
+    CARD16 nbytes B16;  /* followed immediately by string bytes */
+} xListFontsReq;
+
+typedef xListFontsReq xListFontsWithInfoReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    CARD16 nFonts B16;
+    BYTE pad1, pad2;	/* LISTofSTRING8 follows on word boundary */
+} xSetFontPathReq;
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 depth;
+    CARD16 length B16;
+    Pixmap pid B32;
+    Drawable drawable B32;
+    CARD16 width B16, height B16;
+} xCreatePixmapReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    GContext gc B32;
+    Drawable drawable B32;
+    CARD32 mask B32;
+} xCreateGCReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    GContext gc B32;
+    CARD32 mask B32;
+} xChangeGCReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    GContext srcGC B32, dstGC B32;
+    CARD32 mask B32;
+} xCopyGCReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    GContext gc B32;
+    CARD16 dashOffset B16;
+    CARD16 nDashes B16;        /* length LISTofCARD8 of values following */
+} xSetDashesReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE ordering;
+    CARD16 length B16;
+    GContext gc B32;
+    INT16 xOrigin B16, yOrigin B16;
+} xSetClipRectanglesReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BOOL exposures;
+    CARD16 length B16;
+    Window window B32;
+    INT16 x B16, y B16;
+    CARD16 width B16, height B16;
+} xClearAreaReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Drawable srcDrawable B32, dstDrawable B32;
+    GContext gc B32;
+    INT16 srcX B16, srcY B16, dstX B16, dstY B16;
+    CARD16 width B16, height B16;
+} xCopyAreaReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Drawable srcDrawable B32, dstDrawable B32;
+    GContext gc B32;
+    INT16 srcX B16, srcY B16, dstX B16, dstY B16;
+    CARD16 width B16, height B16;
+    CARD32 bitPlane B32;
+} xCopyPlaneReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE coordMode;
+    CARD16 length B16;
+    Drawable drawable B32;
+    GContext gc B32;
+} xPolyPointReq;    
+
+typedef xPolyPointReq xPolyLineReq;  /* same request structure */
+
+/* The following used for PolySegment, PolyRectangle, PolyArc, PolyFillRectangle, PolyFillArc */
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Drawable drawable B32;
+    GContext gc B32;
+} xPolySegmentReq;    
+
+typedef xPolySegmentReq xPolyArcReq;
+typedef xPolySegmentReq xPolyRectangleReq;
+typedef xPolySegmentReq xPolyFillRectangleReq;
+typedef xPolySegmentReq xPolyFillArcReq;
+
+typedef struct _FillPolyReq {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Drawable drawable B32;
+    GContext gc B32;
+    BYTE shape;
+    BYTE coordMode;
+    CARD16 pad1 B16;
+} xFillPolyReq;    
+
+
+typedef struct _PutImageReq {
+    CARD8 reqType;
+    CARD8 format;
+    CARD16 length B16;
+    Drawable drawable B32;
+    GContext gc B32;
+    CARD16 width B16, height B16;
+    INT16 dstX B16, dstY B16;
+    CARD8 leftPad;
+    CARD8 depth;
+    CARD16 pad B16;
+} xPutImageReq;    
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 format;
+    CARD16 length B16;
+    Drawable drawable B32;
+    INT16 x B16, y B16;
+    CARD16 width B16, height B16;
+    CARD32 planeMask B32;
+} xGetImageReq;    
+
+/* the following used by PolyText8 and PolyText16 */
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 pad;
+    CARD16 length B16;
+    Drawable drawable B32;
+    GContext gc B32;
+    INT16 x B16, y B16;		/* items (xTextElt) start after struct */
+} xPolyTextReq;    
+
+typedef xPolyTextReq xPolyText8Req;
+typedef xPolyTextReq xPolyText16Req;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE nChars;
+    CARD16 length B16;
+    Drawable drawable B32;
+    GContext gc B32;
+    INT16 x B16, y B16;
+} xImageTextReq;    
+
+typedef xImageTextReq xImageText8Req;
+typedef xImageTextReq xImageText16Req;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE alloc;
+    CARD16 length B16;
+    Colormap mid B32;
+    Window window B32;
+    VisualID visual B32;
+} xCreateColormapReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Colormap mid B32;
+    Colormap srcCmap B32;
+} xCopyColormapAndFreeReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Colormap cmap B32;
+    CARD16 red B16, green B16, blue B16;
+    CARD16 pad2 B16;
+} xAllocColorReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Colormap cmap B32;
+    CARD16 nbytes B16;  /* followed by structure */
+    BYTE pad1, pad2;
+} xAllocNamedColorReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BOOL contiguous;
+    CARD16 length B16;
+    Colormap cmap B32;
+    CARD16 colors B16, planes B16;
+} xAllocColorCellsReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BOOL contiguous;
+    CARD16 length B16;
+    Colormap cmap B32;
+    CARD16 colors B16, red B16, green B16, blue B16;
+} xAllocColorPlanesReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Colormap cmap B32;
+    CARD32 planeMask B32;
+} xFreeColorsReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Colormap cmap B32;
+} xStoreColorsReq;    
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 flags;   /* DoRed, DoGreen, DoBlue, as in xColorItem */
+    CARD16 length B16;
+    Colormap cmap B32;
+    CARD32 pixel B32;
+    CARD16 nbytes B16;  /* number of name string bytes following structure */
+    BYTE pad1, pad2;
+    } xStoreNamedColorReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Colormap cmap B32;
+} xQueryColorsReq;    
+
+typedef struct {    /* followed  by string of length len */
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Colormap cmap B32;
+    CARD16 nbytes B16;  /* number of string bytes following structure*/
+    BYTE pad1, pad2;
+} xLookupColorReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Cursor cid B32;
+    Pixmap source B32, mask B32;
+    CARD16 foreRed B16, foreGreen B16, foreBlue B16;
+    CARD16 backRed B16, backGreen B16, backBlue B16;
+    CARD16 x B16, y B16;
+} xCreateCursorReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Cursor cid B32;
+    Font source B32, mask B32;
+    CARD16 sourceChar B16, maskChar B16;
+    CARD16 foreRed B16, foreGreen B16, foreBlue B16;
+    CARD16 backRed B16, backGreen B16, backBlue B16;
+} xCreateGlyphCursorReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Cursor cursor B32;
+    CARD16 foreRed B16, foreGreen B16, foreBlue B16;
+    CARD16 backRed B16, backGreen B16, backBlue B16;
+} xRecolorCursorReq;    
+
+typedef struct {
+    CARD8 reqType;
+#if defined(__cplusplus) || defined(c_plusplus)
+    CARD8 c_class;
+#else
+    CARD8 class;
+#endif
+    CARD16 length B16;
+    Drawable drawable B32;
+    CARD16 width B16, height B16;
+} xQueryBestSizeReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    CARD16 nbytes B16;  /* number of string bytes following structure */
+    BYTE pad1, pad2;
+} xQueryExtensionReq;
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   numKeyPerModifier;
+    CARD16  length B16;
+} xSetModifierMappingReq;
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 nElts;  /* how many elements in the map */
+    CARD16 length B16;
+} xSetPointerMappingReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    KeyCode firstKeyCode;
+    CARD8 count;
+    CARD16 pad1 B16;
+} xGetKeyboardMappingReq;    
+
+typedef struct {
+    CARD8 reqType;
+    CARD8 keyCodes;
+    CARD16 length B16;
+    KeyCode firstKeyCode;
+    CARD8 keySymsPerKeyCode;
+    CARD16 pad1 B16;
+} xChangeKeyboardMappingReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    CARD32 mask B32;
+} xChangeKeyboardControlReq;    
+
+typedef struct {
+    CARD8 reqType;
+    INT8 percent;  /* -100 to 100 */
+    CARD16 length B16;
+} xBellReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    INT16 accelNum B16, accelDenum B16;
+    INT16 threshold B16;             
+    BOOL doAccel, doThresh;
+} xChangePointerControlReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    INT16 timeout B16, interval B16;
+    BYTE preferBlank, allowExpose;  
+    CARD16 pad2 B16;
+} xSetScreenSaverReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE mode;
+    CARD16 length B16;
+    CARD8 hostFamily;
+    BYTE pad;
+    CARD16 hostLength B16;
+} xChangeHostsReq;    
+
+typedef struct {
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    } xListHostsReq;
+
+typedef struct {
+    CARD8 reqType;
+    BYTE mode;
+    CARD16 length B16;
+    } xChangeModeReq;
+
+typedef xChangeModeReq xSetAccessControlReq;
+typedef xChangeModeReq xSetCloseDownModeReq;
+typedef xChangeModeReq xForceScreenSaverReq;
+
+typedef struct { /* followed by LIST of ATOM */
+    CARD8 reqType;
+    BYTE pad;
+    CARD16 length B16;
+    Window window B32;
+    CARD16 nAtoms B16;
+    INT16 nPositions B16;
+    } xRotatePropertiesReq;
+    
+
+
+
+/* Reply codes */
+
+#define X_Reply		1		/* Normal reply */
+#define X_Error		0		/* Error */
+
+/* Request codes */
+
+#define X_CreateWindow                  1              
+#define X_ChangeWindowAttributes        2        
+#define X_GetWindowAttributes           3     
+#define X_DestroyWindow                 4
+#define X_DestroySubwindows             5   
+#define X_ChangeSaveSet                 6
+#define X_ReparentWindow                7
+#define X_MapWindow                     8
+#define X_MapSubwindows                 9
+#define X_UnmapWindow                  10
+#define X_UnmapSubwindows              11  
+#define X_ConfigureWindow              12  
+#define X_CirculateWindow              13  
+#define X_GetGeometry                  14
+#define X_QueryTree                    15
+#define X_InternAtom                   16
+#define X_GetAtomName                  17
+#define X_ChangeProperty               18 
+#define X_DeleteProperty               19 
+#define X_GetProperty                  20
+#define X_ListProperties               21 
+#define X_SetSelectionOwner            22    
+#define X_GetSelectionOwner            23    
+#define X_ConvertSelection             24   
+#define X_SendEvent                    25
+#define X_GrabPointer                  26
+#define X_UngrabPointer                27
+#define X_GrabButton                   28
+#define X_UngrabButton                 29
+#define X_ChangeActivePointerGrab      30          
+#define X_GrabKeyboard                 31
+#define X_UngrabKeyboard               32 
+#define X_GrabKey                      33
+#define X_UngrabKey                    34
+#define X_AllowEvents                  35       
+#define X_GrabServer                   36      
+#define X_UngrabServer                 37        
+#define X_QueryPointer                 38        
+#define X_GetMotionEvents              39           
+#define X_TranslateCoords              40                
+#define X_WarpPointer                  41       
+#define X_SetInputFocus                42         
+#define X_GetInputFocus                43         
+#define X_QueryKeymap                  44       
+#define X_OpenFont                     45    
+#define X_CloseFont                    46     
+#define X_QueryFont                    47
+#define X_QueryTextExtents             48     
+#define X_ListFonts                    49  
+#define X_ListFontsWithInfo    	       50 
+#define X_SetFontPath                  51 
+#define X_GetFontPath                  52 
+#define X_CreatePixmap                 53        
+#define X_FreePixmap                   54      
+#define X_CreateGC                     55    
+#define X_ChangeGC                     56    
+#define X_CopyGC                       57  
+#define X_SetDashes                    58     
+#define X_SetClipRectangles            59             
+#define X_FreeGC                       60  
+#define X_ClearArea                    61             
+#define X_CopyArea                     62    
+#define X_CopyPlane                    63     
+#define X_PolyPoint                    64     
+#define X_PolyLine                     65    
+#define X_PolySegment                  66       
+#define X_PolyRectangle                67         
+#define X_PolyArc                      68   
+#define X_FillPoly                     69    
+#define X_PolyFillRectangle            70             
+#define X_PolyFillArc                  71       
+#define X_PutImage                     72    
+#define X_GetImage                     73 
+#define X_PolyText8                    74     
+#define X_PolyText16                   75      
+#define X_ImageText8                   76      
+#define X_ImageText16                  77       
+#define X_CreateColormap               78          
+#define X_FreeColormap                 79        
+#define X_CopyColormapAndFree          80               
+#define X_InstallColormap              81           
+#define X_UninstallColormap            82             
+#define X_ListInstalledColormaps       83                  
+#define X_AllocColor                   84      
+#define X_AllocNamedColor              85           
+#define X_AllocColorCells              86           
+#define X_AllocColorPlanes             87            
+#define X_FreeColors                   88      
+#define X_StoreColors                  89       
+#define X_StoreNamedColor              90           
+#define X_QueryColors                  91       
+#define X_LookupColor                  92       
+#define X_CreateCursor                 93        
+#define X_CreateGlyphCursor            94             
+#define X_FreeCursor                   95      
+#define X_RecolorCursor                96         
+#define X_QueryBestSize                97         
+#define X_QueryExtension               98          
+#define X_ListExtensions               99          
+#define X_ChangeKeyboardMapping        100
+#define X_GetKeyboardMapping           101
+#define X_ChangeKeyboardControl        102                
+#define X_GetKeyboardControl           103             
+#define X_Bell                         104
+#define X_ChangePointerControl         105
+#define X_GetPointerControl            106
+#define X_SetScreenSaver               107          
+#define X_GetScreenSaver               108          
+#define X_ChangeHosts                  109       
+#define X_ListHosts                    110     
+#define X_SetAccessControl             111               
+#define X_SetCloseDownMode             112
+#define X_KillClient                   113 
+#define X_RotateProperties	       114
+#define X_ForceScreenSaver	       115
+#define X_SetPointerMapping            116
+#define X_GetPointerMapping            117
+#define X_SetModifierMapping	       118
+#define X_GetModifierMapping	       119
+#define X_NoOperation                  127
+
+/* restore these definitions back to the typedefs in X.h */
+#undef Window
+#undef Drawable
+#undef Font
+#undef Pixmap
+#undef Cursor
+#undef Colormap
+#undef GContext
+#undef Atom
+#undef VisualID
+#undef Time
+#undef KeyCode
+#undef KeySym
+
+#endif /* XPROTO_H */
Index: trunk/src/VBox/Additions/x11/x11include/1.5/X11/Xprotostr.h
===================================================================
--- trunk/src/VBox/Additions/x11/x11include/1.5/X11/Xprotostr.h	(revision 11548)
+++ trunk/src/VBox/Additions/x11/x11include/1.5/X11/Xprotostr.h	(revision 11548)
@@ -0,0 +1,78 @@
+/* $Xorg: Xprotostr.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */
+#ifndef XPROTOSTRUCTS_H
+#define XPROTOSTRUCTS_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.
+
+******************************************************************/
+#include <X11/Xmd.h>
+
+/* Used by PolySegment */
+
+typedef struct _xSegment {
+    INT16 x1 B16, y1 B16, x2 B16, y2 B16;
+} xSegment;
+
+/* POINT */
+
+typedef struct _xPoint {
+	INT16		x B16, y B16;
+} xPoint;
+
+typedef struct _xRectangle {
+    INT16 x B16, y B16;
+    CARD16  width B16, height B16;
+} xRectangle;
+
+/*  ARC  */
+
+typedef struct _xArc {
+    INT16 x B16, y B16;
+    CARD16   width B16, height B16;
+    INT16   angle1 B16, angle2 B16;
+} xArc;
+
+#endif /* XPROTOSTRUCTS_H */
