summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Osterlund <petero2@telia.com>2003-10-04 18:38:52 +0200
committerPeter Osterlund <petero2@telia.com>2006-04-09 04:01:14 +0200
commitd7d9674548b25d716418d04906f526665eae2539 (patch)
tree22e949e9710511c833f232df16a4e374e269d3fe
parent18d9a2d1f81a1cc460fa6d64505d4706df3ab918 (diff)
Added X include files so that the driver can be compiled
without an external XFree86 source tree.
-rw-r--r--Makefile2
-rw-r--r--Xincludes/README.xincludes1
-rw-r--r--Xincludes/xc/exports/include/X11/X.h717
-rw-r--r--Xincludes/xc/exports/include/X11/Xalloca.h138
-rw-r--r--Xincludes/xc/exports/include/X11/Xdefs.h110
-rw-r--r--Xincludes/xc/exports/include/X11/Xfuncproto.h72
-rw-r--r--Xincludes/xc/exports/include/X11/Xfuncs.h92
-rw-r--r--Xincludes/xc/exports/include/X11/Xmd.h208
-rw-r--r--Xincludes/xc/exports/include/X11/Xosdefs.h141
-rw-r--r--Xincludes/xc/exports/include/X11/Xproto.h2129
-rw-r--r--Xincludes/xc/exports/include/X11/Xprotostr.h78
-rw-r--r--Xincludes/xc/exports/include/X11/extensions/XI.h275
-rw-r--r--Xincludes/xc/exports/include/X11/extensions/XIproto.h1530
-rw-r--r--Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86.h389
-rw-r--r--Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86Module.h197
-rw-r--r--Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86Opt.h82
-rw-r--r--Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86Version.h31
-rw-r--r--Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86Xinput.h191
-rw-r--r--Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86str.h994
-rw-r--r--Xincludes/xc/programs/Xserver/hw/xfree86/common/xisb.h64
-rw-r--r--Xincludes/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h266
-rw-r--r--Xincludes/xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h342
-rw-r--r--Xincludes/xc/programs/Xserver/include/XIstubs.h101
-rw-r--r--Xincludes/xc/programs/Xserver/include/bstore.h23
-rw-r--r--Xincludes/xc/programs/Xserver/include/bstorestr.h75
-rw-r--r--Xincludes/xc/programs/Xserver/include/colormap.h235
-rw-r--r--Xincludes/xc/programs/Xserver/include/cursor.h156
-rw-r--r--Xincludes/xc/programs/Xserver/include/dix.h1096
-rw-r--r--Xincludes/xc/programs/Xserver/include/dixstruct.h267
-rw-r--r--Xincludes/xc/programs/Xserver/include/exevents.h275
-rw-r--r--Xincludes/xc/programs/Xserver/include/gc.h232
-rw-r--r--Xincludes/xc/programs/Xserver/include/globals.h52
-rw-r--r--Xincludes/xc/programs/Xserver/include/input.h535
-rw-r--r--Xincludes/xc/programs/Xserver/include/inputstr.h317
-rw-r--r--Xincludes/xc/programs/Xserver/include/misc.h282
-rw-r--r--Xincludes/xc/programs/Xserver/include/miscstruct.h73
-rw-r--r--Xincludes/xc/programs/Xserver/include/opaque.h81
-rw-r--r--Xincludes/xc/programs/Xserver/include/os.h856
-rw-r--r--Xincludes/xc/programs/Xserver/include/pixmap.h123
-rw-r--r--Xincludes/xc/programs/Xserver/include/pixmapstr.h83
-rw-r--r--Xincludes/xc/programs/Xserver/include/property.h83
-rw-r--r--Xincludes/xc/programs/Xserver/include/propertyst.h76
-rw-r--r--Xincludes/xc/programs/Xserver/include/region.h53
-rw-r--r--Xincludes/xc/programs/Xserver/include/regionstr.h437
-rw-r--r--Xincludes/xc/programs/Xserver/include/resource.h326
-rw-r--r--Xincludes/xc/programs/Xserver/include/screenint.h170
-rw-r--r--Xincludes/xc/programs/Xserver/include/scrnintstr.h996
-rw-r--r--Xincludes/xc/programs/Xserver/include/validate.h42
-rw-r--r--Xincludes/xc/programs/Xserver/include/window.h362
-rw-r--r--Xincludes/xc/programs/Xserver/include/xf86_ansic.h342
-rw-r--r--Xincludes/xc/programs/Xserver/include/xf86_libc.h658
-rw-r--r--Xincludes/xc/programs/Xserver/mi/mipointer.h162
52 files changed, 16617 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 22bfddc..cbe6e68 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-TOP = /usr/src/redhat/BUILD/XFree86-4.2.0/xc
+TOP = Xincludes/xc
XTOP = $(TOP)
BUILDINCROOT = $(TOP)/exports
EXTINCSRC = $(XTOP)/include/extensions
diff --git a/Xincludes/README.xincludes b/Xincludes/README.xincludes
new file mode 100644
index 0000000..0183943
--- /dev/null
+++ b/Xincludes/README.xincludes
@@ -0,0 +1 @@
+These include files are copied from XFree86 4.2.0.
diff --git a/Xincludes/xc/exports/include/X11/X.h b/Xincludes/xc/exports/include/X11/X.h
new file mode 100644
index 0000000..56bcc8f
--- /dev/null
+++ b/Xincludes/xc/exports/include/X11/X.h
@@ -0,0 +1,717 @@
+/*
+ * $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.4 2001/01/17 17:53:09 dawes 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
+#define FamilyDECnet 1
+#define FamilyChaos 2
+
+/* 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 */
diff --git a/Xincludes/xc/exports/include/X11/Xalloca.h b/Xincludes/xc/exports/include/X11/Xalloca.h
new file mode 100644
index 0000000..9ffbab6
--- /dev/null
+++ b/Xincludes/xc/exports/include/X11/Xalloca.h
@@ -0,0 +1,138 @@
+/* $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.9 2001/01/17 17:53:10 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
+
+#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
+# define DEALLOCATE_LOCAL(ptr) /* as nothing */
+# endif /* defined(__HIGHC__) */
+
+
+# ifdef __GNUC__
+# ifndef alloca
+# define alloca __builtin_alloca
+# endif /* !alloca */
+# define ALLOCATE_LOCAL(size) alloca((int)(size))
+# define DEALLOCATE_LOCAL(ptr) /* as nothing */
+# 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))
+# define DEALLOCATE_LOCAL(ptr) /* as nothing */
+# 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) */
+#endif /* !defined(ALLOCATE_LOCAL) */
+
+#endif /* XALLOCA_H */
diff --git a/Xincludes/xc/exports/include/X11/Xdefs.h b/Xincludes/xc/exports/include/X11/Xdefs.h
new file mode 100644
index 0000000..9e77e30
--- /dev/null
+++ b/Xincludes/xc/exports/include/X11/Xdefs.h
@@ -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 independant time value
+ XXX Should probably go in Xos.h */
+typedef struct timeval **OSTimePtr;
+
+
+typedef void (* BlockHandlerProcPtr)(pointer /* blockData */,
+ OSTimePtr /* pTimeout */,
+ pointer /* pReadmask */);
+
+#endif
diff --git a/Xincludes/xc/exports/include/X11/Xfuncproto.h b/Xincludes/xc/exports/include/X11/Xfuncproto.h
new file mode 100644
index 0000000..dcb0140
--- /dev/null
+++ b/Xincludes/xc/exports/include/X11/Xfuncproto.h
@@ -0,0 +1,72 @@
+/* $Xorg: Xfuncproto.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $ */
+/*
+ *
+Copyright 1989, 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/Xfuncproto.h,v 3.4 2001/12/14 19:53:25 dawes Exp $ */
+
+/* Definitions to make function prototypes manageable */
+
+#ifndef _XFUNCPROTO_H_
+#define _XFUNCPROTO_H_
+
+#ifndef NeedFunctionPrototypes
+#define NeedFunctionPrototypes 1
+#endif /* NeedFunctionPrototypes */
+
+#ifndef NeedVarargsPrototypes
+#define NeedVarargsPrototypes 1
+#endif /* NeedVarargsPrototypes */
+
+#if NeedFunctionPrototypes
+
+#ifndef NeedNestedPrototypes
+#define NeedNestedPrototypes 1
+#endif /* NeedNestedPrototypes */
+
+#ifndef _Xconst
+#define _Xconst const
+#endif /* _Xconst */
+
+#ifndef NeedWidePrototypes
+#ifdef NARROWPROTO
+#define NeedWidePrototypes 0
+#else
+#define NeedWidePrototypes 1 /* default to make interropt. easier */
+#endif
+#endif /* NeedWidePrototypes */
+
+#endif /* NeedFunctionPrototypes */
+
+#ifndef _XFUNCPROTOBEGIN
+#if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */
+#define _XFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */
+#define _XFUNCPROTOEND }
+#else
+#define _XFUNCPROTOBEGIN
+#define _XFUNCPROTOEND
+#endif
+#endif /* _XFUNCPROTOBEGIN */
+
+#endif /* _XFUNCPROTO_H_ */
diff --git a/Xincludes/xc/exports/include/X11/Xfuncs.h b/Xincludes/xc/exports/include/X11/Xfuncs.h
new file mode 100644
index 0000000..77acedf
--- /dev/null
+++ b/Xincludes/xc/exports/include/X11/Xfuncs.h
@@ -0,0 +1,92 @@
+/*
+ * $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.8 2001/07/25 15:04:42 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)
+#include <memory.h>
+void bcopy();
+#define bzero(b,len) memset(b, 0, len)
+#define bcmp(b1,b2,len) memcmp(b1, b2, len)
+#elif defined(__EMX__)
+#include <strings.h>
+/* bcopy, bcmp, bzero declared */
+#define _XFUNCS_H_INCLUDED_STRING_H
+#else
+#include <string.h>
+#define _XFUNCS_H_INCLUDED_STRING_H
+#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 /* 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_ */
diff --git a/Xincludes/xc/exports/include/X11/Xmd.h b/Xincludes/xc/exports/include/X11/Xmd.h
new file mode 100644
index 0000000..6d2cf3b
--- /dev/null
+++ b/Xincludes/xc/exports/include/X11/Xmd.h
@@ -0,0 +1,208 @@
+/* $XFree86: xc/include/Xmd.h,v 3.13 2001/11/01 23:35:25 dawes 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.
+ */
+#ifdef CRAY
+#define WORD64 /* 64-bit architecture */
+#endif
+#if defined(__alpha) || defined(__alpha__) || \
+ defined(__ia64__) || defined(ia64) || \
+ defined(__sparc64__) || \
+ defined(__s390x__) || \
+ (defined(__hppa__) && defined(__LP64__))
+#define LONG64 /* 32/64-bit architecture */
+#endif
+#ifdef __sgi
+#if (_MIPS_SZLONG == 64)
+#define LONG64
+#endif
+#endif
+
+/*
+ * Stuff to handle large architecture machines; the constants were generated
+ * on a 32-bit machine and must coorespond 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 guarranteed 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(AIXV3)
+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
+typedef unsigned short CARD16;
+typedef unsigned char CARD8;
+
+typedef CARD32 BITS32;
+typedef CARD16 BITS16;
+
+#ifndef __EMX__
+typedef CARD8 BYTE;
+typedef CARD8 BOOL;
+#else /* __EMX__ */
+/*
+ * This is bad style, but the central include file <os2.h> declares them
+ * as well
+ */
+#define BYTE CARD8
+#define BOOL CARD8
+#endif /* __EMX__ */
+
+/*
+ * 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 */
diff --git a/Xincludes/xc/exports/include/X11/Xosdefs.h b/Xincludes/xc/exports/include/X11/Xosdefs.h
new file mode 100644
index 0000000..85bdf1d
--- /dev/null
+++ b/Xincludes/xc/exports/include/X11/Xosdefs.h
@@ -0,0 +1,141 @@
+/*
+ * O/S-dependent (mis)feature macro definitions
+ *
+ * $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.18 2001/12/14 19:53:26 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 i386
+#ifdef SYSV
+#if !defined(ISC) && !defined(SCO) && !defined(_SEQUENT_)
+#if !defined(_POSIX_SOURCE) && !defined(_SCO_DS)
+#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
+#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 __EMX__
+#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
+#endif /* _XOSDEFS_H_ */
+
diff --git a/Xincludes/xc/exports/include/X11/Xproto.h b/Xincludes/xc/exports/include/X11/Xproto.h
new file mode 100644
index 0000000..cb6b79f
--- /dev/null
+++ b/Xincludes/xc/exports/include/X11/Xproto.h
@@ -0,0 +1,2129 @@
+/*
+ * $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 feilds in the structures for DestroyNotify, UnmapNotify,
+ * MapNotify, ReparentNotify, ConfigureNotify, CirclulateNotify, 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 insteaad of a CircluateNotify */
+ 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 folloiwng 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 */
diff --git a/Xincludes/xc/exports/include/X11/Xprotostr.h b/Xincludes/xc/exports/include/X11/Xprotostr.h
new file mode 100644
index 0000000..f343d98
--- /dev/null
+++ b/Xincludes/xc/exports/include/X11/Xprotostr.h
@@ -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 */
diff --git a/Xincludes/xc/exports/include/X11/extensions/XI.h b/Xincludes/xc/exports/include/X11/extensions/XI.h
new file mode 100644
index 0000000..c710e0a
--- /dev/null
+++ b/Xincludes/xc/exports/include/X11/extensions/XI.h
@@ -0,0 +1,275 @@
+/* $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 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 DEVICE_RESOLUTION 1
+
+#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 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
+/* Merged from Metrolink tree for XINPUT stuff */
+#define TS_Raw 57
+#define TS_Scaled 58
+#define SendCoreEvents 59
+#define DontSendCoreEvents 60
+/* End of merged section */
+
+#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 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_ */
diff --git a/Xincludes/xc/exports/include/X11/extensions/XIproto.h b/Xincludes/xc/exports/include/X11/extensions/XIproto.h
new file mode 100644
index 0000000..1da0248
--- /dev/null
+++ b/Xincludes/xc/exports/include/X11/extensions/XIproto.h
@@ -0,0 +1,1530 @@
+/* $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 15
+#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
+
+/*********************************************************
+ *
+ * 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;
+
+/*********************************************************
+ *
+ * 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;
+
+
+/* Merged from Metrolink tree for XINPUT stuff */
+
+typedef struct {
+ CARD16 control;
+ CARD16 length;
+ CARD32 min_x;
+ CARD32 max_x;
+ CARD32 min_y;
+ CARD32 max_y;
+ CARD32 button_threshold;
+} xDeviceTSCalibrationCtl;
+
+/* End of merged section */
+
+
+/**********************************************************
+ *
+ * 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;
+
+#undef Window
+#undef Time
+#undef KeyCode
+
+#endif
diff --git a/Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86.h b/Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86.h
new file mode 100644
index 0000000..19bccb9
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86.h
@@ -0,0 +1,389 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86.h,v 3.155 2001/10/01 13:44:01 eich Exp $ */
+
+/*
+ * Copyright (c) 1997 by The XFree86 Project, Inc.
+ */
+
+/*
+ * This file contains declarations for public XFree86 functions and variables,
+ * and definitions of public macros.
+ *
+ * "public" means available to video drivers.
+ */
+
+#ifndef _XF86_H
+#define _XF86_H
+
+#include "xf86str.h"
+#include "xf86Opt.h"
+#include <X11/Xfuncproto.h>
+#ifndef IN_MODULE
+#include <stdarg.h>
+#else
+#include "xf86_ansic.h"
+#endif
+
+#include "propertyst.h"
+
+/* General parameters */
+extern int xf86DoConfigure;
+extern Bool xf86DoConfigurePass1;
+extern int xf86ScreenIndex; /* Index into pScreen.devPrivates */
+extern int xf86CreateRootWindowIndex; /* Index into pScreen.devPrivates */
+extern int xf86PixmapIndex;
+extern Bool xf86ResAccessEnter;
+extern ScrnInfoPtr *xf86Screens; /* List of pointers to ScrnInfoRecs */
+extern const unsigned char byte_reversed[256];
+extern PropertyPtr *xf86RegisteredPropertiesTable;
+extern ScrnInfoPtr xf86CurrentScreen;
+extern Bool pciSlotClaimed;
+extern Bool isaSlotClaimed;
+extern Bool fbSlotClaimed;
+#ifdef __sparc__
+extern Bool sbusSlotClaimed;
+#endif
+extern confDRIRec xf86ConfigDRI;
+
+#define XF86SCRNINFO(p) ((ScrnInfoPtr)((p)->devPrivates[xf86ScreenIndex].ptr))
+
+#define XF86FLIP_PIXELS() \
+ do { \
+ if (xf86GetFlipPixels()) { \
+ pScreen->whitePixel = (pScreen->whitePixel) ? 0 : 1; \
+ pScreen->blackPixel = (pScreen->blackPixel) ? 0 : 1; \
+ } \
+ while (0)
+
+#define BOOLTOSTRING(b) ((b) ? "TRUE" : "FALSE")
+
+#define PIX24TOBPP(p) (((p) == Pix24Use24) ? 24 : \
+ (((p) == Pix24Use32) ? 32 : 0))
+
+/* variables for debugging */
+#ifdef BUILDDEBUG
+extern char* xf86p8bit[];
+extern CARD32 xf86DummyVar1;
+extern CARD32 xf86DummyVar2;
+extern CARD32 xf86DummyVar3;
+#endif
+
+/* Function Prototypes */
+#ifndef _NO_XF86_PROTOTYPES
+
+/* xf86Bus.c */
+
+Bool xf86CheckPciSlot(int bus, int device, int func);
+int xf86ClaimPciSlot(int bus, int device, int func, DriverPtr drvp,
+ int chipset, GDevPtr dev, Bool active);
+Bool xf86ParsePciBusString(const char *busID, int *bus, int *device,
+ int *func);
+Bool xf86ComparePciBusString(const char *busID, int bus, int device, int func);
+pciVideoPtr *xf86GetPciVideoInfo(void);
+#ifdef _XF86PCI_H
+pciConfigPtr *xf86GetPciConfigInfo(void);
+#endif
+void xf86SetPciVideo(pciVideoPtr, resType);
+void xf86PrintResList(int verb, resPtr list);
+resPtr xf86AddRangesToList(resPtr list, resRange *pRange, int entityIndex);
+int xf86ClaimIsaSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
+int xf86GetIsaInfoForScreen(int scrnIndex);
+int xf86GetFbInfoForScreen(int scrnIndex);
+Bool xf86ParseIsaBusString(const char *busID);
+int xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
+void xf86EnableAccess(ScrnInfoPtr pScrn);
+void xf86SetCurrentAccess(Bool Enable, ScrnInfoPtr pScrn);
+Bool xf86IsPrimaryPci(pciVideoPtr pPci);
+Bool xf86IsPrimaryIsa(void);
+int xf86CheckPciGAType(pciVideoPtr pPci);
+/* new RAC */
+resPtr xf86AddResToList(resPtr rlist, resRange *Range, int entityIndex);
+resPtr xf86JoinResLists(resPtr rlist1, resPtr rlist2);
+resPtr xf86DupResList(const resPtr rlist);
+void xf86FreeResList(resPtr rlist);
+void xf86ClaimFixedResources(resList list, int entityIndex);
+Bool xf86DriverHasEntities(DriverPtr drvp);
+void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex);
+void xf86SetEntityInstanceForScreen(ScrnInfoPtr pScrn, int entityIndex,
+ int instance);
+int xf86GetNumEntityInstances(int entityIndex);
+GDevPtr xf86GetDevFromEntity(int entityIndex, int instance);
+void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex);
+EntityInfoPtr xf86GetEntityInfo(int entityIndex);
+pciVideoPtr xf86GetPciInfoForEntity(int entityIndex);
+int xf86GetPciEntity(int bus, int dev, int func);
+Bool xf86SetEntityFuncs(int entityIndex, EntityProc init,
+ EntityProc enter, EntityProc leave, pointer);
+void xf86DeallocateResourcesForEntity(int entityIndex, unsigned long type);
+resPtr xf86RegisterResources(int entityIndex, resList list, int Access);
+Bool xf86CheckPciMemBase(pciVideoPtr pPci, memType base);
+void xf86SetAccessFuncs(EntityInfoPtr pEnt, xf86SetAccessFuncPtr funcs,
+ xf86SetAccessFuncPtr oldFuncs);
+Bool xf86IsEntityPrimary(int entityIndex);
+Bool xf86FixPciResource(int entityIndex, int prt, memType alignment,
+ unsigned long type);
+resPtr xf86ReallocatePciResources(int entityIndex, resPtr pRes);
+resPtr xf86SetOperatingState(resList list, int entityIndex, int mask);
+void xf86EnterServerState(xf86State state);
+resRange xf86GetBlock(unsigned long type, memType size,
+ memType window_start, memType window_end,
+ memType align_mask, resPtr avoid);
+resRange xf86GetSparse(unsigned long type, memType fixed_bits,
+ memType decode_mask, memType address_mask,
+ resPtr avoid);
+memType xf86ChkConflict(resRange *rgp, int entityIndex);
+Bool xf86IsPciDevPresent(int bus, int dev, int func);
+ScrnInfoPtr xf86FindScreenForEntity(int entityIndex);
+Bool xf86NoSharedResources(int screenIndex, resType res);
+resPtr xf86FindIntersectOfLists(resPtr l1, resPtr l2);
+pciVideoPtr xf86FindPciDeviceVendor(CARD16 vendorID, CARD16 deviceID,
+ char n, pciVideoPtr pvp_exclude);
+pciVideoPtr xf86FindPciClass(CARD8 intf, CARD8 subClass, CARD16 class,
+ char n, pciVideoPtr pvp_exclude);
+void xf86EnablePciBusMaster(pciVideoPtr pPci, Bool enable);
+void xf86RegisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func, pointer arg);
+Bool xf86DeregisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func);
+#ifdef async
+Bool xf86QueueAsyncEvent(void (*func)(pointer),pointer arg);
+#endif
+
+int xf86GetLastScrnFlag(int entityIndex);
+void xf86SetLastScrnFlag(int entityIndex, int scrnIndex);
+Bool xf86IsEntityShared(int entityIndex);
+void xf86SetEntityShared(int entityIndex);
+Bool xf86IsEntitySharable(int entityIndex);
+void xf86SetEntitySharable(int entityIndex);
+Bool xf86IsPrimInitDone(int entityIndex);
+void xf86SetPrimInitDone(int entityIndex);
+void xf86ClearPrimInitDone(int entityIndex);
+int xf86AllocateEntityPrivateIndex(void);
+DevUnion *xf86GetEntityPrivate(int entityIndex, int privIndex);
+
+/* xf86Configure.c */
+GDevPtr xf86AddBusDeviceToConfigure(const char *driver, BusType bus,
+ void *busData, int chipset);
+GDevPtr xf86AddDeviceToConfigure(const char *driver, pciVideoPtr pVideo,
+ int chipset);
+
+/* xf86Cursor.c */
+
+void xf86LockZoom(ScreenPtr pScreen, int lock);
+void xf86InitViewport(ScrnInfoPtr pScr);
+void xf86SetViewport(ScreenPtr pScreen, int x, int y);
+Bool xf86ZoomLocked(ScreenPtr pScreen);
+void xf86ZoomViewport(ScreenPtr pScreen, int zoom);
+void *xf86GetPointerScreenFuncs(void);
+void xf86InitOrigins(void);
+
+/* xf86DPMS.c */
+
+Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags);
+
+/* xf86DGA.c */
+
+Bool DGAInit(ScreenPtr pScreen, DGAFunctionPtr funcs, DGAModePtr modes,
+ int num);
+xf86SetDGAModeProc xf86SetDGAMode;
+
+/* xf86Events.c */
+
+void SetTimeSinceLastInputEvent(void);
+pointer xf86AddInputHandler(int fd, InputHandlerProc proc, pointer data);
+int xf86RemoveInputHandler(pointer handler);
+void xf86DisableInputHandler(pointer handler);
+void xf86EnableInputHandler(pointer handler);
+void xf86InterceptSignals(int *signo);
+Bool xf86EnableVTSwitch(Bool new);
+
+/* xf86Helper.c */
+
+void xf86AddDriver(DriverPtr driver, pointer module, int flags);
+void xf86DeleteDriver(int drvIndex);
+ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags);
+void xf86DeleteScreen(int scrnIndex, int flags);
+int xf86AllocateScrnInfoPrivateIndex(void);
+Bool xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad);
+Bool xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int bpp, int fbbpp,
+ int depth24flags);
+void xf86PrintDepthBpp(ScrnInfoPtr scrp);
+Bool xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask);
+Bool xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual);
+Bool xf86SetGamma(ScrnInfoPtr scrp, Gamma newGamma);
+void xf86SetDpi(ScrnInfoPtr pScrn, int x, int y);
+void xf86SetBlackWhitePixels(ScreenPtr pScreen);
+void xf86EnableDisableFBAccess(int scrnIndex, Bool enable);
+void xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb,
+ const char *format, va_list args);
+void xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb,
+ const char *format, ...);
+void xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...);
+void xf86MsgVerb(MessageType type, int verb, const char *format, ...);
+void xf86Msg(MessageType type, const char *format, ...);
+void xf86ErrorFVerb(int verb, const char *format, ...);
+void xf86ErrorF(const char *format, ...);
+const char *xf86TokenToString(SymTabPtr table, int token);
+int xf86StringToToken(SymTabPtr table, const char *string);
+void xf86ShowClocks(ScrnInfoPtr scrp, MessageType from);
+void xf86PrintChipsets(const char *drvname, const char *drvmsg,
+ SymTabPtr chips);
+int xf86MatchDevice(const char *drivername, GDevPtr **driversectlist);
+int xf86MatchPciInstances(const char *driverName, int vendorID,
+ SymTabPtr chipsets, PciChipsets *PCIchipsets,
+ GDevPtr *devList, int numDevs, DriverPtr drvp,
+ int **foundEntities);
+int xf86MatchIsaInstances(const char *driverName, SymTabPtr chipsets,
+ IsaChipsets *ISAchipsets, DriverPtr drvp,
+ FindIsaDevProc FindIsaDevice, GDevPtr *devList,
+ int numDevs, int **foundEntities);
+void xf86GetClocks(ScrnInfoPtr pScrn, int num,
+ Bool (*ClockFunc)(ScrnInfoPtr, int),
+ void (*ProtectRegs)(ScrnInfoPtr, Bool),
+ void (*BlankScreen)(ScrnInfoPtr, Bool), int vertsyncreg,
+ int maskval, int knownclkindex, int knownclkvalue);
+void xf86SetPriority(Bool up);
+const char *xf86GetVisualName(int visual);
+int xf86GetVerbosity(void);
+Pix24Flags xf86GetPix24(void);
+int xf86GetDepth(void);
+rgb xf86GetWeight(void);
+Gamma xf86GetGamma(void);
+Bool xf86GetFlipPixels(void);
+const char *xf86GetServerName(void);
+Bool xf86ServerIsExiting(void);
+Bool xf86ServerIsResetting(void);
+Bool xf86ServerIsInitialising(void);
+Bool xf86ServerIsOnlyDetecting(void);
+Bool xf86ServerIsOnlyProbing(void);
+Bool xf86CaughtSignal(void);
+Bool xf86GetVidModeAllowNonLocal(void);
+Bool xf86GetVidModeEnabled(void);
+Bool xf86GetModInDevAllowNonLocal(void);
+Bool xf86GetModInDevEnabled(void);
+Bool xf86GetAllowMouseOpenFail(void);
+Bool xf86IsPc98(void);
+pointer xf86LoadDrvSubModule(DriverPtr drv, const char *name);
+pointer xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name);
+pointer xf86LoadOneModule(char *name, pointer optlist);
+void xf86UnloadSubModule(pointer mod);
+Bool xf86LoaderCheckSymbol(const char *name);
+void xf86LoaderReqSymLists(const char **, ...);
+void xf86LoaderReqSymbols(const char *, ...);
+void xf86LoaderRefSymLists(const char **, ...);
+void xf86LoaderRefSymbols(const char *, ...);
+void xf86SetBackingStore(ScreenPtr pScreen);
+void xf86SetSilkenMouse(ScreenPtr pScreen);
+int xf86NewSerialNumber(WindowPtr p, pointer unused);
+pointer xf86FindXvOptions(int scrnIndex, int adapt_index, char *port_name,
+ char **adaptor_name, pointer *adaptor_options);
+void xf86GetOS(const char **name, int *major, int *minor, int *teeny);
+ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag,
+ int entityIndex,PciChipsets *p_chip,
+ resList res, EntityProc init,
+ EntityProc enter, EntityProc leave,
+ pointer private);
+ScrnInfoPtr xf86ConfigIsaEntity(ScrnInfoPtr pScrn, int scrnFlag,
+ int entityIndex, IsaChipsets *i_chip,
+ resList res, EntityProc init,
+ EntityProc enter, EntityProc leave,
+ pointer private);
+ScrnInfoPtr xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag,
+ int entityIndex, EntityProc init,
+ EntityProc enter, EntityProc leave,
+ pointer private);
+/* Obsolete! don't use */
+Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn,
+ int entityIndex,PciChipsets *p_chip,
+ resList res, EntityProc init,
+ EntityProc enter, EntityProc leave,
+ pointer private);
+/* Obsolete! don't use */
+Bool xf86ConfigActiveIsaEntity(ScrnInfoPtr pScrn,
+ int entityIndex, IsaChipsets *i_chip,
+ resList res, EntityProc init,
+ EntityProc enter, EntityProc leave,
+ pointer private);
+void xf86ConfigPciEntityInactive(EntityInfoPtr pEnt, PciChipsets *p_chip,
+ resList res, EntityProc init,
+ EntityProc enter, EntityProc leave,
+ pointer private);
+void xf86ConfigIsaEntityInactive(EntityInfoPtr pEnt, IsaChipsets *i_chip,
+ resList res, EntityProc init,
+ EntityProc enter, EntityProc leave,
+ pointer private);
+void xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init,
+ EntityProc enter, EntityProc leave,
+ pointer private);
+Bool xf86IsScreenPrimary(int scrnIndex);
+int xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
+ int format, unsigned long len,
+ pointer value);
+Bool xf86IsUnblank(int mode);
+
+#ifdef XFree86LOADER
+void xf86AddModuleInfo(ModuleInfoPtr info, pointer module);
+void xf86DeleteModuleInfo(int idx);
+#endif
+
+/* xf86Debug.c */
+#ifdef BUILDDEBUG
+ void xf86Break1(void);
+void xf86Break2(void);
+void xf86Break3(void);
+CARD8 xf86PeekFb8(CARD8 *p);
+CARD16 xf86PeekFb16(CARD16 *p);
+CARD32 xf86PeekFb32(CARD32 *p);
+void xf86PokeFb8(CARD8 *p, CARD8 v);
+void xf86PokeFb16(CARD16 *p, CARD16 v);
+void xf86PokeFb32(CARD16 *p, CARD32 v);
+CARD8 xf86PeekMmio8(pointer Base, unsigned long Offset);
+CARD16 xf86PeekMmio16(pointer Base, unsigned long Offset);
+CARD32 xf86PeekMmio32(pointer Base, unsigned long Offset);
+void xf86PokeMmio8(pointer Base, unsigned long Offset, CARD8 v);
+void xf86PokeMmio16(pointer Base, unsigned long Offset, CARD16 v);
+void xf86PokeMmio32(pointer Base, unsigned long Offset, CARD32 v);
+extern void xf86SPTimestamp(xf86TsPtr* timestamp, char* string);
+extern void xf86STimestamp(xf86TsPtr* timestamp);
+#endif
+
+/* xf86Init.c */
+
+PixmapFormatPtr xf86GetPixFormat(ScrnInfoPtr pScrn, int depth);
+int xf86GetBppFromDepth(ScrnInfoPtr pScrn, int depth);
+
+/* xf86Mode.c */
+
+int xf86GetNearestClock(ScrnInfoPtr scrp, int freq, Bool allowDiv2,
+ int DivFactor, int MulFactor, int *divider);
+const char *xf86ModeStatusToString(ModeStatus status);
+ModeStatus xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
+ ClockRangePtr clockRanges, LookupModeFlags strategy);
+ModeStatus xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor);
+ModeStatus xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
+ ClockRangePtr clockRanges,
+ LookupModeFlags strategy,
+ int maxPitch, int virtualX,
+ int virtualY);
+ModeStatus xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
+ int flags);
+int xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
+ char **modeNames, ClockRangePtr clockRanges,
+ int *linePitches, int minPitch, int maxPitch,
+ int minHeight, int maxHeight, int pitchInc,
+ int virtualX, int virtualY, int apertureSize,
+ LookupModeFlags strategy);
+void xf86DeleteMode(DisplayModePtr *modeList, DisplayModePtr mode);
+void xf86PruneDriverModes(ScrnInfoPtr scrp);
+void xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags);
+void xf86PrintModes(ScrnInfoPtr scrp);
+void xf86ShowClockRanges(ScrnInfoPtr scrp, ClockRangePtr clockRanges);
+
+/* xf86Option.c */
+
+void xf86CollectOptions(ScrnInfoPtr pScrn, pointer extraOpts);
+
+/* xf86VidModeExtentionInit.c */
+
+Bool VidModeExtensionInit(ScreenPtr pScreen);
+
+#endif /* _NO_XF86_PROTOTYPES */
+
+#endif /* _XF86_H */
diff --git a/Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86Module.h b/Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86Module.h
new file mode 100644
index 0000000..f3d5f89
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86Module.h
@@ -0,0 +1,197 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Module.h,v 1.30 2001/08/13 21:46:50 dawes Exp $ */
+
+/*
+ * Copyright (c) 1997-2001 by The XFree86 Project, Inc.
+ */
+
+/*
+ * This file contains the parts of the loader interface that are visible
+ * to modules. This is the only loader-related header that modules should
+ * include.
+ *
+ * It should include a bare minimum of other headers.
+ *
+ * Longer term, the module/loader code should probably live directly under
+ * Xserver/.
+ *
+ * XXX This file arguably belongs in xfree86/loader/.
+ */
+
+#ifndef _XF86MODULE_H
+#define _XF86MODULE_H
+
+#include "misc.h"
+#include "xf86Version.h"
+#ifndef NULL
+#define NULL ((void *)0)
+#endif
+
+typedef enum {
+ LD_RESOLV_IFDONE = 0, /* only check if no more
+ delays pending */
+ LD_RESOLV_NOW = 1, /* finish one delay step */
+ LD_RESOLV_FORCE = 2 /* force checking... */
+} LoaderResolveOptions;
+
+#define DEFAULT_LIST ((char *)-1)
+
+/* This indicates a special module that doesn't have the usual entry point */
+#define EXTERN_MODULE ((pointer)-1)
+
+/* Built-in ABI classes. These definitions must not be changed. */
+#define ABI_CLASS_NONE NULL
+#define ABI_CLASS_ANSIC "XFree86 ANSI C Emulation"
+#define ABI_CLASS_VIDEODRV "XFree86 Video Driver"
+#define ABI_CLASS_XINPUT "XFree86 XInput driver"
+#define ABI_CLASS_EXTENSION "XFree86 Server Extension"
+#define ABI_CLASS_FONT "XFree86 Font Renderer"
+
+#define ABI_MINOR_MASK 0x0000FFFF
+#define ABI_MAJOR_MASK 0xFFFF0000
+#define GET_ABI_MINOR(v) ((v) & ABI_MINOR_MASK)
+#define GET_ABI_MAJOR(v) (((v) & ABI_MAJOR_MASK) >> 16)
+#define SET_ABI_VERSION(maj, min) \
+ ((((maj) << 16) & ABI_MAJOR_MASK) | ((min) & ABI_MINOR_MASK))
+
+/*
+ * ABI versions. Each version has a major and minor revision. Modules
+ * using lower minor revisions must work with servers of a higher minor
+ * revision. There is no compatibility between different major revisions.
+ * Whenever the ABI_ANSIC_VERSION is changed, the others must also be
+ * changed. The minor revision mask is 0x0000FFFF and the major revision
+ * mask is 0xFFFF0000.
+ */
+#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 1)
+#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(0, 5)
+#define ABI_XINPUT_VERSION SET_ABI_VERSION(0, 3)
+#define ABI_EXTENSION_VERSION SET_ABI_VERSION(0, 1)
+#define ABI_FONT_VERSION SET_ABI_VERSION(0, 3)
+
+#define MODINFOSTRING1 0xef23fdc5
+#define MODINFOSTRING2 0x10dc023a
+
+#ifndef MODULEVENDORSTRING
+#ifndef __OS2ELF__
+#define MODULEVENDORSTRING "The XFree86 Project"
+#else
+#define MODULEVENDORSTRING "The XFree86 Project - XFree86/OS2"
+#endif
+#endif
+
+/* Error return codes for errmaj. New codes must only be added at the end. */
+typedef enum {
+ LDR_NOERROR = 0,
+ LDR_NOMEM, /* memory allocation failed */
+ LDR_NOENT, /* Module file does not exist */
+ LDR_NOSUBENT, /* pre-requsite file to be sub-loaded does not exist */
+ LDR_NOSPACE, /* internal module array full */
+ LDR_NOMODOPEN, /* module file could not be opened (check errmin) */
+ LDR_UNKTYPE, /* file is not a recognized module type */
+ LDR_NOLOAD, /* type specific loader failed */
+ LDR_ONCEONLY, /* Module should only be loaded once (not an error) */
+ LDR_NOPORTOPEN, /* could not open port (check errmin) */
+ LDR_NOHARDWARE, /* could not query/initialize the hardware device */
+ LDR_MISMATCH, /* the module didn't match the spec'd requirments */
+ LDR_BADUSAGE, /* LoadModule is called with bad arguments */
+ LDR_INVALID, /* The module doesn't have a valid ModuleData object */
+ LDR_BADOS, /* The module doesn't support the OS */
+ LDR_MODSPECIFIC /* A module-specific error in the SetupProc */
+} LoaderErrorCode;
+
+/*
+ * Some common module classes. The moduleclass can be used to identify
+ * that modules loaded are of the correct type. This is a finer
+ * classification than the ABI classes even though the default set of
+ * classes have the same names. For example, not all modules that require
+ * the video driver ABI are themselves video drivers.
+ */
+#define MOD_CLASS_NONE NULL
+#define MOD_CLASS_VIDEODRV "XFree86 Video Driver"
+#define MOD_CLASS_XINPUT "XFree86 XInput Driver"
+#define MOD_CLASS_FONT "XFree86 Font Renderer"
+#define MOD_CLASS_EXTENSION "XFree86 Server Extension"
+
+/* This structure is expected to be returned by the initfunc */
+typedef struct {
+ const char * modname; /* name of module, e.g. "foo" */
+ const char * vendor; /* vendor specific string */
+ CARD32 _modinfo1_; /* constant MODINFOSTRING1/2 to find */
+ CARD32 _modinfo2_; /* infoarea with a binary editor or sign tool */
+ CARD32 xf86version; /* contains XF86_VERSION_CURRENT */
+ CARD8 majorversion; /* module-specific major version */
+ CARD8 minorversion; /* module-specific minor version */
+ CARD16 patchlevel; /* module-specific patch level */
+ const char * abiclass; /* ABI class that the module uses */
+ CARD32 abiversion; /* ABI version */
+ const char * moduleclass; /* module class description */
+ CARD32 checksum[4]; /* contains a digital signature of the */
+ /* version info structure */
+} XF86ModuleVersionInfo;
+
+/*
+ * This structure can be used to callers of LoadModule and LoadSubModule to
+ * specify version and/or ABI requirements.
+ */
+typedef struct {
+ CARD8 majorversion; /* module-specific major version */
+ CARD8 minorversion; /* moudle-specific minor version */
+ CARD16 patchlevel; /* module-specific patch level */
+ const char * abiclass; /* ABI class that the module uses */
+ CARD32 abiversion; /* ABI version */
+ const char * moduleclass; /* module class */
+} XF86ModReqInfo;
+
+/* values to indicate unspecified fields in XF86ModReqInfo. */
+#define MAJOR_UNSPEC 0xFF
+#define MINOR_UNSPEC 0xFF
+#define PATCH_UNSPEC 0xFFFF
+#define ABI_VERS_UNSPEC 0xFFFFFFFF
+
+#define INITARGS void
+
+typedef void (*InitExtension)(INITARGS);
+
+typedef struct {
+ InitExtension initFunc;
+ const char * name;
+ Bool *disablePtr;
+ InitExtension setupFunc;
+ const char ** initDependencies;
+} ExtensionModule;
+
+extern ExtensionModule *ExtensionModuleList;
+
+/* Prototypes for Loader functions that are exported to modules */
+#ifndef IN_LOADER
+/* Prototypes with opaque pointers for use by modules */
+pointer LoadSubModule(pointer, const char *, const char **,
+ const char **, pointer, const XF86ModReqInfo *,
+ int *, int *);
+void UnloadSubModule(pointer);
+void LoadFont(pointer);
+void UnloadModule (pointer);
+#endif
+pointer LoaderSymbol(const char *);
+char **LoaderListDirs(const char **, const char **);
+void LoaderFreeDirList(char **);
+void LoaderErrorMsg(const char *, const char *, int, int);
+void LoadExtension(ExtensionModule *, Bool);
+void LoaderRefSymLists(const char **, ...);
+void LoaderRefSymbols(const char *, ...);
+void LoaderReqSymLists(const char **, ...);
+void LoaderReqSymbols(const char *, ...);
+int LoaderCheckUnresolved(int);
+void LoaderGetOS(const char **name, int *major, int *minor, int *teeny);
+
+typedef pointer (*ModuleSetupProc)(pointer, pointer, int *, int *);
+typedef void (*ModuleTearDownProc)(pointer);
+#define MODULESETUPPROTO(func) pointer func(pointer, pointer, int*, int*)
+#define MODULETEARDOWNPROTO(func) void func(pointer)
+
+typedef struct {
+ XF86ModuleVersionInfo * vers;
+ ModuleSetupProc setup;
+ ModuleTearDownProc teardown;
+} XF86ModuleData;
+
+#endif /* _XF86STR_H */
diff --git a/Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86Opt.h b/Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86Opt.h
new file mode 100644
index 0000000..bd96b75
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86Opt.h
@@ -0,0 +1,82 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Opt.h,v 1.11 2001/03/13 16:03:36 dawes Exp $ */
+
+/* Option handling things that ModuleSetup procs can use */
+
+#ifndef _XF86_OPT_H_
+#define _XF86_OPT_H_
+
+typedef struct {
+ double freq;
+ int units;
+} OptFrequency;
+
+typedef union {
+ unsigned long num;
+ char * str;
+ double realnum;
+ Bool bool;
+ OptFrequency freq;
+} ValueUnion;
+
+typedef enum {
+ OPTV_NONE = 0,
+ OPTV_INTEGER,
+ OPTV_STRING, /* a non-empty string */
+ OPTV_ANYSTR, /* Any string, including an empty one */
+ OPTV_REAL,
+ OPTV_BOOLEAN,
+ OPTV_FREQ
+} OptionValueType;
+
+typedef enum {
+ OPTUNITS_HZ = 1,
+ OPTUNITS_KHZ,
+ OPTUNITS_MHZ
+} OptFreqUnits;
+
+typedef struct {
+ int token;
+ const char* name;
+ OptionValueType type;
+ ValueUnion value;
+ Bool found;
+} OptionInfoRec, *OptionInfoPtr;
+
+int xf86SetIntOption(pointer optlist, const char *name, int deflt);
+double xf86SetRealOption(pointer optlist, const char *name, double deflt);
+char *xf86SetStrOption(pointer optlist, const char *name, char *deflt);
+int xf86SetBoolOption(pointer list, const char *name, int deflt );
+pointer xf86AddNewOption(pointer head, char *name, char *val );
+pointer xf86NewOption(char *name, char *value );
+pointer xf86NextOption(pointer list );
+pointer xf86OptionListCreate(const char **options, int count, int used);
+pointer xf86OptionListMerge(pointer head, pointer tail);
+void xf86OptionListFree(pointer opt);
+char *xf86OptionName(pointer opt);
+char *xf86OptionValue(pointer opt);
+void xf86OptionListReport(pointer parm);
+pointer xf86FindOption(pointer options, const char *name);
+char *xf86FindOptionValue(pointer options, const char *name);
+void xf86MarkOptionUsed(pointer option);
+void xf86MarkOptionUsedByName(pointer options, const char *name);
+Bool xf86CheckIfOptionUsed(pointer option);
+Bool xf86CheckIfOptionUsedByName(pointer options, const char *name);
+void xf86ShowUnusedOptions(int scrnIndex, pointer options);
+void xf86ProcessOptions(int scrnIndex, pointer options, OptionInfoPtr optinfo);
+OptionInfoPtr xf86TokenToOptinfo(const OptionInfoRec *table, int token);
+const char *xf86TokenToOptName(const OptionInfoRec *table, int token);
+Bool xf86IsOptionSet(const OptionInfoRec *table, int token);
+char *xf86GetOptValString(const OptionInfoRec *table, int token);
+Bool xf86GetOptValInteger(const OptionInfoRec *table, int token, int *value);
+Bool xf86GetOptValULong(const OptionInfoRec *table, int token, unsigned long *value);
+Bool xf86GetOptValReal(const OptionInfoRec *table, int token, double *value);
+Bool xf86GetOptValFreq(const OptionInfoRec *table, int token,
+ OptFreqUnits expectedUnits, double *value);
+Bool xf86GetOptValBool(const OptionInfoRec *table, int token, Bool *value);
+Bool xf86ReturnOptValBool(const OptionInfoRec *table, int token, Bool def);
+int xf86NameCmp(const char *s1, const char *s2);
+char *xf86NormalizeName(const char *s);
+pointer xf86ReplaceIntOption(pointer optlist, char *name, int val);
+pointer xf86ReplaceBoolOption(pointer optlist, char *name, Bool val);
+pointer xf86ReplaceStrOption(pointer optlist, char *name, char* val);
+#endif
diff --git a/Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86Version.h b/Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86Version.h
new file mode 100644
index 0000000..0922a99
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86Version.h
@@ -0,0 +1,31 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 3.486 2002/01/17 23:27:43 dawes Exp $ */
+
+#ifndef XF86_VERSION_CURRENT
+
+#define XF86_VERSION_MAJOR 4
+#define XF86_VERSION_MINOR 2
+#define XF86_VERSION_PATCH 0
+#define XF86_VERSION_SNAP 0
+
+/* This has five arguments for compatibilty reasons */
+#define XF86_VERSION_NUMERIC(major,minor,patch,snap,dummy) \
+ (((major) * 10000000) + ((minor) * 100000) + ((patch) * 1000) + snap)
+
+/* Define these for compatibility. They'll be removed at some point. */
+#define XF86_VERSION_SUBMINOR XF86_VERSION_PATCH
+#define XF86_VERSION_BETA 0
+#define XF86_VERSION_ALPHA XF86_VERSION_SNAP
+
+#define XF86_VERSION_CURRENT \
+ XF86_VERSION_NUMERIC(XF86_VERSION_MAJOR, \
+ XF86_VERSION_MINOR, \
+ XF86_VERSION_PATCH, \
+ XF86_VERSION_SNAP, \
+ 0)
+
+
+#define XF86_DATE "23 January 2002"
+
+#endif
+
+/* $XConsortium: xf86Version.h /main/78 1996/10/28 05:42:10 kaleb $ */
diff --git a/Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86Xinput.h b/Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86Xinput.h
new file mode 100644
index 0000000..e497ca9
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86Xinput.h
@@ -0,0 +1,191 @@
+/* $XConsortium: xf86Xinput.h /main/11 1996/10/27 11:05:29 kaleb $ */
+/*
+ * 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.
+ *
+ */
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Xinput.h,v 3.33 2001/03/04 01:37:09 tsi Exp $ */
+
+#ifndef _xf86Xinput_h
+#define _xf86Xinput_h
+
+#ifndef NEED_EVENTS
+#define NEED_EVENTS
+#endif
+#include "xf86str.h"
+#include "inputstr.h"
+#ifdef XINPUT
+#include "extensions/XI.h"
+#include "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)
+
+#ifdef DBG
+#undef DBG
+#endif
+#define DBG(lvl, f) {if ((lvl) <= xf86GetVerbosity()) f;}
+
+#ifdef HAS_MOTION_HISTORY
+#undef HAS_MOTION_HISTORY
+#endif
+#define HAS_MOTION_HISTORY(local) ((local)->dev->valuator && (local)->dev->valuator->numMotionEvents)
+
+#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 fd;
+ Atom atom;
+ DeviceIntPtr dev;
+ pointer private;
+ int private_flags;
+ pointer motion_history;
+ ValuatorMotionProcPtr motion_history_proc;
+ unsigned int history_size; /* only for configuration purpose */
+ unsigned int first;
+ unsigned int last;
+ int old_x;
+ int old_y;
+ float dxremaind;
+ float dyremaind;
+ char * type_name;
+ IntegerFeedbackPtr always_core_feedback;
+ IDevPtr conf_idev;
+ InputDriverPtr drv;
+ pointer module;
+ pointer options;
+} LocalDeviceRec, *LocalDevicePtr, InputInfoRec, *InputInfoPtr;
+
+typedef struct _DeviceAssocRec
+{
+ char * config_section_name;
+ LocalDevicePtr (*device_allocate)(void);
+} DeviceAssocRec, *DeviceAssocPtr;
+
+/* xf86Globals.c */
+extern InputInfoPtr xf86InputDevs;
+
+/* xf86Xinput.c */
+int xf86IsCorePointer(DeviceIntPtr dev);
+int xf86IsCoreKeyboard(DeviceIntPtr dev);
+void xf86XInputSetSendCoreEvents(LocalDevicePtr local, Bool always);
+#define xf86AlwaysCore(a,b) xf86XInputSetSendCoreEvents(a,b)
+
+void InitExtInput(void);
+Bool xf86eqInit(DevicePtr pKbd, DevicePtr pPtr);
+void xf86eqEnqueue(struct _xEvent *event);
+void xf86eqProcessInputEvents (void);
+void xf86eqSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
+void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute,
+ int first_valuator, int num_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 xf86MotionHistoryAllocate(LocalDevicePtr local);
+int xf86GetMotionEvents(DeviceIntPtr dev, xTimecoord *buff,
+ unsigned long start, unsigned long stop,
+ ScreenPtr pScreen);
+void xf86XinputFinalizeInit(DeviceIntPtr dev);
+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);
+
+/* xf86Helper.c */
+void xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags);
+void xf86DeleteInputDriver(int drvIndex);
+InputInfoPtr xf86AllocateInput(InputDriverPtr drv, int flags);
+void xf86DeleteInput(InputInfoPtr pInp, int flags);
+
+/* xf86Option.c */
+void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
+ pointer extraOpts);
+
+#endif /* _xf86Xinput_h */
diff --git a/Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86str.h b/Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86str.h
new file mode 100644
index 0000000..690c917
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/hw/xfree86/common/xf86str.h
@@ -0,0 +1,994 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86str.h,v 1.81 2001/10/28 03:33:19 tsi Exp $ */
+
+/*
+ * Copyright (c) 1997-2000 by The XFree86 Project, Inc.
+ */
+
+/*
+ * This file contains definitions of the public XFree86 data structures/types.
+ * Any data structures that video drivers need to access should go here.
+ */
+
+#ifndef _XF86STR_H
+#define _XF86STR_H
+
+#include "misc.h"
+#include "input.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "xf86Module.h"
+#include "xf86Opt.h"
+
+/*
+ * memType is of the size of the addressable memory (machine size)
+ * usually unsigned long.
+ */
+typedef unsigned long memType;
+
+/* Video mode flags */
+
+typedef enum {
+ V_PHSYNC = 0x0001,
+ V_NHSYNC = 0x0002,
+ V_PVSYNC = 0x0004,
+ V_NVSYNC = 0x0008,
+ V_INTERLACE = 0x0010,
+ V_DBLSCAN = 0x0020,
+ V_CSYNC = 0x0040,
+ V_PCSYNC = 0x0080,
+ V_NCSYNC = 0x0100,
+ V_HSKEW = 0x0200, /* hskew provided */
+ V_BCAST = 0x0400,
+ V_PIXMUX = 0x1000,
+ V_DBLCLK = 0x2000,
+ V_CLKDIV2 = 0x4000
+} ModeFlags;
+
+typedef enum {
+ INTERLACE_HALVE_V = 0x0001 /* Halve V values for interlacing */
+} CrtcAdjustFlags;
+
+/* Flags passed to ChipValidMode() */
+typedef enum {
+ MODECHECK_INITIAL = 0,
+ MODECHECK_FINAL = 1
+} ModeCheckFlags;
+
+/* These are possible return values for xf86CheckMode() and ValidMode() */
+typedef enum {
+ MODE_OK = 0, /* Mode OK */
+ MODE_HSYNC, /* hsync out of range */
+ MODE_VSYNC, /* vsync out of range */
+ MODE_H_ILLEGAL, /* mode has illegal horizontal timings */
+ MODE_V_ILLEGAL, /* mode has illegal horizontal timings */
+ MODE_BAD_WIDTH, /* requires an unsupported linepitch */
+ MODE_NOMODE, /* no mode with a maching name */
+ MODE_NO_INTERLACE, /* interlaced mode not supported */
+ MODE_NO_DBLESCAN, /* doublescan mode not supported */
+ MODE_NO_VSCAN, /* multiscan mode not supported */
+ MODE_MEM, /* insufficient video memory */
+ MODE_VIRTUAL_X, /* mode width too large for specified virtual size */
+ MODE_VIRTUAL_Y, /* mode height too large for specified virtual size */
+ MODE_MEM_VIRT, /* insufficient video memory given virtual size */
+ MODE_NOCLOCK, /* no fixed clock available */
+ MODE_CLOCK_HIGH, /* clock required is too high */
+ MODE_CLOCK_LOW, /* clock required is too low */
+ MODE_CLOCK_RANGE, /* clock/mode isn't in a ClockRange */
+ MODE_BAD_HVALUE, /* horizontal timing was out of range */
+ MODE_BAD_VVALUE, /* vertical timing was out of range */
+ MODE_BAD_VSCAN, /* VScan value out of range */
+ MODE_HSYNC_NARROW, /* horizontal sync too narrow */
+ MODE_HSYNC_WIDE, /* horizontal sync too wide */
+ MODE_HBLANK_NARROW, /* horizontal blanking too narrow */
+ MODE_HBLANK_WIDE, /* horizontal blanking too wide */
+ MODE_VSYNC_NARROW, /* vertical sync too narrow */
+ MODE_VSYNC_WIDE, /* vertical sync too wide */
+ MODE_VBLANK_NARROW, /* vertical blanking too narrow */
+ MODE_VBLANK_WIDE, /* vertical blanking too wide */
+ MODE_PANEL, /* exceeds panel dimensions */
+ MODE_INTERLACE_WIDTH, /* width too large for interlaced mode */
+ MODE_ONE_WIDTH, /* only one width is supported */
+ MODE_ONE_HEIGHT, /* only one height is supported */
+ MODE_ONE_SIZE, /* only one resolution is supported */
+ MODE_BAD = -2, /* unspecified reason */
+ MODE_ERROR = -1 /* error condition */
+} ModeStatus;
+
+# define M_T_BUILTIN 0x01 /* built-in mode */
+# define M_T_CLOCK_C (0x02 | M_T_BUILTIN) /* built-in mode - configure clock */
+# define M_T_CRTC_C (0x04 | M_T_BUILTIN) /* built-in mode - configure CRTC */
+# define M_T_CLOCK_CRTC_C (M_T_CLOCK_C | M_T_CRTC_C)
+ /* built-in mode - configure CRTC and clock */
+# define M_T_DEFAULT 0x10 /* (VESA) default modes */
+
+/* Video mode */
+typedef struct _DisplayModeRec {
+ struct _DisplayModeRec * prev;
+ struct _DisplayModeRec * next;
+ char * name; /* identifier for the mode */
+ ModeStatus status;
+ int type;
+
+ /* These are the values that the user sees/provides */
+ int Clock; /* pixel clock freq */
+ int HDisplay; /* horizontal timing */
+ int HSyncStart;
+ int HSyncEnd;
+ int HTotal;
+ int HSkew;
+ int VDisplay; /* vertical timing */
+ int VSyncStart;
+ int VSyncEnd;
+ int VTotal;
+ int VScan;
+ int Flags;
+
+ /* These are the values the hardware uses */
+ int ClockIndex;
+ int SynthClock; /* Actual clock freq to
+ * be programmed */
+ int CrtcHDisplay;
+ int CrtcHBlankStart;
+ int CrtcHSyncStart;
+ int CrtcHSyncEnd;
+ int CrtcHBlankEnd;
+ int CrtcHTotal;
+ int CrtcHSkew;
+ int CrtcVDisplay;
+ int CrtcVBlankStart;
+ int CrtcVSyncStart;
+ int CrtcVSyncEnd;
+ int CrtcVBlankEnd;
+ int CrtcVTotal;
+ Bool CrtcHAdjusted;
+ Bool CrtcVAdjusted;
+ int PrivSize;
+ INT32 * Private;
+ int PrivFlags;
+
+ float HSync, VRefresh;
+} DisplayModeRec, *DisplayModePtr;
+
+/* The monitor description */
+
+#define MAX_HSYNC 8
+#define MAX_VREFRESH 8
+
+typedef struct { float hi, lo; } range;
+
+typedef struct { CARD32 red, green, blue; } rgb;
+
+typedef struct { float red, green, blue; } Gamma;
+
+/* The permitted gamma range is 1 / GAMMA_MAX <= g <= GAMMA_MAX */
+#define GAMMA_MAX 10.0
+#define GAMMA_MIN (1.0 / GAMMA_MAX)
+#define GAMMA_ZERO (GAMMA_MIN / 100.0)
+
+typedef struct {
+ char * id;
+ char * vendor;
+ char * model;
+ int nHsync;
+ range hsync[MAX_HSYNC];
+ int nVrefresh;
+ range vrefresh[MAX_VREFRESH];
+ DisplayModePtr Modes; /* Start of the monitor's mode list */
+ DisplayModePtr Last; /* End of the monitor's mode list */
+ Gamma gamma; /* Gamma of the monitor */
+ int widthmm;
+ int heightmm;
+ pointer options;
+ pointer DDC;
+} MonRec, *MonPtr;
+
+/* the list of clock ranges */
+typedef struct x_ClockRange {
+ struct x_ClockRange *next;
+ int minClock;
+ int maxClock;
+ int clockIndex; /* -1 for programmable clocks */
+ Bool interlaceAllowed;
+ Bool doubleScanAllowed;
+ int ClockMulFactor;
+ int ClockDivFactor;
+ int PrivFlags;
+} ClockRange, *ClockRangePtr;
+
+/* Need to store the strategy with clockRange for VidMode extension */
+typedef struct x_ClockRanges {
+ struct x_ClockRanges *next;
+ int minClock;
+ int maxClock;
+ int clockIndex; /* -1 for programmable clocks */
+ Bool interlaceAllowed;
+ Bool doubleScanAllowed;
+ int ClockMulFactor;
+ int ClockDivFactor;
+ int PrivFlags;
+ int strategy;
+} ClockRanges, *ClockRangesPtr;
+
+/*
+ * The driver list struct. This contains the information required for each
+ * driver before a ScrnInfoRec has been allocated.
+ */
+typedef struct _DriverRec {
+ int driverVersion;
+ char * driverName;
+ void (*Identify)(int flags);
+ Bool (*Probe)(struct _DriverRec *drv, int flags);
+ const OptionInfoRec * (*AvailableOptions)(int chipid, int bustype);
+ pointer module;
+ int refCount;
+} DriverRec, *DriverPtr;
+
+#ifdef XFree86LOADER
+/*
+ * The optional module list struct. This allows modules exporting helping
+ * functions to configuration tools, the Xserver, or any other
+ * application/module interested in such information.
+ */
+typedef struct _ModuleInfoRec {
+ int moduleVersion;
+ char * moduleName;
+ pointer module;
+ int refCount;
+ const OptionInfoRec * (*AvailableOptions)(void *unused);
+ pointer unused[8]; /* leave some space for more fields */
+} ModuleInfoRec, *ModuleInfoPtr;
+#endif
+
+/*
+ * These are the private bus types. New types can be added here. Types
+ * required for the public interface should be added to xf86str.h, with
+ * function prototypes added to xf86.h.
+ */
+
+typedef enum {
+ BUS_NONE,
+ BUS_ISA,
+ BUS_PCI,
+ BUS_SBUS,
+ BUS_last /* Keep last */
+} BusType;
+
+typedef struct {
+ int bus;
+ int device;
+ int func;
+} PciBusId;
+
+typedef struct {
+ unsigned int dummy;
+} IsaBusId;
+
+typedef struct {
+ int fbNum;
+} SbusBusId;
+
+typedef struct _bus {
+ BusType type;
+ union {
+ IsaBusId isa;
+ PciBusId pci;
+ SbusBusId sbus;
+ } id;
+} BusRec, *BusPtr;
+
+#define MAXCLOCKS 128
+typedef enum {
+ DAC_BPP8 = 0,
+ DAC_BPP16,
+ DAC_BPP24,
+ DAC_BPP32,
+ MAXDACSPEEDS
+} DacSpeedIndex;
+
+typedef struct {
+ char * identifier;
+ char * vendor;
+ char * board;
+ char * chipset;
+ char * ramdac;
+ char * driver;
+ struct _confscreenrec * myScreenSection;
+ Bool claimed;
+ int dacSpeeds[MAXDACSPEEDS];
+ int numclocks;
+ int clock[MAXCLOCKS];
+ char * clockchip;
+ char * busID;
+ Bool active;
+ Bool inUse;
+ int videoRam;
+ int textClockFreq;
+ unsigned long BiosBase; /* Base address of video BIOS */
+ unsigned long MemBase; /* Frame buffer base address */
+ unsigned long IOBase;
+ int chipID;
+ int chipRev;
+ pointer options;
+ int irq;
+ int screen; /* For multi-CRTC cards */
+} GDevRec, *GDevPtr;
+
+typedef int (*FindIsaDevProc)(GDevPtr dev);
+
+typedef struct {
+ char * identifier;
+ char * driver;
+ pointer commonOptions;
+ pointer extraOptions;
+} IDevRec, *IDevPtr;
+
+typedef struct {
+ int vendor;
+ int chipType;
+ int chipRev;
+ int subsysVendor;
+ int subsysCard;
+ int bus;
+ int device;
+ int func;
+ int class;
+ int subclass;
+ int interface;
+ memType memBase[6];
+ memType ioBase[6];
+ int size[6];
+ unsigned char type[6];
+ memType biosBase;
+ int biosSize;
+ pointer thisCard;
+ Bool validSize;
+ Bool validate;
+ CARD32 listed_class;
+} pciVideoRec, *pciVideoPtr;
+
+typedef struct {
+ int frameX0;
+ int frameY0;
+ int virtualX;
+ int virtualY;
+ int depth;
+ int fbbpp;
+ rgb weight;
+ rgb blackColour;
+ rgb whiteColour;
+ int defaultVisual;
+ char ** modes;
+ pointer options;
+} DispRec, *DispPtr;
+
+typedef struct _confxvportrec {
+ char * identifier;
+ pointer options;
+} confXvPortRec, *confXvPortPtr;
+
+typedef struct _confxvadaptrec {
+ char * identifier;
+ int numports;
+ confXvPortPtr ports;
+ pointer options;
+} confXvAdaptorRec, *confXvAdaptorPtr;
+
+typedef struct _confscreenrec {
+ char * id;
+ int screennum;
+ int defaultdepth;
+ int defaultbpp;
+ int defaultfbbpp;
+ MonPtr monitor;
+ GDevPtr device;
+ int numdisplays;
+ DispPtr displays;
+ int numxvadaptors;
+ confXvAdaptorPtr xvadaptors;
+ pointer options;
+} confScreenRec, *confScreenPtr;
+
+typedef enum {
+ PosObsolete = -1,
+ PosAbsolute = 0,
+ PosRightOf,
+ PosLeftOf,
+ PosAbove,
+ PosBelow,
+ PosRelative
+} PositionType;
+
+typedef struct _screenlayoutrec {
+ confScreenPtr screen;
+ char * topname;
+ confScreenPtr top;
+ char * bottomname;
+ confScreenPtr bottom;
+ char * leftname;
+ confScreenPtr left;
+ char * rightname;
+ confScreenPtr right;
+ PositionType where;
+ int x;
+ int y;
+ char * refname;
+ confScreenPtr refscreen;
+} screenLayoutRec, *screenLayoutPtr;
+
+typedef struct _serverlayoutrec {
+ char * id;
+ screenLayoutPtr screens;
+ GDevPtr inactives;
+ IDevPtr inputs;
+ pointer options;
+} serverLayoutRec, *serverLayoutPtr;
+
+typedef struct _confdribufferrec {
+ int count;
+ int size;
+ enum {
+ XF86DRI_WC_HINT = 0x0001 /* Placeholder: not implemented */
+ } flags;
+} confDRIBufferRec, *confDRIBufferPtr;
+
+typedef struct _confdrirec {
+ int group;
+ int mode;
+ int bufs_count;
+ confDRIBufferRec *bufs;
+} confDRIRec, *confDRIPtr;
+
+/* These values should be adjusted when new fields are added to ScrnInfoRec */
+#define NUM_RESERVED_INTS 16
+#define NUM_RESERVED_POINTERS 15
+#define NUM_RESERVED_FUNCS 16
+
+typedef pointer (*funcPointer)(void);
+
+/* Flags for driver messages */
+typedef enum {
+ X_PROBED, /* Value was probed */
+ X_CONFIG, /* Value was given in the config file */
+ X_DEFAULT, /* Value is a default */
+ X_CMDLINE, /* Value was given on the command line */
+ X_NOTICE, /* Notice */
+ X_ERROR, /* Error message */
+ X_WARNING, /* Warning message */
+ X_INFO, /* Informational message */
+ X_NONE, /* No prefix */
+ X_NOT_IMPLEMENTED /* Not implemented */
+} MessageType;
+
+/* flags for depth 24 pixmap options */
+typedef enum {
+ Pix24DontCare = 0,
+ Pix24Use24,
+ Pix24Use32
+} Pix24Flags;
+
+/* Power management events: so far we only support APM */
+
+typedef enum {
+ XF86_APM_UNKNOWN = -1,
+ XF86_APM_SYS_STANDBY,
+ XF86_APM_SYS_SUSPEND,
+ XF86_APM_CRITICAL_SUSPEND,
+ XF86_APM_USER_STANDBY,
+ XF86_APM_USER_SUSPEND,
+ XF86_APM_STANDBY_RESUME,
+ XF86_APM_NORMAL_RESUME,
+ XF86_APM_CRITICAL_RESUME,
+ XF86_APM_LOW_BATTERY,
+ XF86_APM_POWER_STATUS_CHANGE,
+ XF86_APM_UPDATE_TIME,
+ XF86_APM_CAPABILITY_CHANGED,
+ XF86_APM_STANDBY_FAILED,
+ XF86_APM_SUSPEND_FAILED
+} pmEvent;
+
+typedef enum {
+ PM_WAIT,
+ PM_CONTINUE,
+ PM_FAILED,
+ PM_NONE
+} pmWait;
+
+/*
+ * The IO access enabler struct. This contains the address for
+ * the IOEnable/IODisable funcs for their specific bus along
+ * with a pointer to data needed by them
+ */
+typedef struct _AccessRec {
+ void (*AccessDisable)(void *arg);
+ void (*AccessEnable)(void *arg);
+ void *arg;
+} xf86AccessRec, *xf86AccessPtr;
+
+typedef struct {
+ xf86AccessPtr mem;
+ xf86AccessPtr io;
+ xf86AccessPtr io_mem;
+} xf86SetAccessFuncRec, *xf86SetAccessFuncPtr;
+
+/* bus-access-related types */
+typedef enum {
+ NONE,
+ IO,
+ MEM_IO,
+ MEM
+} resType;
+
+typedef struct _EntityAccessRec {
+ xf86AccessPtr fallback;
+ xf86AccessPtr pAccess;
+ resType rt;
+ pointer busAcc;
+ struct _EntityAccessRec *next;
+} EntityAccessRec, *EntityAccessPtr;
+
+typedef struct _CurrAccRec {
+ EntityAccessPtr pMemAccess;
+ EntityAccessPtr pIoAccess;
+} xf86CurrentAccessRec, *xf86CurrentAccessPtr;
+
+/* new RAC */
+
+/* Resource Type values */
+#define ResNone ((unsigned long)(-1))
+
+#define ResMem 0x0001
+#define ResIo 0x0002
+#define ResIrq 0x0003
+#define ResDma 0x0004
+#define ResPciCfg 0x000e /* PCI Configuration space */
+#define ResPhysMask 0x000F
+
+#define ResExclusive 0x0010
+#define ResShared 0x0020
+#define ResAny 0x0040
+#define ResAccMask 0x0070
+#define ResUnused 0x0080
+
+#define ResUnusedOpr 0x0100
+#define ResDisableOpr 0x0200
+#define ResOprMask 0x0300
+
+#define ResBlock 0x0400
+#define ResSparse 0x0800
+#define ResExtMask 0x0C00
+
+#define ResEstimated 0x1000
+#define ResInit 0x2000
+#define ResBios 0x4000
+#define ResMiscMask 0xF000
+
+#define ResBus 0x10000
+
+#define ResDomain 0xff000000ul
+#define ResTypeMask (ResPhysMask | ResDomain) /* For conflict check */
+
+#define ResEnd ResNone
+
+#define ResExcMemBlock (ResMem | ResExclusive | ResBlock)
+#define ResExcIoBlock (ResIo | ResExclusive | ResBlock)
+#define ResShrMemBlock (ResMem | ResShared | ResBlock)
+#define ResShrIoBlock (ResIo | ResShared | ResBlock)
+#define ResExcUusdMemBlock (ResMem | ResExclusive | ResUnused | ResBlock)
+#define ResExcUusdIoBlock (ResIo | ResExclusive | ResUnused | ResBlock)
+#define ResShrUusdMemBlock (ResMem | ResShared | ResUnused | ResBlock)
+#define ResShrUusdIoBlock (ResIo | ResShared | ResUnused | ResBlock)
+#define ResExcUusdMemSparse (ResMem | ResExclusive | ResUnused | ResSparse)
+#define ResExcUusdIoSparse (ResIo | ResExclusive | ResUnused | ResSparse)
+#define ResShrUusdMemSparse (ResMem | ResShared | ResUnused | ResSparse)
+#define ResShrUusdIoSparse (ResIo | ResShared | ResUnused | ResSparse)
+
+#define ResExcMemSparse (ResMem | ResExclusive | ResSparse)
+#define ResExcIoSparse (ResIo | ResExclusive | ResSparse)
+#define ResShrMemSparse (ResMem | ResShared | ResSparse)
+#define ResShrIoSparse (ResIo | ResShared | ResSparse)
+#define ResUusdMemSparse (ResMem | ResUnused | ResSparse)
+#define ResUusdIoSparse (ResIo | ResUnused | ResSparse)
+
+#define ResIsMem(r) (((r)->type & ResPhysMask) == ResMem)
+#define ResIsIo(r) (((r)->type & ResPhysMask) == ResIo)
+#define ResIsExclusive(r) (((r)->type & ResAccMask) == ResExclusive)
+#define ResIsShared(r) (((r)->type & ResAccMask) == ResShared)
+#define ResIsUnused(r) (((r)->type & ResAccMask) == ResUnused)
+#define ResIsBlock(r) (((r)->type & ResExtMask) == ResBlock)
+#define ResIsSparse(r) (((r)->type & ResExtMask) == ResSparse)
+#define ResIsEstimated(r) (((r)->type & ResMiscMask) == ResEstimated)
+
+typedef struct {
+ unsigned long type; /* shared, exclusive, unused etc. */
+ memType a;
+ memType b;
+} resRange, *resList;
+
+#define RANGE(r,u,v,t) {\
+ (r).a = (u);\
+ (r).b = (v);\
+ (r).type = (t);\
+ }
+
+#define rBase a
+#define rMask b
+#define rBegin a
+#define rEnd b
+
+/* resource record */
+typedef struct _resRec *resPtr;
+typedef struct _resRec {
+ resRange val;
+ int entityIndex; /* who owns the resource */
+ resPtr next;
+} resRec;
+
+#define sparse_base val.rBase
+#define sparse_mask val.rMask
+#define block_begin val.rBegin
+#define block_end val.rEnd
+#define res_type val.type
+
+typedef struct {
+ int numChipset;
+ resRange *resList;
+} IsaChipsets;
+
+typedef struct {
+ int numChipset;
+ int PCIid;
+ resRange *resList;
+} PciChipsets;
+
+/* Entity properties */
+typedef void (*EntityProc)(int entityIndex,pointer private);
+
+typedef struct _entityInfo {
+ int index;
+ BusRec location;
+ int chipset;
+ Bool active;
+ resPtr resources;
+ GDevPtr device;
+ DriverPtr driver;
+} EntityInfoRec, *EntityInfoPtr;
+
+/* server states */
+
+typedef enum {
+ SETUP,
+ OPERATING
+} xf86State;
+
+typedef enum {
+ NOTIFY_SETUP_TRANSITION,
+ NOTIFY_SETUP,
+ NOTIFY_OPERATING,
+ NOTIFY_OPERATING_TRANSITION,
+ NOTIFY_ENABLE,
+ NOTIFY_ENTER,
+ NOTIFY_LEAVE
+} xf86NotifyState;
+
+typedef void (*xf86StateChangeNotificationCallbackFunc)(xf86NotifyState state,pointer);
+
+/* DGA */
+
+typedef struct {
+ int num; /* A unique identifier for the mode (num > 0) */
+ DisplayModePtr mode;
+ int flags; /* DGA_CONCURRENT_ACCESS, etc... */
+ int imageWidth; /* linear accessible portion (pixels) */
+ int imageHeight;
+ int pixmapWidth; /* Xlib accessible portion (pixels) */
+ int pixmapHeight; /* both fields ignored if no concurrent access */
+ int bytesPerScanline;
+ int byteOrder; /* MSBFirst, LSBFirst */
+ int depth;
+ int bitsPerPixel;
+ unsigned long red_mask;
+ unsigned long green_mask;
+ unsigned long blue_mask;
+ short visualClass;
+ int viewportWidth;
+ int viewportHeight;
+ int xViewportStep; /* viewport position granularity */
+ int yViewportStep;
+ int maxViewportX; /* max viewport origin */
+ int maxViewportY;
+ int viewportFlags; /* types of page flipping possible */
+ int offset; /* offset into physical memory */
+ unsigned char *address; /* server's mapped framebuffer */
+ int reserved1;
+ int reserved2;
+} DGAModeRec, *DGAModePtr;
+
+typedef struct {
+ DGAModePtr mode;
+ PixmapPtr pPix;
+} DGADeviceRec, *DGADevicePtr;
+
+/*
+ * Flags for driver Probe() functions.
+ */
+#define PROBE_DEFAULT 0x00
+#define PROBE_DETECT 0x01
+#define PROBE_TRYHARD 0x02
+
+/*
+ * Driver entry point types
+ */
+typedef struct _ScrnInfoRec *ScrnInfoPtr;
+
+typedef Bool xf86ProbeProc (DriverPtr, int);
+typedef Bool xf86PreInitProc (ScrnInfoPtr, int);
+typedef Bool xf86ScreenInitProc (int, ScreenPtr, int, char**);
+typedef Bool xf86SwitchModeProc (int, DisplayModePtr, int);
+typedef void xf86AdjustFrameProc (int, int, int, int);
+typedef Bool xf86EnterVTProc (int, int);
+typedef void xf86LeaveVTProc (int, int);
+typedef void xf86FreeScreenProc (int, int);
+typedef int xf86ValidModeProc (int, DisplayModePtr, Bool, int);
+typedef void xf86EnableDisableFBAccessProc(int, Bool);
+typedef int xf86SetDGAModeProc (int, int, DGADevicePtr);
+typedef int xf86ChangeGammaProc (int, Gamma);
+typedef void xf86PointerMovedProc (int, int, int);
+typedef Bool xf86PMEventProc (int, pmEvent, Bool);
+
+/*
+ * ScrnInfoRec
+ *
+ * There is one of these for each screen, and it holds all the screen-specific
+ * information.
+ *
+ * Note: the size and layout must be kept the same across versions. New
+ * fields are to be added in place of the "reserved*" fields. No fields
+ * are to be dependent on compile-time defines.
+ */
+
+
+typedef struct _ScrnInfoRec {
+ int driverVersion;
+ char * driverName; /* canonical name used in */
+ /* the config file */
+ ScreenPtr pScreen; /* Pointer to the ScreenRec */
+ int scrnIndex; /* Number of this screen */
+ Bool configured; /* Is this screen valid */
+ int origIndex; /* initial number assigned to
+ * this screen before
+ * finalising the number of
+ * available screens */
+
+ /* Display-wide screenInfo values needed by this screen */
+ int imageByteOrder;
+ int bitmapScanlineUnit;
+ int bitmapScanlinePad;
+ int bitmapBitOrder;
+ int numFormats;
+ PixmapFormatRec formats[MAXFORMATS];
+ PixmapFormatRec fbFormat;
+
+ int bitsPerPixel; /* fb bpp */
+ Pix24Flags pixmap24; /* pixmap pref for depth 24 */
+ int depth; /* depth of default visual */
+ MessageType depthFrom; /* set from config? */
+ MessageType bitsPerPixelFrom; /* set from config? */
+ rgb weight; /* r/g/b weights */
+ rgb mask; /* rgb masks */
+ rgb offset; /* rgb offsets */
+ int rgbBits; /* Number of bits in r/g/b */
+ Gamma gamma; /* Gamma of the monitor */
+ int defaultVisual; /* default visual class */
+ int maxHValue; /* max horizontal timing */
+ int maxVValue; /* max vertical timing value */
+ int virtualX; /* Virtual width */
+ int virtualY; /* Virtual height */
+ int xInc; /* Horizontal timing increment */
+ MessageType virtualFrom; /* set from config? */
+ int displayWidth; /* memory pitch */
+ int frameX0; /* viewport position */
+ int frameY0;
+ int frameX1;
+ int frameY1;
+ int zoomLocked; /* Disallow mode changes */
+ DisplayModePtr modePool; /* list of compatible modes */
+ DisplayModePtr modes; /* list of actual modes */
+ DisplayModePtr currentMode; /* current mode
+ * This was previously
+ * overloaded with the modes
+ * field, which is a pointer
+ * into a circular list */
+ confScreenPtr confScreen; /* Screen config info */
+ MonPtr monitor; /* Monitor information */
+ DispPtr display; /* Display information */
+ int * entityList; /* List of device entities */
+ int numEntities;
+ int widthmm; /* physical display dimensions
+ * in mm */
+ int heightmm;
+ int xDpi; /* width DPI */
+ int yDpi; /* height DPI */
+ char * name; /* Name to prefix messages */
+ pointer driverPrivate; /* Driver private area */
+ DevUnion * privates; /* Other privates can hook in
+ * here */
+ DriverPtr drv; /* xf86DriverList[] entry */
+ pointer module; /* Pointer to module head */
+ int colorKey;
+ int overlayFlags;
+
+ /* Some of these may be moved out of here into the driver private area */
+
+ char * chipset; /* chipset name */
+ char * ramdac; /* ramdac name */
+ char * clockchip; /* clock name */
+ Bool progClock; /* clock is programmable */
+ int numClocks; /* number of clocks */
+ int clock[MAXCLOCKS]; /* list of clock frequencies */
+ int videoRam; /* amount of video ram (kb) */
+ unsigned long biosBase; /* Base address of video BIOS */
+ unsigned long memPhysBase; /* Physical address of FB */
+ unsigned long fbOffset; /* Offset of FB in the above */
+ unsigned long ioBase; /* I/O or MMIO base adderss */
+ int memClk; /* memory clock */
+ int textClockFreq; /* clock of text mode */
+ Bool flipPixels; /* swap default black/white */
+ pointer options;
+
+ int chipID;
+ int chipRev;
+ int racMemFlags;
+ int racIoFlags;
+ pointer access;
+ xf86CurrentAccessPtr CurrentAccess;
+ resType resourceType;
+ pointer busAccess;
+
+ /* Allow screens to be enabled/disabled individually */
+ Bool vtSema;
+ DevUnion pixmapPrivate; /* saved devPrivate from pixmap */
+
+ /* hw cursor moves at SIGIO time */
+ Bool silkenMouse;
+
+ /* Storage for clockRanges and adjustFlags for use with the VidMode ext */
+ ClockRangesPtr clockRanges;
+ int adjustFlags;
+
+ /*
+ * These can be used when the minor ABI version is incremented.
+ * The NUM_* parameters must be reduced appropriately to keep the
+ * structure size and alignment unchanged.
+ */
+ int reservedInt[NUM_RESERVED_INTS];
+
+ int * entityInstanceList;
+ pointer reservedPtr[NUM_RESERVED_POINTERS];
+
+ /*
+ * Driver entry points.
+ *
+ */
+
+ xf86ProbeProc *Probe;
+ xf86PreInitProc *PreInit;
+ xf86ScreenInitProc *ScreenInit;
+ xf86SwitchModeProc *SwitchMode;
+ xf86AdjustFrameProc *AdjustFrame;
+ xf86EnterVTProc *EnterVT;
+ xf86LeaveVTProc *LeaveVT;
+ xf86FreeScreenProc *FreeScreen;
+ xf86ValidModeProc *ValidMode;
+ xf86EnableDisableFBAccessProc *EnableDisableFBAccess;
+ xf86SetDGAModeProc *SetDGAMode;
+ xf86ChangeGammaProc *ChangeGamma;
+ xf86PointerMovedProc *PointerMoved;
+ xf86PMEventProc *PMEvent;
+
+ /*
+ * This can be used when the minor ABI version is incremented.
+ * The NUM_* parameter must be reduced appropriately to keep the
+ * structure size and alignment unchanged.
+ */
+ funcPointer reservedFuncs[NUM_RESERVED_FUNCS];
+
+} ScrnInfoRec;
+
+
+typedef struct {
+ Bool (*OpenFramebuffer)(
+ ScrnInfoPtr pScrn,
+ char **name,
+ unsigned char **mem,
+ int *size,
+ int *offset,
+ int *extra
+ );
+ void (*CloseFramebuffer)(ScrnInfoPtr pScrn);
+ Bool (*SetMode)(ScrnInfoPtr pScrn, DGAModePtr pMode);
+ void (*SetViewport)(ScrnInfoPtr pScrn, int x, int y, int flags);
+ int (*GetViewport)(ScrnInfoPtr pScrn);
+ void (*Sync)(ScrnInfoPtr);
+ void (*FillRect)(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned long color
+ );
+ void (*BlitRect)(
+ ScrnInfoPtr pScrn,
+ int srcx, int srcy,
+ int w, int h,
+ int dstx, int dsty
+ );
+ void (*BlitTransRect)(
+ ScrnInfoPtr pScrn,
+ int srcx, int srcy,
+ int w, int h,
+ int dstx, int dsty,
+ unsigned long color
+ );
+} DGAFunctionRec, *DGAFunctionPtr;
+
+typedef struct {
+ int token; /* id of the token */
+ const char * name; /* token name */
+} SymTabRec, *SymTabPtr;
+
+/* flags for xf86LookupMode */
+typedef enum {
+ LOOKUP_DEFAULT = 0, /* Use default mode lookup method */
+ LOOKUP_BEST_REFRESH, /* Pick modes with best refresh */
+ LOOKUP_CLOSEST_CLOCK, /* Pick modes with the closest clock */
+ LOOKUP_LIST_ORDER, /* Pick first useful mode in list */
+ LOOKUP_CLKDIV2 = 0x0100, /* Allow half clocks */
+ LOOKUP_OPTIONAL_TOLERANCES = 0x0200 /* Allow missing hsync/vrefresh */
+} LookupModeFlags;
+
+#define NoDepth24Support 0x00
+#define Support24bppFb 0x01 /* 24bpp framebuffer supported */
+#define Support32bppFb 0x02 /* 32bpp framebuffer supported */
+#define SupportConvert24to32 0x04 /* Can convert 24bpp pixmap to 32bpp */
+#define SupportConvert32to24 0x08 /* Can convert 32bpp pixmap to 24bpp */
+#define PreferConvert24to32 0x10 /* prefer 24bpp pixmap to 32bpp conv */
+#define PreferConvert32to24 0x20 /* prefer 32bpp pixmap to 24bpp conv */
+
+
+/* For DPMS */
+typedef void (*DPMSSetProcPtr)(ScrnInfoPtr, int, int);
+
+/* Input handler proc */
+typedef void (*InputHandlerProc)(int fd, pointer data);
+
+/* These are used by xf86GetClocks */
+#define CLK_REG_SAVE -1
+#define CLK_REG_RESTORE -2
+
+/* xf86Debug.c */
+#ifdef BUILDDEBUG
+typedef struct {
+ long sec;
+ long usec;
+} xf86TsRec, *xf86TsPtr;
+#endif
+
+/*
+ * misc constants
+ */
+#define INTERLACE_REFRESH_WEIGHT 1.5
+#define SYNC_TOLERANCE 0.01 /* 1 percent */
+#define CLOCK_TOLERANCE 2000 /* Clock matching tolerance (2MHz) */
+
+
+#define OVERLAY_8_32_DUALFB 0x00000001
+#define OVERLAY_8_24_DUALFB 0x00000002
+#define OVERLAY_8_16_DUALFB 0x00000004
+#define OVERLAY_8_32_PLANAR 0x00000008
+
+#if 0
+#define LD_RESOLV_IFDONE 0 /* only check if no more
+ delays pending */
+#define LD_RESOLV_NOW 1 /* finish one delay step */
+#define LD_RESOLV_FORCE 2 /* force checking... */
+#endif
+
+#endif /* _XF86STR_H */
diff --git a/Xincludes/xc/programs/Xserver/hw/xfree86/common/xisb.h b/Xincludes/xc/programs/Xserver/hw/xfree86/common/xisb.h
new file mode 100644
index 0000000..39ae2ee
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/hw/xfree86/common/xisb.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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 Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+/* $XFree86$ */
+
+#ifndef _xisb_H_
+#define _xisb_H_
+
+/******************************************************************************
+ * Definitions
+ * structs, typedefs, #defines, enums
+ *****************************************************************************/
+
+typedef struct _XISBuffer
+{
+ int fd;
+ int trace;
+ int block_duration;
+ xf86ssize_t current; /* bytes read */
+ xf86ssize_t end;
+ xf86ssize_t buffer_size;
+ unsigned char *buf;
+} XISBuffer;
+
+/******************************************************************************
+ * Declarations
+ * variables: use xisb_LOC in front
+ * of globals.
+ * put locals in the .c file.
+ *****************************************************************************/
+XISBuffer * XisbNew (int fd, xf86ssize_t size);
+void XisbFree (XISBuffer *b);
+int XisbRead (XISBuffer *b);
+xf86ssize_t XisbWrite (XISBuffer *b, unsigned char *msg, xf86ssize_t len);
+void XisbTrace (XISBuffer *b, int trace);
+void XisbBlockDuration (XISBuffer *b, int block_duration);
+
+/*
+ * DO NOT PUT ANYTHING AFTER THIS ENDIF
+ */
+#endif
diff --git a/Xincludes/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h b/Xincludes/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h
new file mode 100644
index 0000000..796e527
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h
@@ -0,0 +1,266 @@
+/*
+ * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
+ * Copyright 1992 by David Dawes <dawes@XFree86.org>
+ * Copyright 1992 by Jim Tsillas <jtsilla@damon.ccs.northeastern.edu>
+ * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
+ * Copyright 1992 by Robert Baron <Robert.Baron@ernst.mach.cs.cmu.edu>
+ * Copyright 1992 by Orest Zborowski <obz@eskimo.com>
+ * Copyright 1993 by Vrije Universiteit, The Netherlands
+ * Copyright 1993 by David Wexelblat <dwex@XFree86.org>
+ * Copyright 1994, 1996 by Holger Veit <Holger.Veit@gmd.de>
+ * Copyright 1994-1999 by The XFree86 Project, Inc
+ *
+ * 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 holders
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. The above listed
+ * copyright holders make 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 HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDERS 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.
+ *
+ */
+
+/*
+ * The ARM32 code here carries the following copyright:
+ *
+ * Copyright 1997
+ * Digital Equipment Corporation. All rights reserved.
+ * This software is furnished under license and may be used and copied only in
+ * accordance with the following terms and conditions. Subject to these
+ * conditions, you may download, copy, install, use, modify and distribute
+ * this software in source and/or binary form. No title or ownership is
+ * transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce and retain
+ * this copyright notice and list of conditions as they appear in the
+ * source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or logo of Digital
+ * Equipment Corporation. Neither the "Digital Equipment Corporation"
+ * name nor any trademark or logo of Digital Equipment Corporation may be
+ * used to endorse or promote products derived from this software without
+ * the prior written permission of Digital Equipment Corporation.
+ *
+ * 3) This software is provided "AS-IS" and any express or implied warranties,
+ * including but not limited to, any implied warranties of merchantability,
+ * fitness for a particular purpose, or non-infringement are disclaimed.
+ * In no event shall DIGITAL be liable for any damages whatsoever, and in
+ * particular, DIGITAL shall not be liable for special, indirect,
+ * consequential, or incidental damages or damages for lost profits, loss
+ * of revenue or loss of use, whether such damages arise in contract,
+ * negligence, tort, under statute, in equity, at law or otherwise, even
+ * if advised of the possibility of such damage.
+ *
+ */
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h,v 3.52 2001/05/19 00:26:45 dawes Exp $ */
+
+#ifndef _XF86_OSPROC_H
+#define _XF86_OSPROC_H
+
+#ifdef XF86_OS_PRIVS
+#include "xf86Pci.h"
+#endif
+
+/*
+ * The actual prototypes have been pulled into this seperate file so
+ * that they can can be used without pulling in all of the OS specific
+ * stuff like sys/stat.h, etc. This casues problem for loadable modules.
+ */
+
+/*
+ * Flags for xf86MapVidMem(). Multiple flags can be or'd together. The
+ * flags may be used as hints. For example it would be permissible to
+ * enable write combining for memory marked only for framebuffer use.
+ */
+
+#define VIDMEM_FRAMEBUFFER 0x01 /* memory for framebuffer use */
+#define VIDMEM_MMIO 0x02 /* memory for I/O use */
+#define VIDMEM_MMIO_32BIT 0x04 /* memory accesses >= 32bit */
+#define VIDMEM_READSIDEEFFECT 0x08 /* reads can have side-effects */
+#define VIDMEM_SPARSE 0x10 /* sparse mapping required
+ * assumed when VIDMEM_MMIO is
+ * set. May be used with
+ * VIDMEM_FRAMEBUFFER) */
+#define VIDMEM_READONLY 0x20 /* read-only mapping
+ * used when reading BIOS images
+ * through xf86MapVidMem() */
+
+/*
+ * OS-independent modem state flags for xf86SetSerialModemState() and
+ * xf86GetSerialModemState().
+ */
+#define XF86_M_LE 0x001 /* line enable */
+#define XF86_M_DTR 0x002 /* data terminal ready */
+#define XF86_M_RTS 0x004 /* request to send */
+#define XF86_M_ST 0x008 /* secondary transmit */
+#define XF86_M_SR 0x010 /* secondary receive */
+#define XF86_M_CTS 0x020 /* clear to send */
+#define XF86_M_CAR 0x040 /* carrier detect */
+#define XF86_M_RNG 0x080 /* ring */
+#define XF86_M_DSR 0x100 /* data set ready */
+
+#ifdef XF86_OS_PRIVS
+extern void xf86WrapperInit(void);
+#endif
+
+#ifndef NO_OSLIB_PROTOTYPES
+/*
+ * This is to prevent re-entrancy to FatalError() when aborting.
+ * Anything that can be called as a result of AbortDDX() should use this
+ * instead of FatalError().
+ */
+
+#define xf86FatalError(a, b) \
+ if (dispatchException & DE_TERMINATE) { \
+ ErrorF(a, b); \
+ return; \
+ } else FatalError(a, b)
+
+/***************************************************************************/
+/* Prototypes */
+/***************************************************************************/
+
+#include <X11/Xfuncproto.h>
+#include "opaque.h"
+
+_XFUNCPROTOBEGIN
+
+/* public functions */
+extern Bool xf86LinearVidMem(void);
+extern Bool xf86CheckMTRR(int);
+extern pointer xf86MapVidMem(int, int, unsigned long, unsigned long);
+extern void xf86UnMapVidMem(int, pointer, unsigned long);
+extern void xf86MapReadSideEffects(int, int, pointer, unsigned long);
+extern int xf86ReadBIOS(unsigned long, unsigned long, unsigned char *, int);
+extern void xf86EnableIO(void);
+extern void xf86DisableIO(void);
+extern Bool xf86DisableInterrupts(void);
+extern void xf86EnableInterrupts(void);
+extern void xf86SetTVOut(int);
+extern void xf86SetRGBOut(void);
+extern void xf86SoundKbdBell(int, int, int);
+#if defined(QNX4)
+#pragma aux xf86BusToMem modify [eax ebx ecx edx esi edi];
+#pragma aux xf86MemToBus modify [eax ebx ecx edx esi edi];
+#endif
+extern void xf86BusToMem(unsigned char *, unsigned char *, int);
+extern void xf86MemToBus(unsigned char *, unsigned char *, int);
+extern void xf86IODelay(void);
+extern void xf86UDelay(long usec);
+extern void xf86SlowBcopy(unsigned char *, unsigned char *, int);
+extern int xf86OpenSerial(pointer options);
+extern int xf86SetSerial(int fd, pointer options);
+extern int xf86SetSerialSpeed(int fd, int speed);
+extern int xf86ReadSerial(int fd, void *buf, int count);
+extern int xf86WriteSerial(int fd, const void *buf, int count);
+extern int xf86CloseSerial(int fd);
+extern int xf86FlushInput(int fd);
+extern int xf86WaitForInput(int fd, int timeout);
+extern int xf86SerialSendBreak(int fd, int duration);
+extern int xf86SetSerialModemState(int fd, int state);
+extern int xf86GetSerialModemState(int fd);
+extern int xf86SerialModemSetBits(int fd, int bits);
+extern int xf86SerialModemClearBits(int fd, int bits);
+extern int xf86LoadKernelModule(const char *pathname);
+
+/* AGP GART interface */
+
+typedef struct _AgpInfo {
+ CARD32 bridgeId;
+ CARD32 agpMode;
+ unsigned long base;
+ unsigned long size;
+ unsigned long totalPages;
+ unsigned long systemPages;
+ unsigned long usedPages;
+} AgpInfo, *AgpInfoPtr;
+
+extern Bool xf86AgpGARTSupported(void);
+extern AgpInfoPtr xf86GetAGPInfo(int screenNum);
+extern Bool xf86AcquireGART(int screenNum);
+extern Bool xf86ReleaseGART(int screenNum);
+extern int xf86AllocateGARTMemory(int screenNum, unsigned long size, int type,
+ unsigned long *physical);
+extern Bool xf86BindGARTMemory(int screenNum, int key, unsigned long offset);
+extern Bool xf86UnbindGARTMemory(int screenNum, int key);
+extern Bool xf86EnableAGP(int screenNum, CARD32 mode);
+extern Bool xf86GARTCloseScreen(int screenNum);
+
+/* These routines are in shared/sigio.c and are not loaded as part of the
+ module. These routines are small, and the code if very POSIX-signal (or
+ OS-signal) specific, so it seemed better to provide more complex
+ wrappers than to wrap each individual function called. */
+extern int xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *);
+extern int xf86RemoveSIGIOHandler(int fd);
+extern int xf86BlockSIGIO (void);
+extern void xf86UnblockSIGIO (int);
+#ifdef XFree86Server
+extern void xf86AssertBlockedSIGIO (char *);
+#endif
+extern Bool xf86SIGIOSupported (void);
+
+#ifdef XF86_OS_PRIVS
+typedef void (*PMClose)(void);
+extern void xf86OpenConsole(void);
+extern void xf86CloseConsole(void);
+extern Bool xf86VTSwitchPending(void);
+extern Bool xf86VTSwitchAway(void);
+extern Bool xf86VTSwitchTo(void);
+extern void xf86VTRequest(int sig);
+extern int xf86ProcessArgument(int, char **, int);
+extern void xf86UseMsg(void);
+extern void xf86SetKbdLeds(int);
+extern int xf86GetKbdLeds(void);
+extern void xf86SetKbdRepeat(char);
+extern void xf86KbdInit(void);
+extern int xf86KbdOn(void);
+extern int xf86KbdOff(void);
+extern void xf86KbdEvents(void);
+#ifdef XQUEUE
+extern int xf86XqueKbdProc(DeviceIntPtr, int);
+extern void xf86XqueEvents(void);
+#endif
+#ifdef WSCONS_SUPPORT
+extern void xf86WSKbdEvents(void);
+#endif
+extern PMClose xf86OSPMOpen(void);
+
+#ifdef NEED_OS_RAC_PROTOS
+/* RAC-related privs */
+/* internal to os-support layer */
+resPtr xf86StdBusAccWindowsFromOS(void);
+resPtr xf86StdPciAccWindowsFromOS(void);
+resPtr xf86StdIsaAccWindowsFromOS(void);
+resPtr xf86StdAccResFromOS(resPtr ret);
+
+/* available to the common layer */
+resPtr xf86BusAccWindowsFromOS(void);
+resPtr xf86PciBusAccWindowsFromOS(void);
+resPtr xf86IsaBusAccWindowsFromOS(void);
+resPtr xf86AccResFromOS(resPtr ret);
+#endif /* NEED_OS_RAC_PROTOS */
+
+extern Bool xf86GetPciSizeFromOS(PCITAG tag, int indx, int* bits);
+
+extern void xf86MakeNewMapping(int, int, unsigned long, unsigned long, pointer);
+extern void xf86InitVidMem(void);
+
+#endif /* XF86_OS_PRIVS */
+
+
+_XFUNCPROTOEND
+#endif /* NO_OSLIB_PROTOTYPES */
+
+#endif /* _XF86_OSPROC_H */
diff --git a/Xincludes/xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h b/Xincludes/xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h
new file mode 100644
index 0000000..a9166de
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h
@@ -0,0 +1,342 @@
+/*
+ * Copyright 1997-2000 by The XFree86 Project, Inc
+ *
+ * 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 holders
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. The above listed
+ * copyright holders make 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 HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDERS 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/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h,v 3.47 2001/05/18 20:22:30 tsi Exp $ */
+
+#ifndef _XF86_ANSIC_H
+#define _XF86_ANSIC_H
+
+/* Handle <stdarg.h> */
+
+#ifndef IN_MODULE
+# include <stdarg.h>
+#else /* !IN_MODULE */
+# ifndef __OS2ELF__
+# include <stdarg.h>
+# else /* __OS2ELF__ */
+ /* EMX/gcc_elf under OS/2 does not have native header files */
+# if !defined (_VA_LIST)
+# define _VA_LIST
+ typedef char *va_list;
+# endif
+# define _VA_ROUND(t) ((sizeof (t) + 3) & -4)
+# if !defined (va_start)
+# define va_start(ap,v) ap = (va_list)&v + ((sizeof (v) + 3) & -4)
+# define va_end(ap) (ap = 0, (void)0)
+# define va_arg(ap,t) (ap += _VA_ROUND (t), *(t *)(ap - _VA_ROUND (t)))
+# endif
+# endif /* __OS2ELF__ */
+#endif /* IN_MODULE */
+
+/*
+ * The first set of definitions are required both for modules and
+ * libc_wrapper.c.
+ */
+
+#if defined(XFree86LOADER) || defined(NEED_XF86_TYPES)
+
+#if !defined(SYSV) && !defined(SVR4) && !defined(Lynx) || defined(SCO)
+#define HAVE_VSSCANF
+#define HAVE_VFSCANF
+#endif
+
+#ifndef NULL
+#if (defined(SVR4) || defined(SYSV)) && !defined(__GNUC__)
+#define NULL 0
+#else
+#define NULL ((void *)0)
+#endif
+#endif
+#ifndef EOF
+#define EOF (-1)
+#endif
+
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
+/* <limits.h> stuff */
+#define x_BITSPERBYTE 8
+#define x_BITS(type) (x_BITSPERBYTE * (int)sizeof(type))
+#define x_SHORTBITS x_BITS(short)
+#define x_INTBITS x_BITS(int)
+#define x_LONGBITS x_BITS(long)
+#ifndef SHRT_MIN
+#define SHRT_MIN ((short)(1 << (x_SHORTBITS - 1)))
+#endif
+
+#ifndef FONTMODULE
+#include "misc.h"
+#endif
+#include "xf86_libc.h"
+#ifndef SHRT_MAX
+#define SHRT_MAX ((short)~SHRT_MIN)
+#endif
+#ifndef USHRT_MAX
+#define USHRT_MAX ((unsigned short)~0)
+#endif
+#ifndef MINSHORT
+#define MINSHORT SHRT_MIN
+#endif
+#ifndef MAXSHORT
+#define MAXSHORT SHRT_MAX
+#endif
+#ifndef INT_MIN
+#define INT_MIN (1 << (x_INTBITS - 1))
+#endif
+#ifndef INT_MAX
+#define INT_MAX (~INT_MIN)
+#endif
+#ifndef UINT_MAX
+#define UINT_MAX (~0)
+#endif
+#ifndef MININT
+#define MININT INT_MIN
+#endif
+#ifndef MAXINT
+#define MAXINT INT_MAX
+#endif
+#ifndef LONG_MIN
+#define LONG_MIN ((long)(1 << (x_LONGBITS - 1)))
+#endif
+#ifndef LONG_MAX
+#define LONG_MAX ((long)~LONG_MIN)
+#endif
+#ifndef ULONG_MAX
+#define ULONG_MAX ((unsigned long)~0UL)
+#endif
+#ifndef MINLONG
+#define MINLONG LONG_MIN
+#endif
+#ifndef MAXLONG
+#define MAXLONG LONG_MAX
+#endif
+
+#endif /* XFree86LOADER || NEED_XF86_TYPES */
+
+#if defined(XFree86LOADER) || defined(NEED_XF86_PROTOTYPES)
+/*
+ * ANSI C compilers only.
+ */
+
+/* ANSI C emulation library */
+
+extern void xf86abort(void);
+extern int xf86abs(int);
+extern double xf86acos(double);
+extern double xf86asin(double);
+extern double xf86atan(double);
+extern double xf86atan2(double,double);
+extern double xf86atof(const char*);
+extern int xf86atoi(const char*);
+extern long xf86atol(const char*);
+extern void *xf86bsearch(const void *, const void *, xf86size_t, xf86size_t,
+ int (*)(const void *, const void *));
+extern double xf86ceil(double);
+extern void* xf86calloc(xf86size_t,xf86size_t);
+extern void xf86clearerr(XF86FILE*);
+extern double xf86cos(double);
+extern void xf86exit(int);
+extern double xf86exp(double);
+extern double xf86fabs(double);
+extern int xf86fclose(XF86FILE*);
+extern int xf86feof(XF86FILE*);
+extern int xf86ferror(XF86FILE*);
+extern int xf86fflush(XF86FILE*);
+extern int xf86fgetc(XF86FILE*);
+extern int xf86getc(XF86FILE*);
+extern int xf86fgetpos(XF86FILE*,XF86fpos_t*);
+extern char* xf86fgets(char*,INT32,XF86FILE*);
+extern int xf86finite(double);
+extern double xf86floor(double);
+extern double xf86fmod(double,double);
+extern XF86FILE* xf86fopen(const char*,const char*);
+extern double xf86frexp(double, int*);
+extern int xf86printf(const char*,...);
+extern int xf86fprintf(XF86FILE*,const char*,...);
+extern int xf86fputc(int,XF86FILE*);
+extern int xf86fputs(const char*,XF86FILE*);
+extern xf86size_t xf86fread(void*,xf86size_t,xf86size_t,XF86FILE*);
+extern void xf86free(void*);
+extern XF86FILE* xf86freopen(const char*,const char*,XF86FILE*);
+#if defined(HAVE_VFSCANF) || !defined(NEED_XF86_PROTOTYPES)
+extern int xf86fscanf(XF86FILE*,const char*,...);
+#else
+extern int xf86fscanf(/*XF86FILE*,const char*,char *,char *,char *,char *,
+ char *,char *,char *,char *,char *,char * */);
+#endif
+extern int xf86fseek(XF86FILE*,long,int);
+extern int xf86fsetpos(XF86FILE*,const XF86fpos_t*);
+extern long xf86ftell(XF86FILE*);
+extern xf86size_t xf86fwrite(const void*,xf86size_t,xf86size_t,XF86FILE*);
+extern char* xf86getenv(const char*);
+extern int xf86isalnum(int);
+extern int xf86isalpha(int);
+extern int xf86iscntrl(int);
+extern int xf86isdigit(int);
+extern int xf86isgraph(int);
+extern int xf86islower(int);
+extern int xf86isprint(int);
+extern int xf86ispunct(int);
+extern int xf86isspace(int);
+extern int xf86isupper(int);
+extern int xf86isxdigit(int);
+extern long xf86labs(long);
+extern double xf86ldexp(double,int);
+extern double xf86log(double);
+extern double xf86log10(double);
+extern void* xf86malloc(xf86size_t);
+extern void* xf86memchr(const void*,int,xf86size_t);
+extern int xf86memcmp(const void*,const void*,xf86size_t);
+extern void* xf86memcpy(void*,const void*,xf86size_t);
+extern void* xf86memmove(void*,const void*,xf86size_t);
+extern void* xf86memset(void*,int,xf86size_t);
+extern double xf86modf(double,double*);
+extern void xf86perror(const char*);
+extern double xf86pow(double,double);
+extern void xf86qsort(void*, xf86size_t, xf86size_t,
+ int(*)(const void*, const void*));
+extern void* xf86realloc(void*,xf86size_t);
+extern int xf86remove(const char*);
+extern int xf86rename(const char*,const char*);
+extern void xf86rewind(XF86FILE*);
+extern int xf86setbuf(XF86FILE*,char*);
+extern int xf86setvbuf(XF86FILE*,char*,int,xf86size_t);
+extern double xf86sin(double);
+extern int xf86sprintf(char*,const char*,...);
+extern int xf86snprintf(char*,xf86size_t,const char*,...);
+extern double xf86sqrt(double);
+#if defined(HAVE_VSSCANF) || !defined(NEED_XF86_PROTOTYPES)
+extern int xf86sscanf(char*,const char*,...);
+#else
+extern int xf86sscanf(/*char*,const char*,char *,char *,char *,char *,
+ char *,char *,char *,char *,char *,char * */);
+#endif
+extern char* xf86strcat(char*,const char*);
+extern char* xf86strchr(const char*, int c);
+extern int xf86strcmp(const char*,const char*);
+extern int xf86strcasecmp(const char*,const char*);
+extern char* xf86strcpy(char*,const char*);
+extern xf86size_t xf86strcspn(const char*,const char*);
+extern char* xf86strerror(int);
+extern xf86size_t xf86strlen(const char*);
+extern char* xf86strncat(char *, const char *, xf86size_t);
+extern int xf86strncmp(const char*,const char*,xf86size_t);
+extern int xf86strncasecmp(const char*,const char*,xf86size_t);
+extern char* xf86strncpy(char*,const char*,xf86size_t);
+extern char* xf86strpbrk(const char*,const char*);
+extern char* xf86strrchr(const char*,int);
+extern xf86size_t xf86strspn(const char*,const char*);
+extern char* xf86strstr(const char*,const char*);
+extern double xf86strtod(const char*,char**);
+extern char* xf86strtok(char*,const char*);
+extern long xf86strtol(const char*,char**,int);
+extern unsigned long xf86strtoul(const char*,char**,int);
+extern double xf86tan(double);
+extern XF86FILE* xf86tmpfile(void);
+extern char* xf86tmpnam(char*);
+extern int xf86tolower(int);
+extern int xf86toupper(int);
+extern int xf86ungetc(int,XF86FILE*);
+extern int xf86vfprintf(XF86FILE*,const char*,va_list);
+extern int xf86vsprintf(char*,const char*,va_list);
+extern int xf86vsnprintf(char*,xf86size_t,const char*,va_list);
+
+extern int xf86open(const char*, int,...);
+extern int xf86close(int);
+extern long xf86lseek(int, long, int);
+extern int xf86ioctl(int, unsigned long, pointer);
+extern xf86ssize_t xf86read(int, void *, xf86size_t);
+extern xf86ssize_t xf86write(int, const void *, xf86size_t);
+extern void* xf86mmap(void*, xf86size_t, int, int, int, xf86size_t /* off_t */);
+extern int xf86munmap(void*, xf86size_t);
+extern int xf86stat(const char *, struct xf86stat *);
+extern int xf86fstat(int, struct xf86stat *);
+extern int xf86access(const char *, int);
+extern int xf86errno;
+extern int xf86GetErrno(void);
+
+extern double xf86HUGE_VAL;
+
+extern double xf86hypot(double,double);
+
+/* non-ANSI C functions */
+extern XF86DIR* xf86opendir(const char*);
+extern int xf86closedir(XF86DIR*);
+extern XF86DIRENT* xf86readdir(XF86DIR*);
+extern void xf86rewinddir(XF86DIR*);
+extern void xf86bcopy(const void*,void*,xf86size_t);
+extern int xf86ffs(int);
+extern char* xf86strdup(const char*);
+extern void xf86bzero(void*,unsigned int);
+extern int xf86execl(const char *, const char *, ...);
+extern long xf86fpossize(void);
+extern int xf86chmod(const char *, xf86mode_t);
+extern int xf86chown(const char *, xf86uid_t, xf86gid_t);
+extern xf86uid_t xf86geteuid(void);
+extern xf86gid_t xf86getegid(void);
+extern int xf86getpid(void);
+extern int xf86mknod(const char *, xf86mode_t, xf86dev_t);
+extern int xf86mkdir(const char *, xf86mode_t);
+unsigned int xf86sleep(unsigned int seconds);
+/* sysv IPC */
+extern int xf86shmget(xf86key_t key, int size, int xf86shmflg);
+extern char * xf86shmat(int id, char *addr, int xf86shmflg);
+extern int xf86shmdt(char *addr);
+extern int xf86shmctl(int id, int xf86cmd, pointer buf);
+extern int xf86setjmp(xf86jmp_buf env);
+extern void xf86longjmp(xf86jmp_buf env, int val);
+
+#else /* XFree86LOADER || NEED_XF86_PROTOTYPES */
+#include <unistd.h>
+#include <stdio.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <ctype.h>
+#ifdef HAVE_SYSV_IPC
+#include <sys/ipc.h>
+#include <sys/shm.h>
+#endif
+#include <sys/stat.h>
+#define stat_t struct stat
+#endif /* XFree86LOADER || NEED_XF86_PROTOTYPES */
+
+/*
+ * These things are always required by drivers (but not by libc_wrapper.c),
+ * even for a static server because some OSs don't provide them.
+ */
+
+extern int xf86getpagesize(void);
+extern void xf86usleep(unsigned long);
+extern void xf86getsecs(long *, long *);
+#ifndef DONT_DEFINE_WRAPPERS
+#undef getpagesize
+#define getpagesize() xf86getpagesize()
+#undef usleep
+#define usleep(ul) xf86usleep(ul)
+#undef getsecs
+#define getsecs(a, b) xf86getsecs(a, b)
+#endif
+#endif /* _XF86_ANSIC_H */
diff --git a/Xincludes/xc/programs/Xserver/include/XIstubs.h b/Xincludes/xc/programs/Xserver/include/XIstubs.h
new file mode 100644
index 0000000..27621d1
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/XIstubs.h
@@ -0,0 +1,101 @@
+/* $XFree86: xc/programs/Xserver/include/XIstubs.h,v 3.0 1996/03/29 22:19:27 dawes Exp $ */
+/************************************************************
+
+Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
+
+ 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 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) DISCLAIM 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.
+
+********************************************************/
+
+#ifndef XI_STUBS_H
+#define XI_STUBS_H 1
+
+int
+ChangeKeyboardDevice (
+#if NeedFunctionPrototypes
+ DeviceIntPtr /* old_dev */,
+ DeviceIntPtr /* new_dev */
+#endif
+ );
+
+int
+ChangePointerDevice (
+#if NeedFunctionPrototypes
+ DeviceIntPtr /* old_dev */,
+ DeviceIntPtr /* new_dev */,
+ unsigned char /* x */,
+ unsigned char /* y */
+#endif
+ );
+
+void
+CloseInputDevice (
+#if NeedFunctionPrototypes
+ DeviceIntPtr /* d */,
+ ClientPtr /* client */
+#endif
+ );
+
+void
+AddOtherInputDevices (
+#if NeedFunctionPrototypes
+ void
+#endif
+ );
+
+void
+OpenInputDevice (
+#if NeedFunctionPrototypes
+ DeviceIntPtr /* dev */,
+ ClientPtr /* client */,
+ int * /* status */
+#endif
+ );
+
+int
+SetDeviceMode (
+#if NeedFunctionPrototypes
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ int /* mode */
+#endif
+ );
+
+int
+SetDeviceValuators (
+#if NeedFunctionPrototypes
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ int * /* valuators */,
+ int /* first_valuator */,
+ int /* num_valuators */
+#endif
+ );
+
+int
+ChangeDeviceControl (
+#if NeedFunctionPrototypes
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ xDeviceCtl * /* control */
+#endif
+ );
+
+#endif /* XI_STUBS_H */
diff --git a/Xincludes/xc/programs/Xserver/include/bstore.h b/Xincludes/xc/programs/Xserver/include/bstore.h
new file mode 100644
index 0000000..098abcd
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/bstore.h
@@ -0,0 +1,23 @@
+/* $XFree86: xc/programs/Xserver/include/bstore.h,v 1.1 1998/04/05 16:44:25 robin Exp $*/
+/*
+ * Copyright (c) 1987 by the Regents of the University of California
+ *
+ * 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. The University of
+ * California makes no representations about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied
+ * warranty.
+ */
+
+/*
+ * Moved here from mi to allow wrapping of lower level backing store functions.
+ * -- 1997.10.27 Marc Aurele La France (tsi@xfree86.org)
+ */
+
+#ifndef _BSTORE_H_
+#define _BSTORE_H_
+
+#include "bstorestr.h"
+
+#endif /* _BSTORE_H_ */
diff --git a/Xincludes/xc/programs/Xserver/include/bstorestr.h b/Xincludes/xc/programs/Xserver/include/bstorestr.h
new file mode 100644
index 0000000..135cefe
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/bstorestr.h
@@ -0,0 +1,75 @@
+/* $XFree86: xc/programs/Xserver/include/bstorestr.h,v 1.1 1998/04/05 16:44:25 robin Exp $*/
+/*
+ * Copyright (c) 1987 by the Regents of the University of California
+ *
+ * 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. The University of
+ * California makes no representations about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied
+ * warranty.
+ */
+
+/*
+ * Moved here from mi to allow wrapping of lower level backing store functions.
+ * -- 1997.10.27 Marc Aurele La France (tsi@xfree86.org)
+ */
+
+#ifndef _BSTORESTR_H_
+#define _BSTORESTR_H_
+
+#include "gc.h"
+#include "pixmap.h"
+#include "region.h"
+#include "window.h"
+
+typedef void (* BackingStoreSaveAreasProcPtr)(
+#if NeedNestedPrototypes
+ PixmapPtr /*pBackingPixmap*/,
+ RegionPtr /*pObscured*/,
+ int /*x*/,
+ int /*y*/,
+ WindowPtr /*pWin*/
+#endif
+);
+
+typedef void (* BackingStoreRestoreAreasProcPtr)(
+#if NeedNestedPrototypes
+ PixmapPtr /*pBackingPixmap*/,
+ RegionPtr /*pExposed*/,
+ int /*x*/,
+ int /*y*/,
+ WindowPtr /*pWin*/
+#endif
+);
+
+typedef void (* BackingStoreSetClipmaskRgnProcPtr)(
+#if NeedNestedPrototypes
+ GCPtr /*pBackingGC*/,
+ RegionPtr /*pbackingCompositeClip*/
+#endif
+);
+
+typedef PixmapPtr (* BackingStoreGetImagePixmapProcPtr)( /* unused */
+#if NeedNestedPrototypes
+ void
+#endif
+);
+
+typedef PixmapPtr (* BackingStoreGetSpansPixmapProcPtr)( /* unused */
+#if NeedNestedPrototypes
+ void
+#endif
+);
+
+typedef struct _BSFuncs {
+
+ BackingStoreSaveAreasProcPtr SaveAreas;
+ BackingStoreRestoreAreasProcPtr RestoreAreas;
+ BackingStoreSetClipmaskRgnProcPtr SetClipmaskRgn;
+ BackingStoreGetImagePixmapProcPtr GetImagePixmap;
+ BackingStoreGetSpansPixmapProcPtr GetSpansPixmap;
+
+} BSFuncRec, *BSFuncPtr;
+
+#endif /* _BSTORESTR_H_ */
diff --git a/Xincludes/xc/programs/Xserver/include/colormap.h b/Xincludes/xc/programs/Xserver/include/colormap.h
new file mode 100644
index 0000000..5c5a80f
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/colormap.h
@@ -0,0 +1,235 @@
+/* $XFree86: xc/programs/Xserver/include/colormap.h,v 1.4 2001/01/17 22:36:57 dawes 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.
+
+*/
+/* $Xorg: colormap.h,v 1.4 2001/02/09 02:05:14 xorgcvs Exp $ */
+
+#ifndef CMAP_H
+#define CMAP_H 1
+
+#include "X11/Xproto.h"
+#include "screenint.h"
+#include "window.h"
+
+/* these follow X.h's AllocNone and AllocAll */
+#define CM_PSCREEN 2
+#define CM_PWIN 3
+/* Passed internally in colormap.c */
+#define REDMAP 0
+#define GREENMAP 1
+#define BLUEMAP 2
+#define PSEUDOMAP 3
+#define AllocPrivate (-1)
+#define AllocTemporary (-2)
+#define DynamicClass 1
+
+/* Values for the flags field of a colormap. These should have 1 bit set
+ * and not overlap */
+#define IsDefault 1
+#define AllAllocated 2
+#define BeingCreated 4
+
+
+typedef CARD32 Pixel;
+typedef struct _CMEntry *EntryPtr;
+/* moved to screenint.h: typedef struct _ColormapRec *ColormapPtr */
+typedef struct _colorResource *colorResourcePtr;
+
+extern int CreateColormap(
+#if NeedFunctionPrototypes
+ Colormap /*mid*/,
+ ScreenPtr /*pScreen*/,
+ VisualPtr /*pVisual*/,
+ ColormapPtr* /*ppcmap*/,
+ int /*alloc*/,
+ int /*client*/
+#endif
+);
+
+extern int FreeColormap(
+#if NeedFunctionPrototypes
+ pointer /*pmap*/,
+ XID /*mid*/
+#endif
+);
+
+extern int TellLostMap(
+#if NeedFunctionPrototypes
+ WindowPtr /*pwin*/,
+ pointer /* Colormap *pmid */
+#endif
+);
+
+extern int TellGainedMap(
+#if NeedFunctionPrototypes
+ WindowPtr /*pwin*/,
+ pointer /* Colormap *pmid */
+#endif
+);
+
+extern int CopyColormapAndFree(
+#if NeedFunctionPrototypes
+ Colormap /*mid*/,
+ ColormapPtr /*pSrc*/,
+ int /*client*/
+#endif
+);
+
+extern int AllocColor(
+#if NeedFunctionPrototypes
+ ColormapPtr /*pmap*/,
+ unsigned short* /*pred*/,
+ unsigned short* /*pgreen*/,
+ unsigned short* /*pblue*/,
+ Pixel* /*pPix*/,
+ int /*client*/
+#endif
+);
+
+extern void FakeAllocColor(
+#if NeedFunctionPrototypes
+ ColormapPtr /*pmap*/,
+ xColorItem * /*item*/
+#endif
+);
+
+extern void FakeFreeColor(
+#if NeedFunctionPrototypes
+ ColormapPtr /*pmap*/,
+ Pixel /*pixel*/
+#endif
+);
+
+typedef int (*ColorCompareProcPtr)(
+#if NeedNestedPrototypes
+ EntryPtr /*pent*/,
+ xrgb * /*prgb*/
+#endif
+);
+
+extern int FindColor(
+#if NeedFunctionPrototypes
+ ColormapPtr /*pmap*/,
+ EntryPtr /*pentFirst*/,
+ int /*size*/,
+ xrgb* /*prgb*/,
+ Pixel* /*pPixel*/,
+ int /*channel*/,
+ int /*client*/,
+ ColorCompareProcPtr /*comp*/
+#endif
+);
+
+extern int QueryColors(
+#if NeedFunctionPrototypes
+ ColormapPtr /*pmap*/,
+ int /*count*/,
+ Pixel* /*ppixIn*/,
+ xrgb* /*prgbList*/
+#endif
+);
+
+extern int FreeClientPixels(
+#if NeedFunctionPrototypes
+ pointer /*pcr*/,
+ XID /*fakeid*/
+#endif
+);
+
+extern int AllocColorCells(
+#if NeedFunctionPrototypes
+ int /*client*/,
+ ColormapPtr /*pmap*/,
+ int /*colors*/,
+ int /*planes*/,
+ Bool /*contig*/,
+ Pixel* /*ppix*/,
+ Pixel* /*masks*/
+#endif
+);
+
+extern int AllocColorPlanes(
+#if NeedFunctionPrototypes
+ int /*client*/,
+ ColormapPtr /*pmap*/,
+ int /*colors*/,
+ int /*r*/,
+ int /*g*/,
+ int /*b*/,
+ Bool /*contig*/,
+ Pixel* /*pixels*/,
+ Pixel* /*prmask*/,
+ Pixel* /*pgmask*/,
+ Pixel* /*pbmask*/
+#endif
+);
+
+extern int FreeColors(
+#if NeedFunctionPrototypes
+ ColormapPtr /*pmap*/,
+ int /*client*/,
+ int /*count*/,
+ Pixel* /*pixels*/,
+ Pixel /*mask*/
+#endif
+);
+
+extern int StoreColors(
+#if NeedFunctionPrototypes
+ ColormapPtr /*pmap*/,
+ int /*count*/,
+ xColorItem* /*defs*/
+#endif
+);
+
+extern int IsMapInstalled(
+#if NeedFunctionPrototypes
+ Colormap /*map*/,
+ WindowPtr /*pWin*/
+#endif
+);
+
+#endif /* CMAP_H */
diff --git a/Xincludes/xc/programs/Xserver/include/cursor.h b/Xincludes/xc/programs/Xserver/include/cursor.h
new file mode 100644
index 0000000..f50c389
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/cursor.h
@@ -0,0 +1,156 @@
+/***********************************************************
+
+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.
+
+******************************************************************/
+/* $Xorg: cursor.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
+#ifndef CURSOR_H
+#define CURSOR_H
+
+#include "misc.h"
+#include "screenint.h"
+#include "window.h"
+
+#define NullCursor ((CursorPtr)NULL)
+
+typedef struct _Cursor *CursorPtr;
+typedef struct _CursorMetric *CursorMetricPtr;
+
+extern CursorPtr rootCursor;
+
+extern int FreeCursor(
+#if NeedFunctionPrototypes
+ pointer /*pCurs*/,
+ XID /*cid*/
+#endif
+);
+
+/* Quartz support on Mac OS X pulls in the QuickDraw
+ framework whose AllocCursor function conflicts here. */
+#ifdef __DARWIN__
+#define AllocCursor Darwin_X_AllocCursor
+#endif
+extern CursorPtr AllocCursor(
+#if NeedFunctionPrototypes
+ unsigned char* /*psrcbits*/,
+ unsigned char* /*pmaskbits*/,
+ CursorMetricPtr /*cm*/,
+ unsigned /*foreRed*/,
+ unsigned /*foreGreen*/,
+ unsigned /*foreBlue*/,
+ unsigned /*backRed*/,
+ unsigned /*backGreen*/,
+ unsigned /*backBlue*/
+#endif
+);
+
+extern int AllocGlyphCursor(
+#if NeedFunctionPrototypes
+ Font /*source*/,
+ unsigned int /*sourceChar*/,
+ Font /*mask*/,
+ unsigned int /*maskChar*/,
+ unsigned /*foreRed*/,
+ unsigned /*foreGreen*/,
+ unsigned /*foreBlue*/,
+ unsigned /*backRed*/,
+ unsigned /*backGreen*/,
+ unsigned /*backBlue*/,
+ CursorPtr* /*ppCurs*/,
+ ClientPtr /*client*/
+#endif
+);
+
+extern CursorPtr CreateRootCursor(
+#if NeedFunctionPrototypes
+ char* /*pfilename*/,
+ unsigned int /*glyph*/
+#endif
+);
+
+extern int ServerBitsFromGlyph(
+#if NeedFunctionPrototypes
+ FontPtr /*pfont*/,
+ unsigned int /*ch*/,
+ register CursorMetricPtr /*cm*/,
+ unsigned char ** /*ppbits*/
+#endif
+);
+
+extern Bool CursorMetricsFromGlyph(
+#if NeedFunctionPrototypes
+ FontPtr /*pfont*/,
+ unsigned /*ch*/,
+ CursorMetricPtr /*cm*/
+#endif
+);
+
+extern void CheckCursorConfinement(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/
+#endif
+);
+
+extern void NewCurrentScreen(
+#if NeedFunctionPrototypes
+ ScreenPtr /*newScreen*/,
+ int /*x*/,
+ int /*y*/
+#endif
+);
+
+extern Bool PointerConfinedToScreen(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void GetSpritePosition(
+#if NeedFunctionPrototypes
+ int * /*px*/,
+ int * /*py*/
+#endif
+);
+
+#endif /* CURSOR_H */
diff --git a/Xincludes/xc/programs/Xserver/include/dix.h b/Xincludes/xc/programs/Xserver/include/dix.h
new file mode 100644
index 0000000..3c789c4
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/dix.h
@@ -0,0 +1,1096 @@
+/* $XFree86: xc/programs/Xserver/include/dix.h,v 3.21 2001/10/28 03:34:11 tsi 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.
+
+******************************************************************/
+/* $Xorg: dix.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
+
+#ifndef DIX_H
+#define DIX_H
+
+#include "gc.h"
+#include "window.h"
+#include "input.h"
+
+#define EARLIER -1
+#define SAMETIME 0
+#define LATER 1
+
+#define NullClient ((ClientPtr) 0)
+#define REQUEST(type) \
+ register type *stuff = (type *)client->requestBuffer
+
+
+#define REQUEST_SIZE_MATCH(req)\
+ if ((sizeof(req) >> 2) != client->req_len)\
+ return(BadLength)
+
+#define REQUEST_AT_LEAST_SIZE(req) \
+ if ((sizeof(req) >> 2) > client->req_len )\
+ return(BadLength)
+
+#define REQUEST_FIXED_SIZE(req, n)\
+ if (((sizeof(req) >> 2) > client->req_len) || \
+ (((sizeof(req) + (n) + 3) >> 2) != client->req_len)) \
+ return(BadLength)
+
+#define LEGAL_NEW_RESOURCE(id,client)\
+ if (!LegalNewID(id,client)) \
+ {\
+ client->errorValue = id;\
+ return(BadIDChoice);\
+ }
+
+/* XXX if you are using this macro, you are probably not generating Match
+ * errors where appropriate */
+#define LOOKUP_DRAWABLE(did, client)\
+ ((client->lastDrawableID == did) ? \
+ client->lastDrawable : (DrawablePtr)LookupDrawable(did, client))
+
+#ifdef XCSECURITY
+
+#define SECURITY_VERIFY_DRAWABLE(pDraw, did, client, mode)\
+ if (client->lastDrawableID == did && !client->trustLevel)\
+ pDraw = client->lastDrawable;\
+ else \
+ {\
+ pDraw = (DrawablePtr) SecurityLookupIDByClass(client, did, \
+ RC_DRAWABLE, mode);\
+ if (!pDraw) \
+ {\
+ client->errorValue = did; \
+ return BadDrawable;\
+ }\
+ if (pDraw->type == UNDRAWABLE_WINDOW)\
+ return BadMatch;\
+ }
+
+#define SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, mode)\
+ if (client->lastDrawableID == did && !client->trustLevel)\
+ pDraw = client->lastDrawable;\
+ else \
+ {\
+ pDraw = (DrawablePtr) SecurityLookupIDByClass(client, did, \
+ RC_DRAWABLE, mode);\
+ if (!pDraw) \
+ {\
+ client->errorValue = did; \
+ return BadDrawable;\
+ }\
+ }
+
+#define SECURITY_VERIFY_GC(pGC, rid, client, mode)\
+ if (client->lastGCID == rid && !client->trustLevel)\
+ pGC = client->lastGC;\
+ else\
+ pGC = (GC *) SecurityLookupIDByType(client, rid, RT_GC, mode);\
+ if (!pGC)\
+ {\
+ client->errorValue = rid;\
+ return (BadGC);\
+ }
+
+#define VERIFY_DRAWABLE(pDraw, did, client)\
+ SECURITY_VERIFY_DRAWABLE(pDraw, did, client, SecurityUnknownAccess)
+
+#define VERIFY_GEOMETRABLE(pDraw, did, client)\
+ SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, SecurityUnknownAccess)
+
+#define VERIFY_GC(pGC, rid, client)\
+ SECURITY_VERIFY_GC(pGC, rid, client, SecurityUnknownAccess)
+
+#else /* not XCSECURITY */
+
+#define VERIFY_DRAWABLE(pDraw, did, client)\
+ if (client->lastDrawableID == did)\
+ pDraw = client->lastDrawable;\
+ else \
+ {\
+ pDraw = (DrawablePtr) LookupIDByClass(did, RC_DRAWABLE);\
+ if (!pDraw) \
+ {\
+ client->errorValue = did; \
+ return BadDrawable;\
+ }\
+ if (pDraw->type == UNDRAWABLE_WINDOW)\
+ return BadMatch;\
+ }
+
+#define VERIFY_GEOMETRABLE(pDraw, did, client)\
+ if (client->lastDrawableID == did)\
+ pDraw = client->lastDrawable;\
+ else \
+ {\
+ pDraw = (DrawablePtr) LookupIDByClass(did, RC_DRAWABLE);\
+ if (!pDraw) \
+ {\
+ client->errorValue = did; \
+ return BadDrawable;\
+ }\
+ }
+
+#define VERIFY_GC(pGC, rid, client)\
+ if (client->lastGCID == rid)\
+ pGC = client->lastGC;\
+ else\
+ pGC = (GC *)LookupIDByType(rid, RT_GC);\
+ if (!pGC)\
+ {\
+ client->errorValue = rid;\
+ return (BadGC);\
+ }
+
+#define SECURITY_VERIFY_DRAWABLE(pDraw, did, client, mode)\
+ VERIFY_DRAWABLE(pDraw, did, client)
+
+#define SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, mode)\
+ VERIFY_GEOMETRABLE(pDraw, did, client)
+
+#define SECURITY_VERIFY_GC(pGC, rid, client, mode)\
+ VERIFY_GC(pGC, rid, client)
+
+#endif /* XCSECURITY */
+
+/*
+ * We think that most hardware implementations of DBE will want
+ * LookupID*(dbe_back_buffer_id) to return the window structure that the
+ * id is a back buffer for. Since both front and back buffers will
+ * return the same structure, you need to be able to distinguish
+ * somewhere what kind of buffer (front/back) was being asked for, so
+ * that ddx can render to the right place. That's the problem that the
+ * following code solves. Note: we couldn't embed this in the LookupID*
+ * functions because the VALIDATE_DRAWABLE_AND_GC macro often circumvents
+ * those functions by checking a one-element cache. That's why we're
+ * mucking with VALIDATE_DRAWABLE_AND_GC.
+ *
+ * If you put -DNEED_DBE_BUF_BITS into PervasiveDBEDefines, the window
+ * structure will have two additional bits defined, srcBuffer and
+ * dstBuffer, and their values will be maintained via the macros
+ * SET_DBE_DSTBUF and SET_DBE_SRCBUF (below). If you also
+ * put -DNEED_DBE_BUF_VALIDATE into PervasiveDBEDefines, the function
+ * DbeValidateBuffer will be called any time the bits change to give you
+ * a chance to do some setup. See the DBE code for more details on this
+ * function. We put in these levels of conditionality so that you can do
+ * just what you need to do, and no more. If neither of these defines
+ * are used, the bits won't be there, and VALIDATE_DRAWABLE_AND_GC will
+ * be unchanged. dpw
+ */
+
+#if defined(NEED_DBE_BUF_BITS)
+#define SET_DBE_DSTBUF(_pDraw, _drawID) \
+ SET_DBE_BUF(_pDraw, _drawID, dstBuffer, TRUE)
+#define SET_DBE_SRCBUF(_pDraw, _drawID) \
+ SET_DBE_BUF(_pDraw, _drawID, srcBuffer, FALSE)
+#if defined (NEED_DBE_BUF_VALIDATE)
+#define SET_DBE_BUF(_pDraw, _drawID, _whichBuffer, _dstbuf) \
+ if (_pDraw->type == DRAWABLE_WINDOW)\
+ {\
+ int thisbuf = (_pDraw->id == _drawID);\
+ if (thisbuf != ((WindowPtr)_pDraw)->_whichBuffer)\
+ {\
+ ((WindowPtr)_pDraw)->_whichBuffer = thisbuf;\
+ DbeValidateBuffer((WindowPtr)_pDraw, _drawID, _dstbuf);\
+ }\
+ }
+#else /* want buffer bits, but don't need to call DbeValidateBuffer */
+#define SET_DBE_BUF(_pDraw, _drawID, _whichBuffer, _dstbuf) \
+ if (_pDraw->type == DRAWABLE_WINDOW)\
+ {\
+ ((WindowPtr)_pDraw)->_whichBuffer = (_pDraw->id == _drawID);\
+ }
+#endif /* NEED_DBE_BUF_VALIDATE */
+#else /* don't want buffer bits in window */
+#define SET_DBE_DSTBUF(_pDraw, _drawID) /**/
+#define SET_DBE_SRCBUF(_pDraw, _drawID) /**/
+#endif /* NEED_DBE_BUF_BITS */
+
+#define VALIDATE_DRAWABLE_AND_GC(drawID, pDraw, pGC, client)\
+ if ((stuff->gc == INVALID) || (client->lastGCID != stuff->gc) ||\
+ (client->lastDrawableID != drawID))\
+ {\
+ SECURITY_VERIFY_GEOMETRABLE(pDraw, drawID, client, SecurityWriteAccess);\
+ SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityReadAccess);\
+ if ((pGC->depth != pDraw->depth) ||\
+ (pGC->pScreen != pDraw->pScreen))\
+ return (BadMatch);\
+ client->lastDrawable = pDraw;\
+ client->lastDrawableID = drawID;\
+ client->lastGC = pGC;\
+ client->lastGCID = stuff->gc;\
+ }\
+ else\
+ {\
+ pGC = client->lastGC;\
+ pDraw = client->lastDrawable;\
+ }\
+ SET_DBE_DSTBUF(pDraw, drawID);\
+ if (pGC->serialNumber != pDraw->serialNumber)\
+ ValidateGC(pDraw, pGC);
+
+
+#define WriteReplyToClient(pClient, size, pReply) { \
+ if ((pClient)->swapped) \
+ (*ReplySwapVector[((xReq *)(pClient)->requestBuffer)->reqType]) \
+ (pClient, (int)(size), pReply); \
+ else (void) WriteToClient(pClient, (int)(size), (char *)(pReply)); }
+
+#define WriteSwappedDataToClient(pClient, size, pbuf) \
+ if ((pClient)->swapped) \
+ (*(pClient)->pSwapReplyFunc)(pClient, (int)(size), pbuf); \
+ else (void) WriteToClient (pClient, (int)(size), (char *)(pbuf));
+
+typedef struct _TimeStamp *TimeStampPtr;
+
+#ifndef _XTYPEDEF_CLIENTPTR
+typedef struct _Client *ClientPtr; /* also in misc.h */
+#define _XTYPEDEF_CLIENTPTR
+#endif
+
+typedef struct _WorkQueue *WorkQueuePtr;
+
+extern ClientPtr requestingClient;
+extern ClientPtr *clients;
+extern ClientPtr serverClient;
+extern int currentMaxClients;
+
+typedef int HWEventQueueType;
+typedef HWEventQueueType* HWEventQueuePtr;
+
+extern HWEventQueuePtr checkForInput[2];
+
+typedef struct _TimeStamp {
+ CARD32 months; /* really ~49.7 days */
+ CARD32 milliseconds;
+} TimeStamp;
+
+/* dispatch.c */
+
+extern void SetInputCheck(
+#if NeedFunctionPrototypes
+ HWEventQueuePtr /*c0*/,
+ HWEventQueuePtr /*c1*/
+#endif
+);
+
+extern void CloseDownClient(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/
+#endif
+);
+
+extern void UpdateCurrentTime(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void UpdateCurrentTimeIf(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void InitSelections(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void FlushClientCaches(
+#if NeedFunctionPrototypes
+ XID /*id*/
+#endif
+);
+
+extern int dixDestroyPixmap(
+#if NeedFunctionPrototypes
+ pointer /*value*/,
+ XID /*pid*/
+#endif
+);
+
+extern void CloseDownRetainedResources(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void InitClient(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/,
+ int /*i*/,
+ pointer /*ospriv*/
+#endif
+);
+
+extern ClientPtr NextAvailableClient(
+#if NeedFunctionPrototypes
+ pointer /*ospriv*/
+#endif
+);
+
+extern void SendErrorToClient(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/,
+ unsigned int /*majorCode*/,
+ unsigned int /*minorCode*/,
+ XID /*resId*/,
+ int /*errorCode*/
+#endif
+);
+
+extern void DeleteWindowFromAnySelections(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/
+#endif
+);
+
+extern void MarkClientException(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/
+#endif
+);
+
+extern int GetGeometry(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/,
+ xGetGeometryReply* /* wa */
+#endif
+);
+
+extern int SendConnSetup(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/,
+ char* /*reason*/
+#endif
+);
+
+extern int
+DoGetImage(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/,
+ int /*format*/,
+ Drawable /*drawable*/,
+ int /*x*/,
+ int /*y*/,
+ int /*width*/,
+ int /*height*/,
+ Mask /*planemask*/,
+ xGetImageReply **/*im_return*/
+#endif
+);
+
+#ifdef LBX
+extern void IncrementClientCount(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+#endif /* LBX */
+
+/* dixutils.c */
+
+extern void CopyISOLatin1Lowered(
+#if NeedFunctionPrototypes
+ unsigned char * /*dest*/,
+ unsigned char * /*source*/,
+ int /*length*/
+#endif
+);
+
+#ifdef XCSECURITY
+
+extern WindowPtr SecurityLookupWindow(
+#if NeedFunctionPrototypes
+ XID /*rid*/,
+ ClientPtr /*client*/,
+ Mask /*access_mode*/
+#endif
+);
+
+extern pointer SecurityLookupDrawable(
+#if NeedFunctionPrototypes
+ XID /*rid*/,
+ ClientPtr /*client*/,
+ Mask /*access_mode*/
+#endif
+);
+
+extern WindowPtr LookupWindow(
+#if NeedFunctionPrototypes
+ XID /*rid*/,
+ ClientPtr /*client*/
+#endif
+);
+
+extern pointer LookupDrawable(
+#if NeedFunctionPrototypes
+ XID /*rid*/,
+ ClientPtr /*client*/
+#endif
+);
+
+#else
+
+extern WindowPtr LookupWindow(
+#if NeedFunctionPrototypes
+ XID /*rid*/,
+ ClientPtr /*client*/
+#endif
+);
+
+extern pointer LookupDrawable(
+#if NeedFunctionPrototypes
+ XID /*rid*/,
+ ClientPtr /*client*/
+#endif
+);
+
+#define SecurityLookupWindow(rid, client, access_mode) \
+ LookupWindow(rid, client)
+
+#define SecurityLookupDrawable(rid, client, access_mode) \
+ LookupDrawable(rid, client)
+
+#endif /* XCSECURITY */
+
+extern ClientPtr LookupClient(
+#if NeedFunctionPrototypes
+ XID /*rid*/,
+ ClientPtr /*client*/
+#endif
+);
+
+extern void NoopDDA(
+#if NeedVarargsPrototypes
+ void *,
+ ...
+#endif
+);
+
+extern int AlterSaveSetForClient(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/,
+ WindowPtr /*pWin*/,
+ unsigned /*mode*/
+#endif
+);
+
+extern void DeleteWindowFromAnySaveSet(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/
+#endif
+);
+
+extern void BlockHandler(
+#if NeedFunctionPrototypes
+ pointer /*pTimeout*/,
+ pointer /*pReadmask*/
+#endif
+);
+
+extern void WakeupHandler(
+#if NeedFunctionPrototypes
+ int /*result*/,
+ pointer /*pReadmask*/
+#endif
+);
+
+typedef void (* WakeupHandlerProcPtr)(
+#if NeedNestedPrototypes
+ pointer /* blockData */,
+ int /* result */,
+ pointer /* pReadmask */
+#endif
+);
+
+extern Bool RegisterBlockAndWakeupHandlers(
+#if NeedFunctionPrototypes
+ BlockHandlerProcPtr /*blockHandler*/,
+ WakeupHandlerProcPtr /*wakeupHandler*/,
+ pointer /*blockData*/
+#endif
+);
+
+extern void RemoveBlockAndWakeupHandlers(
+#if NeedFunctionPrototypes
+ BlockHandlerProcPtr /*blockHandler*/,
+ WakeupHandlerProcPtr /*wakeupHandler*/,
+ pointer /*blockData*/
+#endif
+);
+
+extern void InitBlockAndWakeupHandlers(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void ProcessWorkQueue(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern Bool QueueWorkProc(
+#if NeedFunctionPrototypes
+ Bool (* /*function*/)(
+#if NeedNestedPrototypes
+ ClientPtr /*clientUnused*/,
+ pointer /*closure*/
+#endif
+ ),
+ ClientPtr /*client*/,
+ pointer /*closure*/
+#endif
+);
+
+typedef Bool (* ClientSleepProcPtr)(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/,
+ pointer /*closure*/
+#endif
+);
+
+extern Bool ClientSleep(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/,
+ ClientSleepProcPtr /* function */,
+ pointer /*closure*/
+#endif
+);
+
+#ifndef ___CLIENTSIGNAL_DEFINED___
+#define ___CLIENTSIGNAL_DEFINED___
+extern Bool ClientSignal(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/
+#endif
+);
+#endif /* ___CLIENTSIGNAL_DEFINED___ */
+
+extern void ClientWakeup(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/
+#endif
+);
+
+extern Bool ClientIsAsleep(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/
+#endif
+);
+
+/* atom.c */
+
+extern Atom MakeAtom(
+#if NeedFunctionPrototypes
+ char * /*string*/,
+ unsigned /*len*/,
+ Bool /*makeit*/
+#endif
+);
+
+extern Bool ValidAtom(
+#if NeedFunctionPrototypes
+ Atom /*atom*/
+#endif
+);
+
+extern char *NameForAtom(
+#if NeedFunctionPrototypes
+ Atom /*atom*/
+#endif
+);
+
+extern void AtomError(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void FreeAllAtoms(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void InitAtoms(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+/* events.c */
+
+extern void SetMaskForEvent(
+#if NeedFunctionPrototypes
+ Mask /* mask */,
+ int /* event */
+#endif
+);
+
+
+extern Bool IsParent(
+#if NeedFunctionPrototypes
+ WindowPtr /* maybeparent */,
+ WindowPtr /* child */
+#endif
+);
+
+extern WindowPtr GetCurrentRootWindow(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern WindowPtr GetSpriteWindow(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+
+extern void NoticeEventTime(
+#if NeedFunctionPrototypes
+ xEventPtr /* xE */
+#endif
+);
+
+extern void EnqueueEvent(
+#if NeedFunctionPrototypes
+ xEventPtr /* xE */,
+ DeviceIntPtr /* device */,
+ int /* count */
+#endif
+);
+
+extern void ComputeFreezes(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void CheckGrabForSyncs(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /* dev */,
+ Bool /* thisMode */,
+ Bool /* otherMode */
+#endif
+);
+
+extern void ActivatePointerGrab(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /* mouse */,
+ GrabPtr /* grab */,
+ TimeStamp /* time */,
+ Bool /* autoGrab */
+#endif
+);
+
+extern void DeactivatePointerGrab(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /* mouse */
+#endif
+);
+
+extern void ActivateKeyboardGrab(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /* keybd */,
+ GrabPtr /* grab */,
+ TimeStamp /* time */,
+ Bool /* passive */
+#endif
+);
+
+extern void DeactivateKeyboardGrab(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /* keybd */
+#endif
+);
+
+extern void AllowSome(
+#if NeedFunctionPrototypes
+ ClientPtr /* client */,
+ TimeStamp /* time */,
+ DeviceIntPtr /* thisDev */,
+ int /* newState */
+#endif
+);
+
+extern void ReleaseActiveGrabs(
+#if NeedFunctionPrototypes
+ClientPtr client
+#endif
+);
+
+extern int DeliverEventsToWindow(
+#if NeedFunctionPrototypes
+ WindowPtr /* pWin */,
+ xEventPtr /* pEvents */,
+ int /* count */,
+ Mask /* filter */,
+ GrabPtr /* grab */,
+ int /* mskidx */
+#endif
+);
+
+extern int DeliverDeviceEvents(
+#if NeedFunctionPrototypes
+ WindowPtr /* pWin */,
+ xEventPtr /* xE */,
+ GrabPtr /* grab */,
+ WindowPtr /* stopAt */,
+ DeviceIntPtr /* dev */,
+ int /* count */
+#endif
+);
+
+extern void DefineInitialRootWindow(
+#if NeedFunctionPrototypes
+ WindowPtr /* win */
+#endif
+);
+
+extern void WindowHasNewCursor(
+#if NeedFunctionPrototypes
+ WindowPtr /* pWin */
+#endif
+);
+
+extern Bool CheckDeviceGrabs(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /* device */,
+ xEventPtr /* xE */,
+ int /* checkFirst */,
+ int /* count */
+#endif
+);
+
+extern void DeliverFocusedEvent(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /* keybd */,
+ xEventPtr /* xE */,
+ WindowPtr /* window */,
+ int /* count */
+#endif
+);
+
+extern void DeliverGrabbedEvent(
+#if NeedFunctionPrototypes
+ xEventPtr /* xE */,
+ DeviceIntPtr /* thisDev */,
+ Bool /* deactivateGrab */,
+ int /* count */
+#endif
+);
+
+#ifdef XKB
+extern void FixKeyState(
+#if NeedFunctionPrototypes
+ xEvent * /* xE */,
+ DeviceIntPtr /* keybd */
+#endif
+);
+#endif /* XKB */
+
+extern void RecalculateDeliverableEvents(
+#if NeedFunctionPrototypes
+ WindowPtr /* pWin */
+#endif
+);
+
+extern int OtherClientGone(
+#if NeedFunctionPrototypes
+ pointer /* value */,
+ XID /* id */
+#endif
+);
+
+extern void DoFocusEvents(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /* dev */,
+ WindowPtr /* fromWin */,
+ WindowPtr /* toWin */,
+ int /* mode */
+#endif
+);
+
+extern int SetInputFocus(
+#if NeedFunctionPrototypes
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ Window /* focusID */,
+ CARD8 /* revertTo */,
+ Time /* ctime */,
+ Bool /* followOK */
+#endif
+);
+
+extern int GrabDevice(
+#if NeedFunctionPrototypes
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ unsigned /* this_mode */,
+ unsigned /* other_mode */,
+ Window /* grabWindow */,
+ unsigned /* ownerEvents */,
+ Time /* ctime */,
+ Mask /* mask */,
+ CARD8 * /* status */
+#endif
+);
+
+extern void InitEvents(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void CloseDownEvents(void);
+
+extern void DeleteWindowFromAnyEvents(
+#if NeedFunctionPrototypes
+ WindowPtr /* pWin */,
+ Bool /* freeResources */
+#endif
+);
+
+
+extern Mask EventMaskForClient(
+#if NeedFunctionPrototypes
+ WindowPtr /* pWin */,
+ ClientPtr /* client */
+#endif
+);
+
+
+
+extern int DeliverEvents(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/,
+ xEventPtr /*xE*/,
+ int /*count*/,
+ WindowPtr /*otherParent*/
+#endif
+);
+
+
+extern void WriteEventsToClient(
+#if NeedFunctionPrototypes
+ ClientPtr /*pClient*/,
+ int /*count*/,
+ xEventPtr /*events*/
+#endif
+);
+
+extern int TryClientEvents(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/,
+ xEventPtr /*pEvents*/,
+ int /*count*/,
+ Mask /*mask*/,
+ Mask /*filter*/,
+ GrabPtr /*grab*/
+#endif
+);
+
+extern void WindowsRestructured(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+
+#ifdef RANDR
+void
+ScreenRestructured (ScreenPtr pScreen);
+#endif
+
+extern void ResetClientPrivates(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern int AllocateClientPrivateIndex(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern Bool AllocateClientPrivate(
+#if NeedFunctionPrototypes
+ int /*index*/,
+ unsigned /*amount*/
+#endif
+);
+
+/*
+ * callback manager stuff
+ */
+
+#ifndef _XTYPEDEF_CALLBACKLISTPTR
+typedef struct _CallbackList *CallbackListPtr; /* also in misc.h */
+#define _XTYPEDEF_CALLBACKLISTPTR
+#endif
+
+typedef void (*CallbackProcPtr) (
+#if NeedNestedPrototypes
+ CallbackListPtr *, pointer, pointer
+#endif
+);
+
+typedef Bool (*AddCallbackProcPtr) (
+#if NeedNestedPrototypes
+ CallbackListPtr *, CallbackProcPtr, pointer
+#endif
+);
+
+typedef Bool (*DeleteCallbackProcPtr) (
+#if NeedNestedPrototypes
+ CallbackListPtr *, CallbackProcPtr, pointer
+#endif
+);
+
+typedef void (*CallCallbacksProcPtr) (
+#if NeedNestedPrototypes
+ CallbackListPtr *, pointer
+#endif
+);
+
+typedef void (*DeleteCallbackListProcPtr) (
+#if NeedNestedPrototypes
+ CallbackListPtr *
+#endif
+);
+
+typedef struct _CallbackProcs {
+ AddCallbackProcPtr AddCallback;
+ DeleteCallbackProcPtr DeleteCallback;
+ CallCallbacksProcPtr CallCallbacks;
+ DeleteCallbackListProcPtr DeleteCallbackList;
+} CallbackFuncsRec, *CallbackFuncsPtr;
+
+extern Bool CreateCallbackList(
+#if NeedFunctionPrototypes
+ CallbackListPtr * /*pcbl*/,
+ CallbackFuncsPtr /*cbfuncs*/
+#endif
+);
+
+extern Bool AddCallback(
+#if NeedFunctionPrototypes
+ CallbackListPtr * /*pcbl*/,
+ CallbackProcPtr /*callback*/,
+ pointer /*data*/
+#endif
+);
+
+extern Bool DeleteCallback(
+#if NeedFunctionPrototypes
+ CallbackListPtr * /*pcbl*/,
+ CallbackProcPtr /*callback*/,
+ pointer /*data*/
+#endif
+);
+
+extern void CallCallbacks(
+#if NeedFunctionPrototypes
+ CallbackListPtr * /*pcbl*/,
+ pointer /*call_data*/
+#endif
+);
+
+extern void DeleteCallbackList(
+#if NeedFunctionPrototypes
+ CallbackListPtr * /*pcbl*/
+#endif
+);
+
+extern void InitCallbackManager(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+/*
+ * ServerGrabCallback stuff
+ */
+
+extern CallbackListPtr ServerGrabCallback;
+
+typedef enum {SERVER_GRABBED, SERVER_UNGRABBED,
+ CLIENT_PERVIOUS, CLIENT_IMPERVIOUS } ServerGrabState;
+
+typedef struct {
+ ClientPtr client;
+ ServerGrabState grabstate;
+} ServerGrabInfoRec;
+
+/*
+ * EventCallback stuff
+ */
+
+extern CallbackListPtr EventCallback;
+
+typedef struct {
+ ClientPtr client;
+ xEventPtr events;
+ int count;
+} EventInfoRec;
+
+/*
+ * DeviceEventCallback stuff
+ */
+
+extern CallbackListPtr DeviceEventCallback;
+
+typedef struct {
+ xEventPtr events;
+ int count;
+} DeviceEventInfoRec;
+
+#endif /* DIX_H */
diff --git a/Xincludes/xc/programs/Xserver/include/dixstruct.h b/Xincludes/xc/programs/Xserver/include/dixstruct.h
new file mode 100644
index 0000000..3ee2ad1
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/dixstruct.h
@@ -0,0 +1,267 @@
+/* $XFree86: xc/programs/Xserver/include/dixstruct.h,v 3.15 2001/09/17 16:07:47 keithp Exp $ */
+/***********************************************************
+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.
+
+******************************************************************/
+/* $Xorg: dixstruct.h,v 1.3 2000/08/17 19:53:29 cpqbld Exp $ */
+
+#ifndef DIXSTRUCT_H
+#define DIXSTRUCT_H
+
+#include "dix.h"
+#include "resource.h"
+#include "cursor.h"
+#include "gc.h"
+#include "pixmap.h"
+#include <X11/Xmd.h>
+
+/*
+ * direct-mapped hash table, used by resource manager to store
+ * translation from client ids to server addresses.
+ */
+
+#ifdef DEBUG
+#define MAX_REQUEST_LOG 100
+#endif
+
+extern CallbackListPtr ClientStateCallback;
+
+typedef struct {
+ ClientPtr client;
+ xConnSetupPrefix *prefix;
+ xConnSetup *setup;
+} NewClientInfoRec;
+
+typedef void (*ReplySwapPtr) (
+#if NeedNestedPrototypes
+ ClientPtr /* pClient */,
+ int /* size */,
+ void * /* pbuf */
+#endif
+);
+
+extern void ReplyNotSwappd (
+#if NeedNestedPrototypes
+ ClientPtr /* pClient */,
+ int /* size */,
+ void * /* pbuf */
+#endif
+);
+
+typedef enum {ClientStateInitial,
+ ClientStateAuthenticating,
+ ClientStateRunning,
+ ClientStateRetained,
+ ClientStateGone,
+ ClientStateCheckingSecurity,
+ ClientStateCheckedSecurity} ClientState;
+
+typedef struct _Client {
+ int index;
+ Mask clientAsMask;
+ pointer requestBuffer;
+ pointer osPrivate; /* for OS layer, including scheduler */
+ Bool swapped;
+ ReplySwapPtr pSwapReplyFunc;
+ XID errorValue;
+ int sequence;
+ int closeDownMode;
+ int clientGone;
+ int noClientException; /* this client died or needs to be
+ * killed */
+ DrawablePtr lastDrawable;
+ Drawable lastDrawableID;
+ GCPtr lastGC;
+ GContext lastGCID;
+ pointer *saveSet;
+ int numSaved;
+ pointer screenPrivate[MAXSCREENS];
+ int (**requestVector) (
+#if NeedNestedPrototypes
+ ClientPtr /* pClient */
+#endif
+);
+ CARD32 req_len; /* length of current request */
+ Bool big_requests; /* supports large requests */
+ int priority;
+ ClientState clientState;
+ DevUnion *devPrivates;
+#ifdef XKB
+ unsigned short xkbClientFlags;
+ unsigned short mapNotifyMask;
+ unsigned short newKeyboardNotifyMask;
+ unsigned short vMajor,vMinor;
+ KeyCode minKC,maxKC;
+#endif
+
+#ifdef DEBUG
+ unsigned char requestLog[MAX_REQUEST_LOG];
+ int requestLogIndex;
+#endif
+#ifdef LBX
+ int (*readRequest)(
+#if NeedNestedPrototypes
+ ClientPtr /*client*/
+#endif
+);
+#endif
+ unsigned long replyBytesRemaining;
+#ifdef XCSECURITY
+ XID authId;
+ unsigned int trustLevel;
+ pointer (* CheckAccess)(
+#if NeedNestedPrototypes
+ ClientPtr /*pClient*/,
+ XID /*id*/,
+ RESTYPE /*classes*/,
+ Mask /*access_mode*/,
+ pointer /*resourceval*/
+#endif
+);
+#endif
+#ifdef XAPPGROUP
+ struct _AppGroupRec* appgroup;
+#endif
+ struct _FontResolution * (*fontResFunc) ( /* no need for font.h */
+#if NeedNestedPrototypes
+ ClientPtr /* pClient */,
+ int * /* num */
+#endif
+);
+#ifdef SMART_SCHEDULE
+ int smart_priority;
+ long smart_start_tick;
+ long smart_stop_tick;
+ long smart_check_tick;
+#endif
+} ClientRec;
+
+#ifdef SMART_SCHEDULE
+/*
+ * Scheduling interface
+ */
+extern long SmartScheduleTime;
+extern long SmartScheduleInterval;
+extern long SmartScheduleSlice;
+extern long SmartScheduleMaxSlice;
+extern unsigned long SmartScheduleIdleCount;
+extern Bool SmartScheduleDisable;
+extern Bool SmartScheduleIdle;
+extern Bool SmartScheduleTimerStopped;
+extern Bool SmartScheduleStartTimer(void);
+#define SMART_MAX_PRIORITY 20
+#define SMART_MIN_PRIORITY -20
+
+extern Bool SmartScheduleInit(
+#ifdef NeedFunctionPrototypes
+ void
+#endif
+);
+
+#endif
+
+/* This prototype is used pervasively in Xext, dix */
+#if NeedFunctionPrototypes
+#define DISPATCH_PROC(func) int func(ClientPtr /* client */)
+#else
+#define DISPATCH_PROC(func) int func(/* ClientPtr client */)
+#endif
+
+typedef struct _WorkQueue {
+ struct _WorkQueue *next;
+ Bool (*function) (
+#if NeedNestedPrototypes
+ ClientPtr /* pClient */,
+ pointer /* closure */
+#endif
+);
+ ClientPtr client;
+ pointer closure;
+} WorkQueueRec;
+
+extern TimeStamp currentTime;
+extern TimeStamp lastDeviceEventTime;
+
+extern int CompareTimeStamps(
+#if NeedFunctionPrototypes
+ TimeStamp /*a*/,
+ TimeStamp /*b*/
+#endif
+);
+
+extern TimeStamp ClientTimeToServerTime(
+#if NeedFunctionPrototypes
+ CARD32 /*c*/
+#endif
+);
+
+typedef struct _CallbackRec {
+ CallbackProcPtr proc;
+ pointer data;
+ Bool deleted;
+ struct _CallbackRec *next;
+} CallbackRec, *CallbackPtr;
+
+typedef struct _CallbackList {
+ CallbackFuncsRec funcs;
+ int inCallback;
+ Bool deleted;
+ int numDeleted;
+ CallbackPtr list;
+} CallbackListRec;
+
+/* proc vectors */
+
+extern int (* InitialVector[3]) (
+#if NeedNestedPrototypes
+ ClientPtr /*client*/
+#endif
+);
+
+extern int (* ProcVector[256]) (
+#if NeedNestedPrototypes
+ ClientPtr /*client*/
+#endif
+);
+
+extern int (* SwappedProcVector[256]) (
+#if NeedNestedPrototypes
+ ClientPtr /*client*/
+#endif
+);
+
+#ifdef K5AUTH
+extern int (*k5_Vector[256])() =
+#if NeedNestedPrototypes
+ ClientPtr /*client*/
+#endif
+);
+#endif
+
+extern ReplySwapPtr ReplySwapVector[256];
+
+extern int ProcBadRequest(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/
+#endif
+);
+
+#endif /* DIXSTRUCT_H */
diff --git a/Xincludes/xc/programs/Xserver/include/exevents.h b/Xincludes/xc/programs/Xserver/include/exevents.h
new file mode 100644
index 0000000..941cf91
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/exevents.h
@@ -0,0 +1,275 @@
+/* $XFree86: xc/programs/Xserver/include/exevents.h,v 3.0 1996/03/29 22:19:29 dawes Exp $ */
+/************************************************************
+
+Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
+
+ 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 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) DISCLAIM 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.
+
+********************************************************/
+
+/********************************************************************
+ * Interface of 'exevents.c'
+ */
+
+#ifndef EXEVENTS_H
+#define EXEVENTS_H
+
+void
+RegisterOtherDevice (
+#if NeedFunctionPrototypes
+ DeviceIntPtr /* device */
+#endif
+ );
+
+void
+ProcessOtherEvent (
+#if NeedFunctionPrototypes
+ xEventPtr /* FIXME deviceKeyButtonPointer * xE */,
+ DeviceIntPtr /* other */,
+ int /* count */
+#endif
+ );
+
+int
+InitProximityClassDeviceStruct(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /* dev */
+#endif
+ );
+
+void
+InitValuatorAxisStruct(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /* dev */,
+ int /* axnum */,
+ int /* minval */,
+ int /* maxval */,
+ int /* resolution */,
+ int /* min_res */,
+ int /* max_res */
+#endif
+ );
+
+void
+DeviceFocusEvent(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /* dev */,
+ int /* type */,
+ int /* mode */,
+ int /* detail */,
+ WindowPtr /* pWin */
+#endif
+ );
+
+int
+GrabButton(
+#if NeedFunctionPrototypes
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ BYTE /* this_device_mode */,
+ BYTE /* other_devices_mode */,
+ CARD16 /* modifiers */,
+ DeviceIntPtr /* modifier_device */,
+ CARD8 /* button */,
+ Window /* grabWindow */,
+ BOOL /* ownerEvents */,
+ Cursor /* rcursor */,
+ Window /* rconfineTo */,
+ Mask /* eventMask */
+#endif
+ );
+
+int
+GrabKey(
+#if NeedFunctionPrototypes
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ BYTE /* this_device_mode */,
+ BYTE /* other_devices_mode */,
+ CARD16 /* modifiers */,
+ DeviceIntPtr /* modifier_device */,
+ CARD8 /* key */,
+ Window /* grabWindow */,
+ BOOL /* ownerEvents */,
+ Mask /* mask */
+#endif
+ );
+
+int
+SelectForWindow(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /* dev */,
+ WindowPtr /* pWin */,
+ ClientPtr /* client */,
+ Mask /* mask */,
+ Mask /* exclusivemasks */,
+ Mask /* validmasks */
+#endif
+ );
+
+int
+AddExtensionClient (
+#if NeedFunctionPrototypes
+ WindowPtr /* pWin */,
+ ClientPtr /* client */,
+ Mask /* mask */,
+ int /* mskidx */
+#endif
+ );
+
+void
+RecalculateDeviceDeliverableEvents(
+#if NeedFunctionPrototypes
+ WindowPtr /* pWin */
+#endif
+ );
+
+int
+InputClientGone(
+#if NeedFunctionPrototypes
+ WindowPtr /* pWin */,
+ XID /* id */
+#endif
+ );
+
+int
+SendEvent (
+#if NeedFunctionPrototypes
+ ClientPtr /* client */,
+ DeviceIntPtr /* d */,
+ Window /* dest */,
+ Bool /* propagate */,
+ xEvent * /* ev */,
+ Mask /* mask */,
+ int /* count */
+#endif
+ );
+
+int
+SetButtonMapping (
+#if NeedFunctionPrototypes
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ int /* nElts */,
+ BYTE * /* map */
+#endif
+ );
+
+int
+SetModifierMapping(
+#if NeedFunctionPrototypes
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ int /* len */,
+ int /* rlen */,
+ int /* numKeyPerModifier */,
+ KeyCode * /* inputMap */,
+ KeyClassPtr * /* k */
+#endif
+ );
+
+void
+SendDeviceMappingNotify(
+#if NeedFunctionPrototypes
+ CARD8 /* request, */,
+ KeyCode /* firstKeyCode */,
+ CARD8 /* count */,
+ DeviceIntPtr /* dev */
+#endif
+);
+
+int
+ChangeKeyMapping(
+#if NeedFunctionPrototypes
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ unsigned /* len */,
+ int /* type */,
+ KeyCode /* firstKeyCode */,
+ CARD8 /* keyCodes */,
+ CARD8 /* keySymsPerKeyCode */,
+ KeySym * /* map */
+#endif
+ );
+
+void
+DeleteWindowFromAnyExtEvents(
+#if NeedFunctionPrototypes
+ WindowPtr /* pWin */,
+ Bool /* freeResources */
+#endif
+);
+
+void
+DeleteDeviceFromAnyExtEvents(
+#if NeedFunctionPrototypes
+ WindowPtr /* pWin */,
+ DeviceIntPtr /* dev */
+#endif
+ );
+
+int
+MaybeSendDeviceMotionNotifyHint (
+#if NeedFunctionPrototypes
+ deviceKeyButtonPointer * /* pEvents */,
+ Mask /* mask */
+#endif
+);
+
+void
+CheckDeviceGrabAndHintWindow (
+#if NeedFunctionPrototypes
+ WindowPtr /* pWin */,
+ int /* type */,
+ deviceKeyButtonPointer * /* xE */,
+ GrabPtr /* grab */,
+ ClientPtr /* client */,
+ Mask /* deliveryMask */
+#endif
+ );
+
+Mask
+DeviceEventMaskForClient(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /* dev */,
+ WindowPtr /* pWin */,
+ ClientPtr /* client */
+#endif
+);
+
+void
+MaybeStopDeviceHint(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /* dev */,
+ ClientPtr /* client */
+#endif
+ );
+
+int
+DeviceEventSuppressForWindow(
+#if NeedFunctionPrototypes
+ WindowPtr /* pWin */,
+ ClientPtr /* client */,
+ Mask /* mask */,
+ int /* maskndx */
+#endif
+ );
+
+#endif /* EXEVENTS_H */
diff --git a/Xincludes/xc/programs/Xserver/include/gc.h b/Xincludes/xc/programs/Xserver/include/gc.h
new file mode 100644
index 0000000..4920f84
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/gc.h
@@ -0,0 +1,232 @@
+/* $XFree86: xc/programs/Xserver/include/gc.h,v 1.4 2001/01/17 22:36:57 dawes 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.
+
+******************************************************************/
+/* $Xorg: gc.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
+
+#ifndef GC_H
+#define GC_H
+
+#include "X11/X.h" /* for GContext, Mask */
+#include "Xdefs.h" /* for Bool */
+#include "X11/Xproto.h"
+#include "screenint.h" /* for ScreenPtr */
+#include "pixmap.h" /* for DrawablePtr */
+
+/* clientClipType field in GC */
+#define CT_NONE 0
+#define CT_PIXMAP 1
+#define CT_REGION 2
+#define CT_UNSORTED 6
+#define CT_YSORTED 10
+#define CT_YXSORTED 14
+#define CT_YXBANDED 18
+
+#define GCQREASON_VALIDATE 1
+#define GCQREASON_CHANGE 2
+#define GCQREASON_COPY_SRC 3
+#define GCQREASON_COPY_DST 4
+#define GCQREASON_DESTROY 5
+
+#define GC_CHANGE_SERIAL_BIT (((unsigned long)1)<<31)
+#define GC_CALL_VALIDATE_BIT (1L<<30)
+#define GCExtensionInterest (1L<<29)
+
+#define DRAWABLE_SERIAL_BITS (~(GC_CHANGE_SERIAL_BIT))
+
+#define MAX_SERIAL_NUM (1L<<28)
+
+#define NEXT_SERIAL_NUMBER ((++globalSerialNumber) > MAX_SERIAL_NUM ? \
+ (globalSerialNumber = 1): globalSerialNumber)
+
+typedef struct _GCInterest *GCInterestPtr;
+typedef struct _GC *GCPtr;
+typedef struct _GCOps *GCOpsPtr;
+
+extern void ValidateGC(
+#if NeedFunctionPrototypes
+ DrawablePtr /*pDraw*/,
+ GCPtr /*pGC*/
+#endif
+);
+
+extern int ChangeGC(
+#if NeedFunctionPrototypes
+ GCPtr/*pGC*/,
+ BITS32 /*mask*/,
+ XID* /*pval*/
+#endif
+);
+
+extern int DoChangeGC(
+#if NeedFunctionPrototypes
+ GCPtr/*pGC*/,
+ BITS32 /*mask*/,
+ XID* /*pval*/,
+ int /*fPointer*/
+#endif
+);
+
+typedef union {
+ CARD32 val;
+ pointer ptr;
+} ChangeGCVal, *ChangeGCValPtr;
+
+extern int dixChangeGC(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/,
+ GCPtr /*pGC*/,
+ BITS32 /*mask*/,
+ CARD32 * /*pval*/,
+ ChangeGCValPtr /*pCGCV*/
+#endif
+);
+
+extern GCPtr CreateGC(
+#if NeedFunctionPrototypes
+ DrawablePtr /*pDrawable*/,
+ BITS32 /*mask*/,
+ XID* /*pval*/,
+ int* /*pStatus*/
+#endif
+);
+
+extern int CopyGC(
+#if NeedFunctionPrototypes
+ GCPtr/*pgcSrc*/,
+ GCPtr/*pgcDst*/,
+ BITS32 /*mask*/
+#endif
+);
+
+extern int FreeGC(
+#if NeedFunctionPrototypes
+ pointer /*pGC*/,
+ XID /*gid*/
+#endif
+);
+
+extern void SetGCMask(
+#if NeedFunctionPrototypes
+ GCPtr /*pGC*/,
+ Mask /*selectMask*/,
+ Mask /*newDataMask*/
+#endif
+);
+
+extern GCPtr CreateScratchGC(
+#if NeedFunctionPrototypes
+ ScreenPtr /*pScreen*/,
+ unsigned /*depth*/
+#endif
+);
+
+extern void FreeGCperDepth(
+#if NeedFunctionPrototypes
+ int /*screenNum*/
+#endif
+);
+
+extern Bool CreateGCperDepth(
+#if NeedFunctionPrototypes
+ int /*screenNum*/
+#endif
+);
+
+extern Bool CreateDefaultStipple(
+#if NeedFunctionPrototypes
+ int /*screenNum*/
+#endif
+);
+
+extern void FreeDefaultStipple(
+#if NeedFunctionPrototypes
+ int /*screenNum*/
+#endif
+);
+
+extern int SetDashes(
+#if NeedFunctionPrototypes
+ GCPtr /*pGC*/,
+ unsigned /*offset*/,
+ unsigned /*ndash*/,
+ unsigned char* /*pdash*/
+#endif
+);
+
+extern int VerifyRectOrder(
+#if NeedFunctionPrototypes
+ int /*nrects*/,
+ xRectangle* /*prects*/,
+ int /*ordering*/
+#endif
+);
+
+extern int SetClipRects(
+#if NeedFunctionPrototypes
+ GCPtr /*pGC*/,
+ int /*xOrigin*/,
+ int /*yOrigin*/,
+ int /*nrects*/,
+ xRectangle* /*prects*/,
+ int /*ordering*/
+#endif
+);
+
+extern GCPtr GetScratchGC(
+#if NeedFunctionPrototypes
+ unsigned /*depth*/,
+ ScreenPtr /*pScreen*/
+#endif
+);
+
+extern void FreeScratchGC(
+#if NeedFunctionPrototypes
+ GCPtr /*pGC*/
+#endif
+);
+
+#endif /* GC_H */
diff --git a/Xincludes/xc/programs/Xserver/include/globals.h b/Xincludes/xc/programs/Xserver/include/globals.h
new file mode 100644
index 0000000..c193829
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/globals.h
@@ -0,0 +1,52 @@
+/* $XFree86: xc/programs/Xserver/include/globals.h,v 1.3 1999/09/25 14:38:21 dawes Exp $ */
+
+#ifndef _XSERV_GLOBAL_H_
+#define _XSERV_GLOBAL_H_
+
+#include "window.h" /* for WindowPtr */
+
+/* Global X server variables that are visible to mi, dix, os, and ddx */
+
+extern CARD32 defaultScreenSaverTime;
+extern CARD32 defaultScreenSaverInterval;
+extern CARD32 ScreenSaverTime;
+extern CARD32 ScreenSaverInterval;
+
+extern char *defaultFontPath;
+extern char *rgbPath;
+extern int monitorResolution;
+extern Bool loadableFonts;
+extern int defaultColorVisualClass;
+
+extern Bool Must_have_memory;
+extern WindowPtr *WindowTable;
+extern int GrabInProgress;
+extern Bool noTestExtensions;
+
+extern DDXPointRec dixScreenOrigins[MAXSCREENS];
+
+#ifdef DPMSExtension
+extern CARD32 defaultDPMSStandbyTime;
+extern CARD32 defaultDPMSSuspendTime;
+extern CARD32 defaultDPMSOffTime;
+extern CARD32 DPMSStandbyTime;
+extern CARD32 DPMSSuspendTime;
+extern CARD32 DPMSOffTime;
+extern CARD16 DPMSPowerLevel;
+extern Bool defaultDPMSEnabled;
+extern Bool DPMSEnabled;
+extern Bool DPMSEnabledSwitch;
+extern Bool DPMSDisabledSwitch;
+extern Bool DPMSCapableFlag;
+#endif
+
+#ifdef PANORAMIX
+extern Bool noPanoramiXExtension;
+extern Bool PanoramiXMapped;
+extern Bool PanoramiXVisibilityNotifySent;
+extern Bool PanoramiXWindowExposureSent;
+extern Bool PanoramiXOneExposeRequest;
+#endif
+
+
+#endif /* _XSERV_GLOBAL_H_ */
diff --git a/Xincludes/xc/programs/Xserver/include/input.h b/Xincludes/xc/programs/Xserver/include/input.h
new file mode 100644
index 0000000..6216f03
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/input.h
@@ -0,0 +1,535 @@
+/* $Xorg: input.h,v 1.4 2001/02/09 02:05:15 xorgcvs 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.
+
+********************************************************/
+/* $XFree86: xc/programs/Xserver/include/input.h,v 3.6 2001/01/17 22:36:57 dawes Exp $ */
+
+#ifndef INPUT_H
+#define INPUT_H
+
+#include "misc.h"
+#include "screenint.h"
+#include "X11/Xmd.h"
+#include "X11/Xproto.h"
+#include "window.h" /* for WindowPtr */
+
+#define DEVICE_INIT 0
+#define DEVICE_ON 1
+#define DEVICE_OFF 2
+#define DEVICE_CLOSE 3
+
+#define MAP_LENGTH 256
+#define DOWN_LENGTH 32 /* 256/8 => number of bytes to hold 256 bits */
+#define NullGrab ((GrabPtr)NULL)
+#define PointerRootWin ((WindowPtr)PointerRoot)
+#define NoneWin ((WindowPtr)None)
+#define NullDevice ((DevicePtr)NULL)
+
+#ifndef FollowKeyboard
+#define FollowKeyboard 3
+#endif
+#ifndef FollowKeyboardWin
+#define FollowKeyboardWin ((WindowPtr) FollowKeyboard)
+#endif
+#ifndef RevertToFollowKeyboard
+#define RevertToFollowKeyboard 3
+#endif
+
+typedef unsigned long Leds;
+typedef struct _OtherClients *OtherClientsPtr;
+typedef struct _InputClients *InputClientsPtr;
+typedef struct _DeviceIntRec *DeviceIntPtr;
+
+typedef int (*DeviceProc)(
+#if NeedNestedPrototypes
+ DeviceIntPtr /*device*/,
+ int /*what*/
+#endif
+);
+
+typedef void (*ProcessInputProc)(
+#if NeedNestedPrototypes
+ xEventPtr /*events*/,
+ DeviceIntPtr /*device*/,
+ int /*count*/
+#endif
+);
+
+typedef struct _DeviceRec {
+ pointer devicePrivate;
+ ProcessInputProc processInputProc; /* current */
+ ProcessInputProc realInputProc; /* deliver */
+ ProcessInputProc enqueueInputProc; /* enqueue */
+ Bool on; /* used by DDX to keep state */
+} DeviceRec, *DevicePtr;
+
+typedef struct {
+ int click, bell, bell_pitch, bell_duration;
+ Bool autoRepeat;
+ unsigned char autoRepeats[32];
+ Leds leds;
+ unsigned char id;
+} KeybdCtrl;
+
+typedef struct {
+ KeySym *map;
+ KeyCode minKeyCode,
+ maxKeyCode;
+ int mapWidth;
+} KeySymsRec, *KeySymsPtr;
+
+typedef struct {
+ int num, den, threshold;
+ unsigned char id;
+} PtrCtrl;
+
+typedef struct {
+ int resolution, min_value, max_value;
+ int integer_displayed;
+ unsigned char id;
+} IntegerCtrl;
+
+typedef struct {
+ int max_symbols, num_symbols_supported;
+ int num_symbols_displayed;
+ KeySym *symbols_supported;
+ KeySym *symbols_displayed;
+ unsigned char id;
+} StringCtrl;
+
+typedef struct {
+ int percent, pitch, duration;
+ unsigned char id;
+} BellCtrl;
+
+typedef struct {
+ Leds led_values;
+ Mask led_mask;
+ unsigned char id;
+} LedCtrl;
+
+extern KeybdCtrl defaultKeyboardControl;
+extern PtrCtrl defaultPointerControl;
+
+#undef AddInputDevice
+extern DevicePtr AddInputDevice(
+#if NeedFunctionPrototypes
+ DeviceProc /*deviceProc*/,
+ Bool /*autoStart*/
+#endif
+);
+
+#define AddInputDevice(deviceProc, autoStart) \
+ _AddInputDevice(deviceProc, autoStart)
+
+extern DeviceIntPtr _AddInputDevice(
+#if NeedFunctionPrototypes
+ DeviceProc /*deviceProc*/,
+ Bool /*autoStart*/
+#endif
+);
+
+extern Bool EnableDevice(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /*device*/
+#endif
+);
+
+extern Bool DisableDevice(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /*device*/
+#endif
+);
+
+extern int InitAndStartDevices(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void CloseDownDevices(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void RemoveDevice(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /*dev*/
+#endif
+);
+
+extern int NumMotionEvents(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+#undef RegisterPointerDevice
+extern void RegisterPointerDevice(
+#if NeedFunctionPrototypes
+ DevicePtr /*device*/
+#endif
+);
+
+#define RegisterPointerDevice(device) \
+ _RegisterPointerDevice(device)
+
+extern void _RegisterPointerDevice(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /*device*/
+#endif
+);
+
+#undef RegisterKeyboardDevice
+extern void RegisterKeyboardDevice(
+#if NeedFunctionPrototypes
+ DevicePtr /*device*/
+#endif
+);
+
+#define RegisterKeyboardDevice(device) \
+ _RegisterKeyboardDevice(device)
+
+extern void _RegisterKeyboardDevice(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /*device*/
+#endif
+);
+
+extern DevicePtr LookupKeyboardDevice(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern DevicePtr LookupPointerDevice(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern DevicePtr LookupDevice(
+#if NeedFunctionPrototypes
+ int /* id */
+#endif
+);
+
+extern void QueryMinMaxKeyCodes(
+#if NeedFunctionPrototypes
+ KeyCode* /*minCode*/,
+ KeyCode* /*maxCode*/
+#endif
+);
+
+extern Bool SetKeySymsMap(
+#if NeedFunctionPrototypes
+ KeySymsPtr /*dst*/,
+ KeySymsPtr /*src*/
+#endif
+);
+
+extern Bool InitKeyClassDeviceStruct(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /*device*/,
+ KeySymsPtr /*pKeySyms*/,
+ CARD8 /*pModifiers*/[]
+#endif
+);
+
+extern Bool InitButtonClassDeviceStruct(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /*device*/,
+ int /*numButtons*/,
+ CARD8* /*map*/
+#endif
+);
+
+typedef int (*ValuatorMotionProcPtr)(
+#if NeedNestedPrototypes
+ DeviceIntPtr /*pdevice*/,
+ xTimecoord * /*coords*/,
+ unsigned long /*start*/,
+ unsigned long /*stop*/,
+ ScreenPtr /*pScreen*/
+#endif
+);
+
+extern Bool InitValuatorClassDeviceStruct(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /*device*/,
+ int /*numAxes*/,
+ ValuatorMotionProcPtr /* motionProc */,
+ int /*numMotionEvents*/,
+ int /*mode*/
+#endif
+);
+
+extern Bool InitFocusClassDeviceStruct(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /*device*/
+#endif
+);
+
+typedef void (*BellProcPtr)(
+#if NeedNestedPrototypes
+ int /*percent*/,
+ DeviceIntPtr /*device*/,
+ pointer /*ctrl*/,
+ int
+#endif
+);
+
+typedef void (*KbdCtrlProcPtr)(
+#if NeedNestedPrototypes
+ DeviceIntPtr /*device*/,
+ KeybdCtrl * /*ctrl*/
+#endif
+);
+
+extern Bool InitKbdFeedbackClassDeviceStruct(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /*device*/,
+ BellProcPtr /*bellProc*/,
+ KbdCtrlProcPtr /*controlProc*/
+#endif
+);
+
+typedef void (*PtrCtrlProcPtr)(
+#if NeedNestedPrototypes
+ DeviceIntPtr /*device*/,
+ PtrCtrl * /*ctrl*/
+#endif
+);
+
+extern Bool InitPtrFeedbackClassDeviceStruct(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /*device*/,
+ PtrCtrlProcPtr /*controlProc*/
+#endif
+);
+
+typedef void (*StringCtrlProcPtr)(
+#if NeedNestedPrototypes
+ DeviceIntPtr /*device*/,
+ StringCtrl * /*ctrl*/
+#endif
+);
+
+extern Bool InitStringFeedbackClassDeviceStruct(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /*device*/,
+ StringCtrlProcPtr /*controlProc*/,
+ int /*max_symbols*/,
+ int /*num_symbols_supported*/,
+ KeySym* /*symbols*/
+#endif
+);
+
+typedef void (*BellCtrlProcPtr)(
+#if NeedNestedPrototypes
+ DeviceIntPtr /*device*/,
+ BellCtrl * /*ctrl*/
+#endif
+);
+
+extern Bool InitBellFeedbackClassDeviceStruct(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /*device*/,
+ BellProcPtr /*bellProc*/,
+ BellCtrlProcPtr /*controlProc*/
+#endif
+);
+
+typedef void (*LedCtrlProcPtr)(
+#if NeedNestedPrototypes
+ DeviceIntPtr /*device*/,
+ LedCtrl * /*ctrl*/
+#endif
+);
+
+extern Bool InitLedFeedbackClassDeviceStruct(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /*device*/,
+ LedCtrlProcPtr /*controlProc*/
+#endif
+);
+
+typedef void (*IntegerCtrlProcPtr)(
+#if NeedNestedPrototypes
+ DeviceIntPtr /*device*/,
+ IntegerCtrl * /*ctrl*/
+#endif
+);
+
+
+extern Bool InitIntegerFeedbackClassDeviceStruct(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /*device*/,
+ IntegerCtrlProcPtr /*controlProc*/
+#endif
+);
+
+extern Bool InitPointerDeviceStruct(
+#if NeedFunctionPrototypes
+ DevicePtr /*device*/,
+ CARD8* /*map*/,
+ int /*numButtons*/,
+ ValuatorMotionProcPtr /*motionProc*/,
+ PtrCtrlProcPtr /*controlProc*/,
+ int /*numMotionEvents*/
+#endif
+);
+
+extern Bool InitKeyboardDeviceStruct(
+#if NeedFunctionPrototypes
+ DevicePtr /*device*/,
+ KeySymsPtr /*pKeySyms*/,
+ CARD8 /*pModifiers*/[],
+ BellProcPtr /*bellProc*/,
+ KbdCtrlProcPtr /*controlProc*/
+#endif
+);
+
+extern void SendMappingNotify(
+#if NeedFunctionPrototypes
+ unsigned int /*request*/,
+ unsigned int /*firstKeyCode*/,
+ unsigned int /*count*/,
+ ClientPtr /* client */
+#endif
+);
+
+extern Bool BadDeviceMap(
+#if NeedFunctionPrototypes
+ BYTE* /*buff*/,
+ int /*length*/,
+ unsigned /*low*/,
+ unsigned /*high*/,
+ XID* /*errval*/
+#endif
+);
+
+extern Bool AllModifierKeysAreUp(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /*device*/,
+ CARD8* /*map1*/,
+ int /*per1*/,
+ CARD8* /*map2*/,
+ int /*per2*/
+#endif
+);
+
+extern void NoteLedState(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /*keybd*/,
+ int /*led*/,
+ Bool /*on*/
+#endif
+);
+
+extern void MaybeStopHint(
+#if NeedFunctionPrototypes
+ DeviceIntPtr /*device*/,
+ ClientPtr /*client*/
+#endif
+);
+
+extern void ProcessPointerEvent(
+#if NeedFunctionPrototypes
+ xEventPtr /*xE*/,
+ DeviceIntPtr /*mouse*/,
+ int /*count*/
+#endif
+);
+
+extern void ProcessKeyboardEvent(
+#if NeedFunctionPrototypes
+ xEventPtr /*xE*/,
+ DeviceIntPtr /*keybd*/,
+ int /*count*/
+#endif
+);
+
+#ifdef XKB
+extern void CoreProcessPointerEvent(
+#if NeedFunctionPrototypes
+ xEventPtr /*xE*/,
+ DeviceIntPtr /*mouse*/,
+ int /*count*/
+#endif
+);
+
+extern void CoreProcessKeyboardEvent(
+#if NeedFunctionPrototypes
+ xEventPtr /*xE*/,
+ DeviceIntPtr /*keybd*/,
+ int /*count*/
+#endif
+);
+#endif
+
+extern Bool LegalModifier(
+#if NeedFunctionPrototypes
+ unsigned int /*key*/,
+ DevicePtr /*pDev*/
+#endif
+);
+
+extern void ProcessInputEvents(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void InitInput(
+#if NeedFunctionPrototypes
+ int /*argc*/,
+ char ** /*argv*/
+#endif
+);
+
+#endif /* INPUT_H */
diff --git a/Xincludes/xc/programs/Xserver/include/inputstr.h b/Xincludes/xc/programs/Xserver/include/inputstr.h
new file mode 100644
index 0000000..35ade32
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/inputstr.h
@@ -0,0 +1,317 @@
+/* $XFree86: xc/programs/Xserver/include/inputstr.h,v 1.4 2001/01/17 22:36:57 dawes 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.
+
+********************************************************/
+
+/* $Xorg: inputstr.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
+
+#ifndef INPUTSTRUCT_H
+#define INPUTSTRUCT_H
+
+#include "input.h"
+#include "window.h"
+#include "dixstruct.h"
+
+#define BitIsOn(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))
+
+#define SameClient(obj,client) \
+ (CLIENT_BITS((obj)->resource) == (client)->clientAsMask)
+
+#define MAX_DEVICES 20
+
+#define EMASKSIZE MAX_DEVICES
+
+/* Kludge: OtherClients and InputClients must be compatible, see code */
+
+typedef struct _OtherClients {
+ OtherClientsPtr next;
+ XID resource; /* id for putting into resource manager */
+ Mask mask;
+} OtherClients;
+
+typedef struct _InputClients {
+ InputClientsPtr next;
+ XID resource; /* id for putting into resource manager */
+ Mask mask[EMASKSIZE];
+} InputClients;
+
+typedef struct _OtherInputMasks {
+ Mask deliverableEvents[EMASKSIZE];
+ Mask inputEvents[EMASKSIZE];
+ Mask dontPropagateMask[EMASKSIZE];
+ InputClientsPtr inputClients;
+} OtherInputMasks;
+
+/*
+ * The following structure gets used for both active and passive grabs. For
+ * active grabs some of the fields (e.g. modifiers) are not used. However,
+ * that is not much waste since there aren't many active grabs (one per
+ * keyboard/pointer device) going at once in the server.
+ */
+
+#define MasksPerDetailMask 8 /* 256 keycodes and 256 possible
+ modifier combinations, but only
+ 3 buttons. */
+
+ typedef struct _DetailRec { /* Grab details may be bit masks */
+ unsigned short exact;
+ Mask *pMask;
+ } DetailRec;
+
+ typedef struct _GrabRec {
+ GrabPtr next; /* for chain of passive grabs */
+ XID resource;
+ DeviceIntPtr device;
+ WindowPtr window;
+ unsigned ownerEvents:1;
+ unsigned keyboardMode:1;
+ unsigned pointerMode:1;
+ unsigned coreGrab:1; /* grab is on core device */
+ unsigned coreMods:1; /* modifiers are on core keyboard */
+ CARD8 type; /* event type */
+ DetailRec modifiersDetail;
+ DeviceIntPtr modifierDevice;
+ DetailRec detail; /* key or button */
+ WindowPtr confineTo; /* always NULL for keyboards */
+ CursorPtr cursor; /* always NULL for keyboards */
+ Mask eventMask;
+} GrabRec;
+
+typedef struct _KeyClassRec {
+ CARD8 down[DOWN_LENGTH];
+ KeyCode *modifierKeyMap;
+ KeySymsRec curKeySyms;
+ int modifierKeyCount[8];
+ CARD8 modifierMap[MAP_LENGTH];
+ CARD8 maxKeysPerModifier;
+ unsigned short state;
+ unsigned short prev_state;
+#ifdef XKB
+ struct _XkbSrvInfo *xkbInfo;
+#endif
+} KeyClassRec, *KeyClassPtr;
+
+typedef struct _AxisInfo {
+ int resolution;
+ int min_resolution;
+ int max_resolution;
+ int min_value;
+ int max_value;
+} AxisInfo, *AxisInfoPtr;
+
+typedef struct _ValuatorClassRec {
+ ValuatorMotionProcPtr GetMotionProc;
+ int numMotionEvents;
+ WindowPtr motionHintWindow;
+ AxisInfoPtr axes;
+ unsigned short numAxes;
+ int *axisVal;
+ CARD8 mode;
+} ValuatorClassRec, *ValuatorClassPtr;
+
+typedef struct _ButtonClassRec {
+ CARD8 numButtons;
+ CARD8 buttonsDown; /* number of buttons currently down */
+ unsigned short state;
+ Mask motionMask;
+ CARD8 down[DOWN_LENGTH];
+ CARD8 map[MAP_LENGTH];
+#ifdef XKB
+ union _XkbAction * xkb_acts;
+#endif
+} ButtonClassRec, *ButtonClassPtr;
+
+typedef struct _FocusClassRec {
+ WindowPtr win;
+ int revert;
+ TimeStamp time;
+ WindowPtr *trace;
+ int traceSize;
+ int traceGood;
+} FocusClassRec, *FocusClassPtr;
+
+typedef struct _ProximityClassRec {
+ char pad;
+} ProximityClassRec, *ProximityClassPtr;
+
+typedef struct _KbdFeedbackClassRec *KbdFeedbackPtr;
+typedef struct _PtrFeedbackClassRec *PtrFeedbackPtr;
+typedef struct _IntegerFeedbackClassRec *IntegerFeedbackPtr;
+typedef struct _StringFeedbackClassRec *StringFeedbackPtr;
+typedef struct _BellFeedbackClassRec *BellFeedbackPtr;
+typedef struct _LedFeedbackClassRec *LedFeedbackPtr;
+
+typedef struct _KbdFeedbackClassRec {
+ BellProcPtr BellProc;
+ KbdCtrlProcPtr CtrlProc;
+ KeybdCtrl ctrl;
+ KbdFeedbackPtr next;
+#ifdef XKB
+ struct _XkbSrvLedInfo *xkb_sli;
+#endif
+} KbdFeedbackClassRec;
+
+typedef struct _PtrFeedbackClassRec {
+ PtrCtrlProcPtr CtrlProc;
+ PtrCtrl ctrl;
+ PtrFeedbackPtr next;
+} PtrFeedbackClassRec;
+
+typedef struct _IntegerFeedbackClassRec {
+ IntegerCtrlProcPtr CtrlProc;
+ IntegerCtrl ctrl;
+ IntegerFeedbackPtr next;
+} IntegerFeedbackClassRec;
+
+typedef struct _StringFeedbackClassRec {
+ StringCtrlProcPtr CtrlProc;
+ StringCtrl ctrl;
+ StringFeedbackPtr next;
+} StringFeedbackClassRec;
+
+typedef struct _BellFeedbackClassRec {
+ BellProcPtr BellProc;
+ BellCtrlProcPtr CtrlProc;
+ BellCtrl ctrl;
+ BellFeedbackPtr next;
+} BellFeedbackClassRec;
+
+typedef struct _LedFeedbackClassRec {
+ LedCtrlProcPtr CtrlProc;
+ LedCtrl ctrl;
+ LedFeedbackPtr next;
+#ifdef XKB
+ struct _XkbSrvLedInfo *xkb_sli;
+#endif
+} LedFeedbackClassRec;
+
+/* states for devices */
+
+#define NOT_GRABBED 0
+#define THAWED 1
+#define THAWED_BOTH 2 /* not a real state */
+#define FREEZE_NEXT_EVENT 3
+#define FREEZE_BOTH_NEXT_EVENT 4
+#define FROZEN 5 /* any state >= has device frozen */
+#define FROZEN_NO_EVENT 5
+#define FROZEN_WITH_EVENT 6
+#define THAW_OTHERS 7
+
+typedef struct _DeviceIntRec {
+ DeviceRec public;
+ DeviceIntPtr next;
+ TimeStamp grabTime;
+ Bool startup; /* true if needs to be turned on at
+ server intialization time */
+ DeviceProc deviceProc; /* proc(DevicePtr, DEVICE_xx). It is
+ used to initialize, turn on, or
+ turn off the device */
+ Bool inited; /* TRUE if INIT returns Success */
+ GrabPtr grab; /* the grabber - used by DIX */
+ struct {
+ Bool frozen;
+ int state;
+ GrabPtr other; /* if other grab has this frozen */
+ xEvent *event; /* saved to be replayed */
+ int evcount;
+ } sync;
+ Atom type;
+ char *name;
+ CARD8 id;
+ CARD8 activatingKey;
+ Bool fromPassiveGrab;
+ GrabRec activeGrab;
+ void (*ActivateGrab) (
+#if NeedNestedPrototypes
+ DeviceIntPtr /*device*/,
+ GrabPtr /*grab*/,
+ TimeStamp /*time*/,
+ Bool /*autoGrab*/
+#endif
+);
+ void (*DeactivateGrab)(
+#if NeedNestedPrototypes
+ DeviceIntPtr /*device*/
+#endif
+);
+ KeyClassPtr key;
+ ValuatorClassPtr valuator;
+ ButtonClassPtr button;
+ FocusClassPtr focus;
+ ProximityClassPtr proximity;
+ KbdFeedbackPtr kbdfeed;
+ PtrFeedbackPtr ptrfeed;
+ IntegerFeedbackPtr intfeed;
+ StringFeedbackPtr stringfeed;
+ BellFeedbackPtr bell;
+ LedFeedbackPtr leds;
+#ifdef XKB
+ struct _XkbInterest * xkb_interest;
+#endif
+} DeviceIntRec;
+
+typedef struct {
+ int numDevices; /* total number of devices */
+ DeviceIntPtr devices; /* all devices turned on */
+ DeviceIntPtr off_devices; /* all devices turned off */
+ DeviceIntPtr keyboard; /* the main one for the server */
+ DeviceIntPtr pointer;
+} InputInfo;
+
+extern InputInfo inputInfo;
+
+/* for keeping the events for devices grabbed synchronously */
+typedef struct _QdEvent *QdEventPtr;
+typedef struct _QdEvent {
+ QdEventPtr next;
+ DeviceIntPtr device;
+ ScreenPtr pScreen; /* what screen the pointer was on */
+ unsigned long months; /* milliseconds is in the event */
+ xEvent *event;
+ int evcount;
+} QdEventRec;
+
+#endif /* INPUTSTRUCT_H */
diff --git a/Xincludes/xc/programs/Xserver/include/misc.h b/Xincludes/xc/programs/Xserver/include/misc.h
new file mode 100644
index 0000000..1afebb1
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/misc.h
@@ -0,0 +1,282 @@
+/* $XFree86: xc/programs/Xserver/include/misc.h,v 3.27 2001/07/25 15:05:09 dawes 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.
+
+Copyright 1992, 1993 Data General Corporation;
+Copyright 1992, 1993 OMRON Corporation
+
+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
+neither the name OMRON or DATA GENERAL be used in advertising or publicity
+pertaining to distribution of the software without specific, written prior
+permission of the party whose name is to be used. Neither OMRON or
+DATA GENERAL make any representation about the suitability of this software
+for any purpose. It is provided "as is" without express or implied warranty.
+
+OMRON AND DATA GENERAL EACH DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
+IN NO EVENT SHALL OMRON OR DATA GENERAL 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.
+
+******************************************************************/
+/* $Xorg: misc.h,v 1.5 2001/02/09 02:05:15 xorgcvs Exp $ */
+#ifndef MISC_H
+#define MISC_H 1
+/*
+ * X internal definitions
+ *
+ */
+
+extern unsigned long globalSerialNumber;
+extern unsigned long serverGeneration;
+
+#include <X11/Xosdefs.h>
+#include <X11/Xfuncproto.h>
+#include <X11/Xmd.h>
+#include <X11/X.h>
+#include <X11/Xdefs.h>
+
+#ifndef IN_MODULE
+#ifndef NULL
+#include <stddef.h>
+#endif
+#endif
+
+#ifndef MAXSCREENS
+#define MAXSCREENS 16
+#endif
+#define MAXCLIENTS 256
+#define MAXDITS 1
+#define MAXEXTENSIONS 128
+#define MAXFORMATS 8
+#define MAXVISUALS_PER_SCREEN 50
+
+typedef unsigned long PIXEL;
+typedef unsigned long ATOM;
+
+
+#ifndef TRUE
+#define TRUE 1
+#define FALSE 0
+#endif
+
+#ifndef _XTYPEDEF_CALLBACKLISTPTR
+typedef struct _CallbackList *CallbackListPtr; /* also in dix.h */
+#define _XTYPEDEF_CALLBACKLISTPTR
+#endif
+
+typedef struct _xReq *xReqPtr;
+
+#include "os.h" /* for ALLOCATE_LOCAL and DEALLOCATE_LOCAL */
+#ifndef IN_MODULE
+#include <X11/Xfuncs.h> /* for bcopy, bzero, and bcmp */
+#endif
+
+#define NullBox ((BoxPtr)0)
+#define MILLI_PER_MIN (1000 * 60)
+#define MILLI_PER_SECOND (1000)
+
+ /* this next is used with None and ParentRelative to tell
+ PaintWin() what to use to paint the background. Also used
+ in the macro IS_VALID_PIXMAP */
+
+#define USE_BACKGROUND_PIXEL 3
+#define USE_BORDER_PIXEL 3
+
+
+/* byte swap a 32-bit literal */
+#define lswapl(x) ((((x) & 0xff) << 24) |\
+ (((x) & 0xff00) << 8) |\
+ (((x) & 0xff0000) >> 8) |\
+ (((x) >> 24) & 0xff))
+
+/* byte swap a short literal */
+#define lswaps(x) ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff))
+
+#undef min
+#undef max
+
+#define min(a, b) (((a) < (b)) ? (a) : (b))
+#define max(a, b) (((a) > (b)) ? (a) : (b))
+#ifndef IN_MODULE
+/* abs() is a function, not a macro; include the file declaring
+ * it in case we haven't done that yet.
+ */
+#include <stdlib.h>
+#endif /* IN_MODULE */
+#ifndef Fabs
+#define Fabs(a) ((a) > 0.0 ? (a) : -(a)) /* floating absolute value */
+#endif
+#define sign(x) ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0))
+/* this assumes b > 0 */
+#define modulus(a, b, d) if (((d) = (a) % (b)) < 0) (d) += (b)
+/*
+ * return the least significant bit in x which is set
+ *
+ * This works on 1's complement and 2's complement machines.
+ * If you care about the extra instruction on 2's complement
+ * machines, change to ((x) & (-(x)))
+ */
+#define lowbit(x) ((x) & (~(x) + 1))
+
+#ifndef IN_MODULE
+/* XXX Not for modules */
+#include <limits.h>
+#if !defined(MAXSHORT) || !defined(MINSHORT) || \
+ !defined(MAXINT) || !defined(MININT)
+/*
+ * Some implementations #define these through <math.h>, so preclude
+ * #include'ing it later.
+ */
+
+#include <math.h>
+#endif
+#undef MAXSHORT
+#define MAXSHORT SHRT_MAX
+#undef MINSHORT
+#define MINSHORT SHRT_MIN
+#undef MAXINT
+#define MAXINT INT_MAX
+#undef MININT
+#define MININT INT_MIN
+
+#include <assert.h>
+#include <ctype.h>
+#include <stdio.h> /* for fopen, etc... */
+
+#endif
+
+/* some macros to help swap requests, replies, and events */
+
+#define LengthRestB(stuff) \
+ ((client->req_len << 2) - sizeof(*stuff))
+
+#define LengthRestS(stuff) \
+ ((client->req_len << 1) - (sizeof(*stuff) >> 1))
+
+#define LengthRestL(stuff) \
+ (client->req_len - (sizeof(*stuff) >> 2))
+
+#define SwapRestS(stuff) \
+ SwapShorts((short *)(stuff + 1), LengthRestS(stuff))
+
+#define SwapRestL(stuff) \
+ SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff))
+
+/* byte swap a 32-bit value */
+#define swapl(x, n) { \
+ n = ((char *) (x))[0];\
+ ((char *) (x))[0] = ((char *) (x))[3];\
+ ((char *) (x))[3] = n;\
+ n = ((char *) (x))[1];\
+ ((char *) (x))[1] = ((char *) (x))[2];\
+ ((char *) (x))[2] = n; }
+
+/* byte swap a short */
+#define swaps(x, n) { \
+ n = ((char *) (x))[0];\
+ ((char *) (x))[0] = ((char *) (x))[1];\
+ ((char *) (x))[1] = n; }
+
+/* copy 32-bit value from src to dst byteswapping on the way */
+#define cpswapl(src, dst) { \
+ ((char *)&(dst))[0] = ((char *) &(src))[3];\
+ ((char *)&(dst))[1] = ((char *) &(src))[2];\
+ ((char *)&(dst))[2] = ((char *) &(src))[1];\
+ ((char *)&(dst))[3] = ((char *) &(src))[0]; }
+
+/* copy short from src to dst byteswapping on the way */
+#define cpswaps(src, dst) { \
+ ((char *) &(dst))[0] = ((char *) &(src))[1];\
+ ((char *) &(dst))[1] = ((char *) &(src))[0]; }
+
+extern void SwapLongs(
+#if NeedFunctionPrototypes
+ CARD32 *list,
+ unsigned long count
+#endif
+);
+
+extern void SwapShorts(
+#if NeedFunctionPrototypes
+ short *list,
+ unsigned long count
+#endif
+);
+
+extern void MakePredeclaredAtoms(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern int Ones(
+#if NeedFunctionPrototypes
+ unsigned long /*mask*/
+#endif
+);
+
+typedef struct _xPoint *DDXPointPtr;
+typedef struct _Box *BoxPtr;
+typedef struct _xEvent *xEventPtr;
+typedef struct _xRectangle *xRectanglePtr;
+typedef struct _GrabRec *GrabPtr;
+
+/* typedefs from other places - duplicated here to minimize the amount
+ * of unnecessary junk that one would normally have to include to get
+ * these symbols defined
+ */
+
+#ifndef _XTYPEDEF_CHARINFOPTR
+typedef struct _CharInfo *CharInfoPtr; /* also in fonts/include/font.h */
+#define _XTYPEDEF_CHARINFOPTR
+#endif
+
+#endif /* MISC_H */
diff --git a/Xincludes/xc/programs/Xserver/include/miscstruct.h b/Xincludes/xc/programs/Xserver/include/miscstruct.h
new file mode 100644
index 0000000..13ae26b
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/miscstruct.h
@@ -0,0 +1,73 @@
+/* $Xorg: miscstruct.h,v 1.4 2001/02/09 02:05:15 xorgcvs 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.
+
+******************************************************************/
+/* $XFree86: xc/programs/Xserver/include/miscstruct.h,v 3.2 2001/01/17 22:36:57 dawes Exp $ */
+
+#ifndef MISCSTRUCT_H
+#define MISCSTRUCT_H 1
+
+#include "misc.h"
+#include "X11/Xprotostr.h"
+
+typedef xPoint DDXPointRec;
+
+typedef struct _Box {
+ short x1, y1, x2, y2;
+} BoxRec;
+
+typedef union _DevUnion {
+ pointer ptr;
+ long val;
+ unsigned long uval;
+ pointer (*fptr)(
+#if NeedFunctionPrototypes
+ void
+#endif
+ );
+} DevUnion;
+
+#endif /* MISCSTRUCT_H */
diff --git a/Xincludes/xc/programs/Xserver/include/opaque.h b/Xincludes/xc/programs/Xserver/include/opaque.h
new file mode 100644
index 0000000..2ca7e2e
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/opaque.h
@@ -0,0 +1,81 @@
+/* $Xorg: opaque.h,v 1.4 2001/02/09 02:05:15 xorgcvs 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.
+
+*/
+/* $XFree86: xc/programs/Xserver/include/opaque.h,v 1.9 2001/05/04 19:05:52 dawes Exp $ */
+
+#ifndef OPAQUE_H
+#define OPAQUE_H
+
+#include <X11/Xmd.h>
+
+#include "globals.h"
+
+extern char *defaultTextFont;
+extern char *defaultCursorFont;
+extern int MaxClients;
+extern char isItTimeToYield;
+extern char dispatchException;
+
+/* bit values for dispatchException */
+#define DE_RESET 1
+#define DE_TERMINATE 2
+#define DE_PRIORITYCHANGE 4 /* set when a client's priority changes */
+
+extern CARD32 TimeOutValue;
+extern int ScreenSaverBlanking;
+extern int ScreenSaverAllowExposures;
+extern int defaultScreenSaverBlanking;
+extern int defaultScreenSaverAllowExposures;
+extern int argcGlobal;
+extern char **argvGlobal;
+extern char *display;
+
+extern int defaultBackingStore;
+extern Bool disableBackingStore;
+extern Bool enableBackingStore;
+extern Bool disableSaveUnders;
+extern Bool PartialNetwork;
+#ifndef NOLOGOHACK
+extern int logoScreenSaver;
+#endif
+#ifdef RLIMIT_DATA
+extern int limitDataSpace;
+#endif
+#ifdef RLIMIT_STACK
+extern int limitStackSpace;
+#endif
+#ifdef RLIMIT_NOFILE
+extern int limitNoFile;
+#endif
+extern Bool permitOldBugs;
+extern Bool defeatAccessControl;
+extern char* protNoListen;
+
+
+
+#endif /* OPAQUE_H */
diff --git a/Xincludes/xc/programs/Xserver/include/os.h b/Xincludes/xc/programs/Xserver/include/os.h
new file mode 100644
index 0000000..fca3a17
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/os.h
@@ -0,0 +1,856 @@
+/* $XFree86: xc/programs/Xserver/include/os.h,v 3.39 2001/08/01 00:44:58 tsi 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.
+
+******************************************************************/
+
+/* $Xorg: os.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
+
+#ifndef OS_H
+#define OS_H
+#include "misc.h"
+#define ALLOCATE_LOCAL_FALLBACK(_size) Xalloc((unsigned long)(_size))
+#define DEALLOCATE_LOCAL_FALLBACK(_ptr) Xfree((pointer)(_ptr))
+#include "Xalloca.h"
+#ifndef IN_MODULE
+#include <stdarg.h>
+#else
+#include "xf86_ansic.h"
+#endif
+
+#define NullFID ((FID) 0)
+
+#define SCREEN_SAVER_ON 0
+#define SCREEN_SAVER_OFF 1
+#define SCREEN_SAVER_FORCER 2
+#define SCREEN_SAVER_CYCLE 3
+
+#ifndef MAX_REQUEST_SIZE
+#define MAX_REQUEST_SIZE 65535
+#endif
+#ifndef MAX_BIG_REQUEST_SIZE
+#define MAX_BIG_REQUEST_SIZE 1048575
+#endif
+
+typedef pointer FID;
+typedef struct _FontPathRec *FontPathPtr;
+typedef struct _NewClientRec *NewClientPtr;
+
+#ifndef xalloc
+#define xnfalloc(size) XNFalloc((unsigned long)(size))
+#define xnfcalloc(_num, _size) XNFcalloc((unsigned long)(_num)*(unsigned long)(_size))
+#define xnfrealloc(ptr, size) XNFrealloc((pointer)(ptr), (unsigned long)(size))
+
+#define xalloc(size) Xalloc((unsigned long)(size))
+#define xcalloc(_num, _size) Xcalloc((unsigned long)(_num)*(unsigned long)(_size))
+#define xrealloc(ptr, size) Xrealloc((pointer)(ptr), (unsigned long)(size))
+#define xfree(ptr) Xfree((pointer)(ptr))
+#define xstrdup(s) Xstrdup(s)
+#define xnfstrdup(s) XNFstrdup(s)
+#endif
+
+#ifndef IN_MODULE
+#ifdef SCO
+#include <stdio.h>
+#endif
+#include <string.h>
+#endif
+
+/* have to put $(SIGNAL_DEFINES) in DEFINES in Imakefile to get this right */
+#ifdef SIGNALRETURNSINT
+#define SIGVAL int
+#else
+#define SIGVAL void
+#endif
+
+extern Bool OsDelayInitColors;
+extern void (*OsVendorVErrorFProc)(const char *, va_list args);
+
+extern int WaitForSomething(
+#if NeedFunctionPrototypes
+ int* /*pClientsReady*/
+#endif
+);
+
+#ifdef LBX
+#define ReadRequestFromClient(client) ((client)->readRequest(client))
+extern int StandardReadRequestFromClient(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/
+#endif
+);
+
+extern int ClientConnectionNumber(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/
+#endif
+);
+#else
+extern int ReadRequestFromClient(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/
+#endif
+);
+#endif /* LBX */
+
+extern Bool InsertFakeRequest(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/,
+ char* /*data*/,
+ int /*count*/
+#endif
+);
+
+extern void ResetCurrentRequest(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/
+#endif
+);
+
+extern void FlushAllOutput(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void FlushIfCriticalOutputPending(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void SetCriticalOutputPending(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern int WriteToClient(
+#if NeedFunctionPrototypes
+ ClientPtr /*who*/,
+ int /*count*/,
+ char* /*buf*/
+#endif
+);
+
+extern void ResetOsBuffers(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void InitConnectionLimits(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void CreateWellKnownSockets(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void ResetWellKnownSockets(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void CloseWellKnownConnections(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern XID
+AuthorizationIDOfClient(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/
+#endif
+);
+
+extern char *ClientAuthorized(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/,
+ unsigned int /*proto_n*/,
+ char* /*auth_proto*/,
+ unsigned int /*string_n*/,
+ char* /*auth_string*/
+#endif
+);
+
+extern Bool EstablishNewConnections(
+#if NeedFunctionPrototypes
+ ClientPtr /*clientUnused*/,
+ pointer /*closure*/
+#endif
+);
+
+extern void CheckConnections(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void CloseDownConnection(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/
+#endif
+);
+
+extern void AddEnabledDevice(
+#if NeedFunctionPrototypes
+ int /*fd*/
+#endif
+);
+
+extern void RemoveEnabledDevice(
+#if NeedFunctionPrototypes
+ int /*fd*/
+#endif
+);
+
+extern void OnlyListenToOneClient(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/
+#endif
+);
+
+extern void ListenToAllClients(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void IgnoreClient(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/
+#endif
+);
+
+extern void AttendClient(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/
+#endif
+);
+
+extern void MakeClientGrabImpervious(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/
+#endif
+);
+
+extern void MakeClientGrabPervious(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/
+#endif
+);
+
+#ifdef LBX
+extern void CloseDownFileDescriptor(
+#if NeedFunctionPrototypes
+ ClientPtr /* client */
+#endif
+);
+#endif
+
+extern void AvailableClientInput(
+#if NeedFunctionPrototypes
+ ClientPtr /* client */
+#endif
+);
+
+extern void Error(
+#if NeedFunctionPrototypes
+ char* /*str*/
+#endif
+);
+
+extern CARD32 GetTimeInMillis(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void AdjustWaitForDelay(
+#if NeedFunctionPrototypes
+ pointer /*waitTime*/,
+ unsigned long /*newdelay*/
+#endif
+);
+
+typedef struct _OsTimerRec *OsTimerPtr;
+
+typedef CARD32 (*OsTimerCallback)(
+#if NeedFunctionPrototypes
+ OsTimerPtr /* timer */,
+ CARD32 /* time */,
+ pointer /* arg */
+#endif
+);
+
+extern void TimerInit(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern Bool TimerForce(
+#if NeedFunctionPrototypes
+ OsTimerPtr /* timer */
+#endif
+);
+
+#define TimerAbsolute (1<<0)
+#define TimerForceOld (1<<1)
+
+extern OsTimerPtr TimerSet(
+#if NeedFunctionPrototypes
+ OsTimerPtr /* timer */,
+ int /* flags */,
+ CARD32 /* millis */,
+ OsTimerCallback /* func */,
+ pointer /* arg */
+#endif
+);
+
+extern void TimerCheck(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void TimerCancel(
+#if NeedFunctionPrototypes
+ OsTimerPtr /* pTimer */
+#endif
+);
+
+extern void TimerFree(
+#if NeedFunctionPrototypes
+ OsTimerPtr /* pTimer */
+#endif
+);
+
+extern SIGVAL AutoResetServer(
+#if NeedFunctionPrototypes
+ int /*sig*/
+#endif
+);
+
+extern SIGVAL GiveUp(
+#if NeedFunctionPrototypes
+ int /*sig*/
+#endif
+);
+
+extern void UseMsg(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void ProcessCommandLine(
+#if NeedFunctionPrototypes
+ int /*argc*/,
+ char* /*argv*/[]
+#endif
+);
+
+extern pointer Xalloc(
+#if NeedFunctionPrototypes
+ unsigned long /*amount*/
+#endif
+);
+
+extern pointer XNFalloc(
+#if NeedFunctionPrototypes
+ unsigned long /*amount*/
+#endif
+);
+
+extern pointer Xcalloc(
+#if NeedFunctionPrototypes
+ unsigned long /*amount*/
+#endif
+);
+
+extern pointer XNFcalloc(
+#if NeedFunctionPrototypes
+ unsigned long /*amount*/
+#endif
+);
+
+extern pointer Xrealloc(
+#if NeedFunctionPrototypes
+ pointer /*ptr*/,
+ unsigned long /*amount*/
+#endif
+);
+
+extern pointer XNFrealloc(
+#if NeedFunctionPrototypes
+ pointer /*ptr*/,
+ unsigned long /*amount*/
+#endif
+);
+
+extern void Xfree(
+#if NeedFunctionPrototypes
+ pointer /*ptr*/
+#endif
+);
+
+extern void OsInitAllocator(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern char *Xstrdup(const char *s);
+extern char *XNFstrdup(const char *s);
+
+typedef SIGVAL (*OsSigHandlerPtr)(
+#if NeedFunctionPrototypes
+ int /* sig */
+#endif
+);
+
+extern OsSigHandlerPtr OsSignal(
+#if NeedFunctionPrototypes
+ int /* sig */,
+ OsSigHandlerPtr /* handler */
+#endif
+);
+
+extern int auditTrailLevel;
+
+extern void AuditPrefix(
+#if NeedFunctionPrototypes
+ const char *
+#endif
+);
+
+extern void AuditF(
+#if NeedVarargsPrototypes
+ const char* /*f*/,
+ ...
+#endif
+);
+
+extern void FatalError(
+#if NeedVarargsPrototypes
+ const char* /*f*/,
+ ...
+#endif
+)
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
+__attribute((noreturn))
+#endif
+;
+
+extern void ErrorF(
+#if NeedVarargsPrototypes
+ const char* /*f*/,
+ ...
+#endif
+);
+
+#if NeedVarargsPrototypes
+extern void VErrorF(const char *f, va_list args);
+#endif
+
+#ifdef SERVER_LOCK
+extern void LockServer(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void UnlockServer(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+#endif
+
+extern int OsLookupColor(
+#if NeedFunctionPrototypes
+ int /*screen*/,
+ char * /*name*/,
+ unsigned /*len*/,
+ unsigned short * /*pred*/,
+ unsigned short * /*pgreen*/,
+ unsigned short * /*pblue*/
+#endif
+);
+
+extern void OsInit(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void OsCleanup(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void OsVendorFatalError(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void OsVendorInit(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern int OsInitColors(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+void OsBlockSignals (
+#if NeedFunctionPrototypes
+ void
+#endif
+ );
+
+void OsReleaseSignals (
+#if NeedFunctionPrototypes
+ void
+#endif
+ );
+
+#if !defined(WIN32) && !defined(__EMX__)
+extern int System(char *);
+extern pointer Popen(char *, char *);
+extern int Pclose(pointer);
+#else
+#define System(a) system(a)
+#define Popen(a,b) popen(a,b)
+#define Pclose(a) pclose(a)
+#endif
+
+extern void CheckUserParameters(int argc, char **argv, char **envp);
+extern void CheckUserAuthorization(void);
+
+extern int AddHost(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/,
+ int /*family*/,
+ unsigned /*length*/,
+ pointer /*pAddr*/
+#endif
+);
+
+extern Bool ForEachHostInFamily (
+#if NeedFunctionPrototypes
+ int /*family*/,
+ Bool (* /*func*/ )(
+#if NeedNestedPrototypes
+ unsigned char * /* addr */,
+ short /* len */,
+ pointer /* closure */
+#endif
+ ),
+ pointer /*closure*/
+#endif
+);
+
+extern int RemoveHost(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/,
+ int /*family*/,
+ unsigned /*length*/,
+ pointer /*pAddr*/
+#endif
+);
+
+extern int GetHosts(
+#if NeedFunctionPrototypes
+ pointer * /*data*/,
+ int * /*pnHosts*/,
+ int * /*pLen*/,
+ BOOL * /*pEnabled*/
+#endif
+);
+
+typedef struct sockaddr * sockaddrPtr;
+
+extern int InvalidHost(
+#if NeedFunctionPrototypes
+ sockaddrPtr /*saddr*/,
+ int /*len*/
+#endif
+);
+
+extern int LocalClient(
+#if NeedFunctionPrototypes
+ ClientPtr /* client */
+#endif
+);
+
+extern int ChangeAccessControl(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/,
+ int /*fEnabled*/
+#endif
+);
+
+extern int GetAccessControl(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+
+extern void AddLocalHosts(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void ResetHosts(
+#if NeedFunctionPrototypes
+ char *display
+#endif
+);
+
+extern void EnableLocalHost(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void DisableLocalHost(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void AccessUsingXdmcp(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void DefineSelf(
+#if NeedFunctionPrototypes
+ int /*fd*/
+#endif
+);
+
+extern void AugmentSelf(
+#if NeedFunctionPrototypes
+ pointer /*from*/,
+ int /*len*/
+#endif
+);
+
+extern void InitAuthorization(
+#if NeedFunctionPrototypes
+ char * /*filename*/
+#endif
+);
+
+extern int LoadAuthorization(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void RegisterAuthorizations(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern XID AuthorizationToID (
+ unsigned short name_length,
+ char *name,
+ unsigned short data_length,
+ char *data);
+
+extern int AuthorizationFromID (
+ XID id,
+ unsigned short *name_lenp,
+ char **namep,
+ unsigned short *data_lenp,
+ char **datap);
+
+extern XID CheckAuthorization(
+#if NeedFunctionPrototypes
+ unsigned int /*namelength*/,
+ char * /*name*/,
+ unsigned int /*datalength*/,
+ char * /*data*/,
+ ClientPtr /*client*/,
+ char ** /*reason*/
+#endif
+);
+
+extern void ResetAuthorization(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern int RemoveAuthorization (
+ unsigned short name_length,
+ char *name,
+ unsigned short data_length,
+ char *data);
+
+extern int AddAuthorization(
+#if NeedFunctionPrototypes
+ unsigned int /*name_length*/,
+ char * /*name*/,
+ unsigned int /*data_length*/,
+ char * /*data*/
+#endif
+);
+
+extern XID GenerateAuthorization(
+#if NeedFunctionPrototypes
+ unsigned int /* name_length */,
+ char * /* name */,
+ unsigned int /* data_length */,
+ char * /* data */,
+ unsigned int * /* data_length_return */,
+ char ** /* data_return */
+#endif
+);
+
+#ifdef COMMANDLINE_CHALLENGED_OPERATING_SYSTEMS
+extern void ExpandCommandLine(
+#if NeedFunctionPrototypes
+ int * /*pargc*/,
+ char *** /*pargv*/
+#endif
+);
+#endif
+
+extern int ddxProcessArgument(
+#if NeedFunctionPrototypes
+ int /*argc*/,
+ char * /*argv*/ [],
+ int /*i*/
+#endif
+);
+
+extern void ddxUseMsg(void);
+
+/*
+ * idiom processing stuff
+ */
+
+xReqPtr PeekNextRequest(
+#if NeedFunctionPrototypes
+ xReqPtr req, ClientPtr client, Bool readmore
+#endif
+);
+
+void SkipRequests(
+#if NeedFunctionPrototypes
+ xReqPtr req, ClientPtr client, int numskipped
+#endif
+);
+
+/* int ReqLen(xReq *req, ClientPtr client)
+ * Given a pointer to a *complete* request, return its length in bytes.
+ * Note that if the request is a big request (as defined in the Big
+ * Requests extension), the macro lies by returning 4 less than the
+ * length that it actually occupies in the request buffer. This is so you
+ * can blindly compare the length with the various sz_<request> constants
+ * in Xproto.h without having to know/care about big requests.
+ */
+#define ReqLen(_pxReq, _client) \
+ ((_pxReq->length ? \
+ (_client->swapped ? lswaps(_pxReq->length) : _pxReq->length) \
+ : ((_client->swapped ? \
+ lswapl(((CARD32*)_pxReq)[1]) : ((CARD32*)_pxReq)[1])-1) \
+ ) << 2)
+
+/* otherReqTypePtr CastxReq(xReq *req, otherReqTypePtr)
+ * Cast the given request to one of type otherReqTypePtr to access
+ * fields beyond the length field.
+ */
+#define CastxReq(_pxReq, otherReqTypePtr) \
+ (_pxReq->length ? (otherReqTypePtr)_pxReq \
+ : (otherReqTypePtr)(((CARD32*)_pxReq)+1))
+
+/* stuff for SkippedRequestsCallback */
+extern CallbackListPtr SkippedRequestsCallback;
+typedef struct {
+ xReqPtr req;
+ ClientPtr client;
+ int numskipped;
+} SkippedRequestInfoRec;
+
+/* stuff for ReplyCallback */
+extern CallbackListPtr ReplyCallback;
+typedef struct {
+ ClientPtr client;
+ pointer replyData;
+ unsigned long dataLenBytes;
+ unsigned long bytesRemaining;
+ Bool startOfReply;
+} ReplyInfoRec;
+
+/* stuff for FlushCallback */
+extern CallbackListPtr FlushCallback;
+
+extern void AbortDDX(void);
+extern void ddxGiveUp(void);
+extern int TimeSinceLastInputEvent(void);
+
+#endif /* OS_H */
diff --git a/Xincludes/xc/programs/Xserver/include/pixmap.h b/Xincludes/xc/programs/Xserver/include/pixmap.h
new file mode 100644
index 0000000..7660910
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/pixmap.h
@@ -0,0 +1,123 @@
+/* $Xorg: pixmap.h,v 1.4 2001/02/09 02:05:15 xorgcvs 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 PIXMAP_H
+#define PIXMAP_H
+
+#include "misc.h"
+#include "screenint.h"
+
+/* types for Drawable */
+#define DRAWABLE_WINDOW 0
+#define DRAWABLE_PIXMAP 1
+#define UNDRAWABLE_WINDOW 2
+#define DRAWABLE_BUFFER 3
+
+/* flags to PaintWindow() */
+#define PW_BACKGROUND 0
+#define PW_BORDER 1
+
+#define NullPixmap ((PixmapPtr)0)
+
+typedef struct _Drawable *DrawablePtr;
+typedef struct _Pixmap *PixmapPtr;
+
+typedef union _PixUnion {
+ PixmapPtr pixmap;
+ unsigned long pixel;
+} PixUnion;
+
+#define SamePixUnion(a,b,isPixel)\
+ ((isPixel) ? (a).pixel == (b).pixel : (a).pixmap == (b).pixmap)
+
+#define EqualPixUnion(as, a, bs, b) \
+ ((as) == (bs) && (SamePixUnion (a, b, as)))
+
+#define OnScreenDrawable(type) \
+ ((type == DRAWABLE_WINDOW) || (type == DRAWABLE_BUFFER))
+
+#define WindowDrawable(type) \
+ ((type == DRAWABLE_WINDOW) || (type == UNDRAWABLE_WINDOW))
+
+extern PixmapPtr GetScratchPixmapHeader(
+#if NeedFunctionPrototypes
+ ScreenPtr /*pScreen*/,
+ int /*width*/,
+ int /*height*/,
+ int /*depth*/,
+ int /*bitsPerPixel*/,
+ int /*devKind*/,
+ pointer /*pPixData*/
+#endif
+);
+
+extern void FreeScratchPixmapHeader(
+#if NeedFunctionPrototypes
+ PixmapPtr /*pPixmap*/
+#endif
+);
+
+extern Bool CreateScratchPixmapsForScreen(
+#if NeedFunctionPrototypes
+ int /*scrnum*/
+#endif
+);
+
+extern void FreeScratchPixmapsForScreen(
+#if NeedFunctionPrototypes
+ int /*scrnum*/
+#endif
+);
+
+extern PixmapPtr AllocatePixmap(
+#if NeedFunctionPrototypes
+ ScreenPtr /*pScreen*/,
+ int /*pixDataSize*/
+#endif
+);
+
+#endif /* PIXMAP_H */
diff --git a/Xincludes/xc/programs/Xserver/include/pixmapstr.h b/Xincludes/xc/programs/Xserver/include/pixmapstr.h
new file mode 100644
index 0000000..d84ae79
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/pixmapstr.h
@@ -0,0 +1,83 @@
+/* $Xorg: pixmapstr.h,v 1.4 2001/02/09 02:05:15 xorgcvs 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 PIXMAPSTRUCT_H
+#define PIXMAPSTRUCT_H
+#include "pixmap.h"
+#include "screenint.h"
+#include "miscstruct.h"
+
+typedef struct _Drawable {
+ unsigned char type; /* DRAWABLE_<type> */
+ unsigned char class; /* specific to type */
+ unsigned char depth;
+ unsigned char bitsPerPixel;
+ unsigned long id; /* resource id */
+ short x; /* window: screen absolute, pixmap: 0 */
+ short y; /* window: screen absolute, pixmap: 0 */
+ unsigned short width;
+ unsigned short height;
+ ScreenPtr pScreen;
+ unsigned long serialNumber;
+} DrawableRec;
+
+/*
+ * PIXMAP -- device dependent
+ */
+
+typedef struct _Pixmap {
+ DrawableRec drawable;
+ int refcnt;
+ int devKind;
+ DevUnion devPrivate;
+#ifdef PIXPRIV
+ DevUnion *devPrivates; /* real devPrivates like gcs & windows */
+#endif
+} PixmapRec;
+
+#endif /* PIXMAPSTRUCT_H */
diff --git a/Xincludes/xc/programs/Xserver/include/property.h b/Xincludes/xc/programs/Xserver/include/property.h
new file mode 100644
index 0000000..21ce949
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/property.h
@@ -0,0 +1,83 @@
+/* $Xorg: property.h,v 1.4 2001/02/09 02:05:15 xorgcvs 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.
+
+******************************************************************/
+/* $XFree86: xc/programs/Xserver/include/property.h,v 1.2 2001/08/01 00:44:58 tsi Exp $ */
+
+#ifndef PROPERTY_H
+#define PROPERTY_H
+
+#include "window.h"
+
+typedef struct _Property *PropertyPtr;
+
+extern int ChangeWindowProperty(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/,
+ Atom /*property*/,
+ Atom /*type*/,
+ int /*format*/,
+ int /*mode*/,
+ unsigned long /*len*/,
+ pointer /*value*/,
+ Bool /*sendevent*/
+#endif
+);
+
+extern int DeleteProperty(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/,
+ Atom /*propName*/
+#endif
+);
+
+extern void DeleteAllWindowProperties(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/
+#endif
+);
+
+#endif /* PROPERTY_H */
diff --git a/Xincludes/xc/programs/Xserver/include/propertyst.h b/Xincludes/xc/programs/Xserver/include/propertyst.h
new file mode 100644
index 0000000..177fca1
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/propertyst.h
@@ -0,0 +1,76 @@
+/* $Xorg: propertyst.h,v 1.4 2001/02/09 02:05:15 xorgcvs 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.
+
+******************************************************************/
+/* $XFree86: xc/programs/Xserver/include/propertyst.h,v 3.2 2001/01/17 22:36:57 dawes Exp $ */
+
+#ifndef PROPERTYSTRUCT_H
+#define PROPERTYSTRUCT_H
+#include "misc.h"
+#include "property.h"
+/*
+ * PROPERTY -- property element
+ */
+
+typedef struct _Property {
+ struct _Property *next;
+ ATOM propertyName;
+ ATOM type; /* ignored by server */
+ short format; /* format of data for swapping - 8,16,32 */
+ long size; /* size of data in (format/8) bytes */
+ pointer data; /* private to client */
+#if defined(LBX) || defined(LBX_COMPAT)
+ /* If space is at a premium and binary compatibility is not
+ * an issue, you may want to put the owner_pid next to format
+ * so that the two shorts pack together without padding.
+ */
+ short owner_pid; /* proxy that has the data */
+ XID tag_id;
+#endif
+} PropertyRec;
+
+#endif /* PROPERTYSTRUCT_H */
+
diff --git a/Xincludes/xc/programs/Xserver/include/region.h b/Xincludes/xc/programs/Xserver/include/region.h
new file mode 100644
index 0000000..64f0ff4
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/region.h
@@ -0,0 +1,53 @@
+/* $Xorg: region.h,v 1.4 2001/02/09 02:05:15 xorgcvs 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 REGION_H
+#define REGION_H
+
+#include "regionstr.h"
+
+#endif /* REGION_H */
diff --git a/Xincludes/xc/programs/Xserver/include/regionstr.h b/Xincludes/xc/programs/Xserver/include/regionstr.h
new file mode 100644
index 0000000..2212058
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/regionstr.h
@@ -0,0 +1,437 @@
+/* $Xorg: regionstr.h,v 1.4 2001/02/09 02:05:15 xorgcvs 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.
+
+******************************************************************/
+/* $XFree86: xc/programs/Xserver/include/regionstr.h,v 1.6 2001/07/17 15:51:41 dawes Exp $ */
+
+#ifndef REGIONSTRUCT_H
+#define REGIONSTRUCT_H
+
+#include "miscstruct.h"
+
+/* Return values from RectIn() */
+
+#define rgnOUT 0
+#define rgnIN 1
+#define rgnPART 2
+
+#define NullRegion ((RegionPtr)0)
+
+/*
+ * clip region
+ */
+
+typedef struct _RegData {
+ long size;
+ long numRects;
+/* BoxRec rects[size]; in memory but not explicitly declared */
+} RegDataRec, *RegDataPtr;
+
+typedef struct _Region {
+ BoxRec extents;
+ RegDataPtr data;
+} RegionRec, *RegionPtr;
+
+extern BoxRec miEmptyBox;
+extern RegDataRec miEmptyData;
+extern RegDataRec miBrokenData;
+
+#define REGION_NIL(reg) ((reg)->data && !(reg)->data->numRects)
+/* not a region */
+#define REGION_NAR(reg) ((reg)->data == &miBrokenData)
+#define REGION_NUM_RECTS(reg) ((reg)->data ? (reg)->data->numRects : 1)
+#define REGION_SIZE(reg) ((reg)->data ? (reg)->data->size : 0)
+#define REGION_RECTS(reg) ((reg)->data ? (BoxPtr)((reg)->data + 1) \
+ : &(reg)->extents)
+#define REGION_BOXPTR(reg) ((BoxPtr)((reg)->data + 1))
+#define REGION_BOX(reg,i) (&REGION_BOXPTR(reg)[i])
+#define REGION_TOP(reg) REGION_BOX(reg, (reg)->data->numRects)
+#define REGION_END(reg) REGION_BOX(reg, (reg)->data->numRects - 1)
+#define REGION_SZOF(n) (sizeof(RegDataRec) + ((n) * sizeof(BoxRec)))
+
+#ifdef NEED_SCREEN_REGIONS
+
+#define REGION_CREATE(_pScreen, _rect, _size) \
+ (*(_pScreen)->RegionCreate)(_rect, _size)
+
+#define REGION_INIT(_pScreen, _pReg, _rect, _size) \
+ (*(_pScreen)->RegionInit)(_pReg, _rect, _size)
+
+#define REGION_COPY(_pScreen, dst, src) \
+ (*(_pScreen)->RegionCopy)(dst, src)
+
+#define REGION_DESTROY(_pScreen, _pReg) \
+ (*(_pScreen)->RegionDestroy)(_pReg)
+
+#define REGION_UNINIT(_pScreen, _pReg) \
+ (*(_pScreen)->RegionUninit)(_pReg)
+
+#define REGION_INTERSECT(_pScreen, newReg, reg1, reg2) \
+ (*(_pScreen)->Intersect)(newReg, reg1, reg2)
+
+#define REGION_UNION(_pScreen, newReg, reg1, reg2) \
+ (*(_pScreen)->Union)(newReg, reg1, reg2)
+
+#define REGION_SUBTRACT(_pScreen, newReg, reg1, reg2) \
+ (*(_pScreen)->Subtract)(newReg, reg1, reg2)
+
+#define REGION_INVERSE(_pScreen, newReg, reg1, invRect) \
+ (*(_pScreen)->Inverse)(newReg, reg1, invRect)
+
+#define REGION_RESET(_pScreen, _pReg, _pBox) \
+ (*(_pScreen)->RegionReset)(_pReg, _pBox)
+
+#define REGION_TRANSLATE(_pScreen, _pReg, _x, _y) \
+ (*(_pScreen)->TranslateRegion)(_pReg, _x, _y)
+
+#define RECT_IN_REGION(_pScreen, _pReg, prect) \
+ (*(_pScreen)->RectIn)(_pReg, prect)
+
+#define POINT_IN_REGION(_pScreen, _pReg, _x, _y, prect) \
+ (*(_pScreen)->PointInRegion)(_pReg, _x, _y, prect)
+
+#define REGION_NOTEMPTY(_pScreen, _pReg) \
+ (*(_pScreen)->RegionNotEmpty)(_pReg)
+
+#define REGION_BROKEN(_pScreen, _pReg) \
+ (*(_pScreen)->RegionBroken)(_pReg)
+
+#define REGION_BREAK(_pScreen, _pReg) \
+ (*(_pScreen)->RegionBreak)(_pReg)
+
+#define REGION_EMPTY(_pScreen, _pReg) \
+ (*(_pScreen)->RegionEmpty)(_pReg)
+
+#define REGION_EXTENTS(_pScreen, _pReg) \
+ (*(_pScreen)->RegionExtents)(_pReg)
+
+#define REGION_APPEND(_pScreen, dstrgn, rgn) \
+ (*(_pScreen)->RegionAppend)(dstrgn, rgn)
+
+#define REGION_VALIDATE(_pScreen, badreg, pOverlap) \
+ (*(_pScreen)->RegionValidate)(badreg, pOverlap)
+
+#define BITMAP_TO_REGION(_pScreen, pPix) \
+ (*(_pScreen)->BitmapToRegion)(pPix)
+
+#define RECTS_TO_REGION(_pScreen, nrects, prect, ctype) \
+ (*(_pScreen)->RectsToRegion)(nrects, prect, ctype)
+
+#else /* !NEED_SCREEN_REGIONS */
+
+#define REGION_CREATE(_pScreen, _rect, _size) \
+ miRegionCreate(_rect, _size)
+
+#define REGION_COPY(_pScreen, dst, src) \
+ miRegionCopy(dst, src)
+
+#define REGION_DESTROY(_pScreen, _pReg) \
+ miRegionDestroy(_pReg)
+
+#define REGION_INTERSECT(_pScreen, newReg, reg1, reg2) \
+ miIntersect(newReg, reg1, reg2)
+
+#define REGION_UNION(_pScreen, newReg, reg1, reg2) \
+ miUnion(newReg, reg1, reg2)
+
+#define REGION_SUBTRACT(_pScreen, newReg, reg1, reg2) \
+ miSubtract(newReg, reg1, reg2)
+
+#define REGION_INVERSE(_pScreen, newReg, reg1, invRect) \
+ miInverse(newReg, reg1, invRect)
+
+#define REGION_TRANSLATE(_pScreen, _pReg, _x, _y) \
+ miTranslateRegion(_pReg, _x, _y)
+
+#define RECT_IN_REGION(_pScreen, _pReg, prect) \
+ miRectIn(_pReg, prect)
+
+#define POINT_IN_REGION(_pScreen, _pReg, _x, _y, prect) \
+ miPointInRegion(_pReg, _x, _y, prect)
+
+#define REGION_APPEND(_pScreen, dstrgn, rgn) \
+ miRegionAppend(dstrgn, rgn)
+
+#define REGION_VALIDATE(_pScreen, badreg, pOverlap) \
+ miRegionValidate(badreg, pOverlap)
+
+#define BITMAP_TO_REGION(_pScreen, pPix) \
+ (*(_pScreen)->BitmapToRegion)(pPix) /* no mi version?! */
+
+#define RECTS_TO_REGION(_pScreen, nrects, prect, ctype) \
+ miRectsToRegion(nrects, prect, ctype)
+
+#define REGION_BREAK(_pScreen, _pReg) \
+ miRegionBreak(_pReg)
+
+#ifdef DONT_INLINE_REGION_OPS
+
+#define REGION_INIT(_pScreen, _pReg, _rect, _size) \
+ miRegionInit(_pReg, _rect, _size)
+
+#define REGION_UNINIT(_pScreen, _pReg) \
+ miRegionUninit(_pReg)
+
+#define REGION_RESET(_pScreen, _pReg, _pBox) \
+ miRegionReset(_pReg, _pBox)
+
+#define REGION_NOTEMPTY(_pScreen, _pReg) \
+ miRegionNotEmpty(_pReg)
+
+#define REGION_BROKEN(_pScreen, _pReg) \
+ miRegionBroken(_pReg)
+
+#define REGION_EMPTY(_pScreen, _pReg) \
+ miRegionEmpty(_pReg)
+
+#define REGION_EXTENTS(_pScreen, _pReg) \
+ miRegionExtents(_pReg)
+
+#else /* inline certain simple region ops for performance */
+
+#define REGION_INIT(_pScreen, _pReg, _rect, _size) \
+{ \
+ if (_rect) \
+ { \
+ (_pReg)->extents = *(_rect); \
+ (_pReg)->data = (RegDataPtr)NULL; \
+ } \
+ else \
+ { \
+ (_pReg)->extents = miEmptyBox; \
+ if (((_size) > 1) && ((_pReg)->data = \
+ (RegDataPtr)xalloc(REGION_SZOF(_size)))) \
+ { \
+ (_pReg)->data->size = (_size); \
+ (_pReg)->data->numRects = 0; \
+ } \
+ else \
+ (_pReg)->data = &miEmptyData; \
+ } \
+}
+
+#define REGION_UNINIT(_pScreen, _pReg) \
+{ \
+ if ((_pReg)->data && (_pReg)->data->size) { \
+ xfree((_pReg)->data); \
+ (_pReg)->data = NULL; \
+ } \
+}
+
+#define REGION_RESET(_pScreen, _pReg, _pBox) \
+{ \
+ (_pReg)->extents = *(_pBox); \
+ REGION_UNINIT(_pScreen, _pReg); \
+ (_pReg)->data = (RegDataPtr)NULL; \
+}
+
+#define REGION_NOTEMPTY(_pScreen, _pReg) \
+ !REGION_NIL(_pReg)
+
+#define REGION_BROKEN(_pScreen, _pReg) \
+ REGION_NAR(_pReg)
+
+#define REGION_EMPTY(_pScreen, _pReg) \
+{ \
+ REGION_UNINIT(_pScreen, _pReg); \
+ (_pReg)->extents.x2 = (_pReg)->extents.x1; \
+ (_pReg)->extents.y2 = (_pReg)->extents.y1; \
+ (_pReg)->data = &miEmptyData; \
+}
+
+#define REGION_EXTENTS(_pScreen, _pReg) \
+ &(_pReg)->extents
+
+#endif /* DONT_INLINE_REGION_OPS */
+
+#endif /* NEED_SCREEN_REGIONS */
+
+/* moved from mi.h */
+
+extern RegionPtr miRegionCreate(
+#if NeedFunctionPrototypes
+ BoxPtr /*rect*/,
+ int /*size*/
+#endif
+);
+
+extern void miRegionInit(
+#if NeedFunctionPrototypes
+ RegionPtr /*pReg*/,
+ BoxPtr /*rect*/,
+ int /*size*/
+#endif
+);
+
+extern void miRegionDestroy(
+#if NeedFunctionPrototypes
+ RegionPtr /*pReg*/
+#endif
+);
+
+extern void miRegionUninit(
+#if NeedFunctionPrototypes
+ RegionPtr /*pReg*/
+#endif
+);
+
+extern Bool miRegionCopy(
+#if NeedFunctionPrototypes
+ RegionPtr /*dst*/,
+ RegionPtr /*src*/
+#endif
+);
+
+extern Bool miIntersect(
+#if NeedFunctionPrototypes
+ RegionPtr /*newReg*/,
+ RegionPtr /*reg1*/,
+ RegionPtr /*reg2*/
+#endif
+);
+
+extern Bool miUnion(
+#if NeedFunctionPrototypes
+ RegionPtr /*newReg*/,
+ RegionPtr /*reg1*/,
+ RegionPtr /*reg2*/
+#endif
+);
+
+extern Bool miRegionAppend(
+#if NeedFunctionPrototypes
+ RegionPtr /*dstrgn*/,
+ RegionPtr /*rgn*/
+#endif
+);
+
+extern Bool miRegionValidate(
+#if NeedFunctionPrototypes
+ RegionPtr /*badreg*/,
+ Bool * /*pOverlap*/
+#endif
+);
+
+extern RegionPtr miRectsToRegion(
+#if NeedFunctionPrototypes
+ int /*nrects*/,
+ xRectanglePtr /*prect*/,
+ int /*ctype*/
+#endif
+);
+
+extern Bool miSubtract(
+#if NeedFunctionPrototypes
+ RegionPtr /*regD*/,
+ RegionPtr /*regM*/,
+ RegionPtr /*regS*/
+#endif
+);
+
+extern Bool miInverse(
+#if NeedFunctionPrototypes
+ RegionPtr /*newReg*/,
+ RegionPtr /*reg1*/,
+ BoxPtr /*invRect*/
+#endif
+);
+
+extern int miRectIn(
+#if NeedFunctionPrototypes
+ RegionPtr /*region*/,
+ BoxPtr /*prect*/
+#endif
+);
+
+extern void miTranslateRegion(
+#if NeedFunctionPrototypes
+ RegionPtr /*pReg*/,
+ int /*x*/,
+ int /*y*/
+#endif
+);
+
+extern void miRegionReset(
+#if NeedFunctionPrototypes
+ RegionPtr /*pReg*/,
+ BoxPtr /*pBox*/
+#endif
+);
+
+extern Bool miRegionBreak(
+#if NeedFunctionPrototypes
+ RegionPtr /*pReg*/
+#endif
+);
+
+extern Bool miPointInRegion(
+#if NeedFunctionPrototypes
+ RegionPtr /*pReg*/,
+ int /*x*/,
+ int /*y*/,
+ BoxPtr /*box*/
+#endif
+);
+
+extern Bool miRegionNotEmpty(
+#if NeedFunctionPrototypes
+ RegionPtr /*pReg*/
+#endif
+);
+
+extern void miRegionEmpty(
+#if NeedFunctionPrototypes
+ RegionPtr /*pReg*/
+#endif
+);
+
+extern BoxPtr miRegionExtents(
+#if NeedFunctionPrototypes
+ RegionPtr /*pReg*/
+#endif
+);
+
+#endif /* REGIONSTRUCT_H */
diff --git a/Xincludes/xc/programs/Xserver/include/resource.h b/Xincludes/xc/programs/Xserver/include/resource.h
new file mode 100644
index 0000000..c167204
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/resource.h
@@ -0,0 +1,326 @@
+/* $Xorg: resource.h,v 1.5 2001/02/09 02:05:15 xorgcvs Exp $ */
+/***********************************************************
+
+Copyright 1987, 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 1987, 1989 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/programs/Xserver/include/resource.h,v 1.9 2001/02/02 21:39:02 herrb Exp $ */
+
+#ifndef RESOURCE_H
+#define RESOURCE_H 1
+#include "misc.h"
+
+/*****************************************************************
+ * STUFF FOR RESOURCES
+ *****************************************************************/
+
+/* classes for Resource routines */
+
+typedef unsigned long RESTYPE;
+
+#define RC_VANILLA ((RESTYPE)0)
+#define RC_CACHED ((RESTYPE)1<<31)
+#define RC_DRAWABLE ((RESTYPE)1<<30)
+/* Use class RC_NEVERRETAIN for resources that should not be retained
+ * regardless of the close down mode when the client dies. (A client's
+ * event selections on objects that it doesn't own are good candidates.)
+ * Extensions can use this too!
+ */
+#define RC_NEVERRETAIN ((RESTYPE)1<<29)
+#define RC_LASTPREDEF RC_NEVERRETAIN
+#define RC_ANY (~(RESTYPE)0)
+
+/* types for Resource routines */
+
+#define RT_WINDOW ((RESTYPE)1|RC_CACHED|RC_DRAWABLE)
+#define RT_PIXMAP ((RESTYPE)2|RC_CACHED|RC_DRAWABLE)
+#define RT_GC ((RESTYPE)3|RC_CACHED)
+#undef RT_FONT
+#undef RT_CURSOR
+#define RT_FONT ((RESTYPE)4)
+#define RT_CURSOR ((RESTYPE)5)
+#define RT_COLORMAP ((RESTYPE)6)
+#define RT_CMAPENTRY ((RESTYPE)7)
+#define RT_OTHERCLIENT ((RESTYPE)8|RC_NEVERRETAIN)
+#define RT_PASSIVEGRAB ((RESTYPE)9|RC_NEVERRETAIN)
+#define RT_LASTPREDEF ((RESTYPE)9)
+#define RT_NONE ((RESTYPE)0)
+
+/* bits and fields within a resource id */
+#define RESOURCE_AND_CLIENT_COUNT 29 /* 29 bits for XIDs */
+#if MAXCLIENTS == 64
+#define RESOURCE_CLIENT_BITS 6
+#endif
+#if MAXCLIENTS == 128
+#define RESOURCE_CLIENT_BITS 7
+#endif
+#if MAXCLIENTS == 256
+#define RESOURCE_CLIENT_BITS 8
+#endif
+#if MAXCLIENTS == 512
+#define RESOURCE_CLIENT_BITS 9
+#endif
+/* client field offset */
+#define CLIENTOFFSET (RESOURCE_AND_CLIENT_COUNT - RESOURCE_CLIENT_BITS)
+/* resource field */
+#define RESOURCE_ID_MASK ((1 << CLIENTOFFSET) - 1)
+/* client field */
+#define RESOURCE_CLIENT_MASK (((1 << RESOURCE_CLIENT_BITS) - 1) << CLIENTOFFSET)
+/* extract the client mask from an XID */
+#define CLIENT_BITS(id) ((id) & RESOURCE_CLIENT_MASK)
+/* extract the client id from an XID */
+#define CLIENT_ID(id) ((int)(CLIENT_BITS(id) >> CLIENTOFFSET))
+#define SERVER_BIT (Mask)0x40000000 /* use illegal bit */
+
+#ifdef INVALID
+#undef INVALID /* needed on HP/UX */
+#endif
+
+/* Invalid resource id */
+#define INVALID (0)
+
+#define BAD_RESOURCE 0xe0000000
+
+typedef int (*DeleteType)(
+#if NeedNestedPrototypes
+ pointer /*value*/,
+ XID /*id*/
+#endif
+);
+
+typedef void (*FindResType)(
+#if NeedNestedPrototypes
+ pointer /*value*/,
+ XID /*id*/,
+ pointer /*cdata*/
+#endif
+);
+
+typedef Bool (*FindComplexResType)(
+#if NeedNestedPrototypes
+ pointer /*value*/,
+ XID /*id*/,
+ pointer /*cdata*/
+#endif
+);
+
+extern RESTYPE CreateNewResourceType(
+#if NeedFunctionPrototypes
+ DeleteType /*deleteFunc*/
+#endif
+);
+
+extern RESTYPE CreateNewResourceClass(
+#if NeedFunctionPrototypes
+void
+#endif
+);
+
+extern Bool InitClientResources(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/
+#endif
+);
+
+extern XID FakeClientID(
+#if NeedFunctionPrototypes
+ int /*client*/
+#endif
+);
+
+/* Quartz support on Mac OS X uses the CarbonCore
+ framework whose AddResource function conflicts here. */
+#ifdef __DARWIN__
+#define AddResource Darwin_X_AddResource
+#endif
+extern Bool AddResource(
+#if NeedFunctionPrototypes
+ XID /*id*/,
+ RESTYPE /*type*/,
+ pointer /*value*/
+#endif
+);
+
+extern void FreeResource(
+#if NeedFunctionPrototypes
+ XID /*id*/,
+ RESTYPE /*skipDeleteFuncType*/
+#endif
+);
+
+extern void FreeResourceByType(
+#if NeedFunctionPrototypes
+ XID /*id*/,
+ RESTYPE /*type*/,
+ Bool /*skipFree*/
+#endif
+);
+
+extern Bool ChangeResourceValue(
+#if NeedFunctionPrototypes
+ XID /*id*/,
+ RESTYPE /*rtype*/,
+ pointer /*value*/
+#endif
+);
+
+extern void FindClientResourcesByType(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/,
+ RESTYPE /*type*/,
+ FindResType /*func*/,
+ pointer /*cdata*/
+#endif
+);
+
+extern void FreeClientNeverRetainResources(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/
+#endif
+);
+
+extern void FreeClientResources(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/
+#endif
+);
+
+extern void FreeAllResources(
+#if NeedFunctionPrototypes
+void
+#endif
+);
+
+extern Bool LegalNewID(
+#if NeedFunctionPrototypes
+ XID /*id*/,
+ ClientPtr /*client*/
+#endif
+);
+
+extern pointer LookupIDByType(
+#if NeedFunctionPrototypes
+ XID /*id*/,
+ RESTYPE /*rtype*/
+#endif
+);
+
+extern pointer LookupIDByClass(
+#if NeedFunctionPrototypes
+ XID /*id*/,
+ RESTYPE /*classes*/
+#endif
+);
+
+extern pointer LookupClientResourceComplex(
+#if NeedFunctionPrototypes
+ ClientPtr client,
+ RESTYPE type,
+ FindComplexResType func,
+ pointer cdata
+#endif
+);
+
+/* These are the access modes that can be passed in the last parameter
+ * to SecurityLookupIDByType/Class. The Security extension doesn't
+ * currently make much use of these; they're mainly provided as an
+ * example of what you might need for discretionary access control.
+ * You can or these values together to indicate multiple modes
+ * simultaneously.
+ */
+
+#define SecurityUnknownAccess 0 /* don't know intentions */
+#define SecurityReadAccess (1<<0) /* inspecting the object */
+#define SecurityWriteAccess (1<<1) /* changing the object */
+#define SecurityDestroyAccess (1<<2) /* destroying the object */
+
+#ifdef XCSECURITY
+
+extern pointer SecurityLookupIDByType(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/,
+ XID /*id*/,
+ RESTYPE /*rtype*/,
+ Mask /*access_mode*/
+#endif
+);
+
+extern pointer SecurityLookupIDByClass(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/,
+ XID /*id*/,
+ RESTYPE /*classes*/,
+ Mask /*access_mode*/
+#endif
+);
+
+#else /* not XCSECURITY */
+
+#define SecurityLookupIDByType(client, id, rtype, access_mode) \
+ LookupIDByType(id, rtype)
+
+#define SecurityLookupIDByClass(client, id, classes, access_mode) \
+ LookupIDByClass(id, classes)
+
+#endif /* XCSECURITY */
+
+extern void GetXIDRange(
+#if NeedFunctionPrototypes
+ int /*client*/,
+ Bool /*server*/,
+ XID * /*minp*/,
+ XID * /*maxp*/
+#endif
+);
+
+extern unsigned int GetXIDList(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/,
+ unsigned int /*count*/,
+ XID * /*pids*/
+#endif
+);
+
+#endif /* RESOURCE_H */
+
diff --git a/Xincludes/xc/programs/Xserver/include/screenint.h b/Xincludes/xc/programs/Xserver/include/screenint.h
new file mode 100644
index 0000000..c95c0ef
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/screenint.h
@@ -0,0 +1,170 @@
+/* $Xorg: screenint.h,v 1.4 2001/02/09 02:05:15 xorgcvs 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.
+
+******************************************************************/
+/* $XFree86: xc/programs/Xserver/include/screenint.h,v 1.4 2001/01/17 22:36:57 dawes Exp $ */
+#ifndef SCREENINT_H
+#define SCREENINT_H
+
+#include "misc.h"
+
+typedef struct _PixmapFormat *PixmapFormatPtr;
+typedef struct _Visual *VisualPtr;
+typedef struct _Depth *DepthPtr;
+typedef struct _Screen *ScreenPtr;
+
+extern void ResetScreenPrivates(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern int AllocateScreenPrivateIndex(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern void ResetWindowPrivates(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern int AllocateWindowPrivateIndex(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern Bool AllocateWindowPrivate(
+#if NeedFunctionPrototypes
+ ScreenPtr /* pScreen */,
+ int /* index */,
+ unsigned /* amount */
+#endif
+);
+
+extern void ResetGCPrivates(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern int AllocateGCPrivateIndex(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern Bool AllocateGCPrivate(
+#if NeedFunctionPrototypes
+ ScreenPtr /* pScreen */,
+ int /* index */,
+ unsigned /* amount */
+#endif
+);
+
+extern int AddScreen(
+#if NeedFunctionPrototypes
+ Bool (* /*pfnInit*/)(
+#if NeedNestedPrototypes
+ int /*index*/,
+ ScreenPtr /*pScreen*/,
+ int /*argc*/,
+ char ** /*argv*/
+#endif
+ ),
+ int /*argc*/,
+ char** /*argv*/
+#endif
+);
+
+#ifdef PIXPRIV
+
+extern void ResetPixmapPrivates(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern int AllocatePixmapPrivateIndex(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+extern Bool AllocatePixmapPrivate(
+#if NeedFunctionPrototypes
+ ScreenPtr /* pScreen */,
+ int /* index */,
+ unsigned /* amount */
+#endif
+);
+
+#endif /* PIXPRIV */
+
+extern void ResetColormapPrivates(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+
+typedef struct _ColormapRec *ColormapPtr;
+typedef int (*InitCmapPrivFunc)(
+#if NeedNestedPrototypes
+ ColormapPtr
+#endif
+);
+
+extern int AllocateColormapPrivateIndex(
+#if NeedFunctionPrototypes
+ InitCmapPrivFunc /* initPrivFunc */
+#endif
+);
+
+#endif /* SCREENINT_H */
diff --git a/Xincludes/xc/programs/Xserver/include/scrnintstr.h b/Xincludes/xc/programs/Xserver/include/scrnintstr.h
new file mode 100644
index 0000000..881b66d
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/scrnintstr.h
@@ -0,0 +1,996 @@
+/* $Xorg: scrnintstr.h,v 1.4 2001/02/09 02:05:15 xorgcvs 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.
+
+******************************************************************/
+/* $XFree86: xc/programs/Xserver/include/scrnintstr.h,v 1.9 2001/01/17 22:36:58 dawes Exp $ */
+
+#ifndef SCREENINTSTRUCT_H
+#define SCREENINTSTRUCT_H
+
+#include "screenint.h"
+#include "miscstruct.h"
+#include "bstore.h"
+#include "colormap.h"
+#include "cursor.h"
+#include "validate.h"
+#include "X11/Xproto.h"
+#include "dix.h"
+
+typedef struct _PixmapFormat {
+ unsigned char depth;
+ unsigned char bitsPerPixel;
+ unsigned char scanlinePad;
+ } PixmapFormatRec;
+
+typedef struct _Visual {
+ VisualID vid;
+ short class;
+ short bitsPerRGBValue;
+ short ColormapEntries;
+ short nplanes;/* = log2 (ColormapEntries). This does not
+ * imply that the screen has this many planes.
+ * it may have more or fewer */
+ unsigned long redMask, greenMask, blueMask;
+ int offsetRed, offsetGreen, offsetBlue;
+ } VisualRec;
+
+typedef struct _Depth {
+ unsigned char depth;
+ short numVids;
+ VisualID *vids; /* block of visual ids for this depth */
+ } DepthRec;
+
+
+/*
+ * There is a typedef for each screen function pointer so that code that
+ * needs to declare a screen function pointer (e.g. in a screen private
+ * or as a local variable) can easily do so and retain full type checking.
+ */
+
+typedef Bool (* CloseScreenProcPtr)(
+#if NeedNestedPrototypes
+ int /*index*/,
+ ScreenPtr /*pScreen*/
+#endif
+);
+
+typedef void (* QueryBestSizeProcPtr)(
+#if NeedNestedPrototypes
+ int /*class*/,
+ unsigned short * /*pwidth*/,
+ unsigned short * /*pheight*/,
+ ScreenPtr /*pScreen*/
+#endif
+);
+
+typedef Bool (* SaveScreenProcPtr)(
+#if NeedNestedPrototypes
+ ScreenPtr /*pScreen*/,
+ int /*on*/
+#endif
+);
+
+typedef void (* GetImageProcPtr)(
+#if NeedNestedPrototypes
+ DrawablePtr /*pDrawable*/,
+ int /*sx*/,
+ int /*sy*/,
+ int /*w*/,
+ int /*h*/,
+ unsigned int /*format*/,
+ unsigned long /*planeMask*/,
+ char * /*pdstLine*/
+#endif
+);
+
+typedef void (* GetSpansProcPtr)(
+#if NeedNestedPrototypes
+ DrawablePtr /*pDrawable*/,
+ int /*wMax*/,
+ DDXPointPtr /*ppt*/,
+ int* /*pwidth*/,
+ int /*nspans*/,
+ char * /*pdstStart*/
+#endif
+);
+
+typedef void (* PointerNonInterestBoxProcPtr)(
+#if NeedNestedPrototypes
+ ScreenPtr /*pScreen*/,
+ BoxPtr /*pBox*/
+#endif
+);
+
+typedef void (* SourceValidateProcPtr)(
+#if NeedNestedPrototypes
+ DrawablePtr /*pDrawable*/,
+ int /*x*/,
+ int /*y*/,
+ int /*width*/,
+ int /*height*/
+#endif
+);
+
+typedef Bool (* CreateWindowProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWindow*/
+#endif
+);
+
+typedef Bool (* DestroyWindowProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWindow*/
+#endif
+);
+
+typedef Bool (* PositionWindowProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWindow*/,
+ int /*x*/,
+ int /*y*/
+#endif
+);
+
+typedef Bool (* ChangeWindowAttributesProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWindow*/,
+ unsigned long /*mask*/
+#endif
+);
+
+typedef Bool (* RealizeWindowProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWindow*/
+#endif
+);
+
+typedef Bool (* UnrealizeWindowProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWindow*/
+#endif
+);
+
+typedef void (* RestackWindowProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWindow*/,
+ WindowPtr /*pOldNextSib*/
+#endif
+);
+
+typedef int (* ValidateTreeProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pParent*/,
+ WindowPtr /*pChild*/,
+ VTKind /*kind*/
+#endif
+);
+
+typedef void (* PostValidateTreeProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pParent*/,
+ WindowPtr /*pChild*/,
+ VTKind /*kind*/
+#endif
+);
+
+typedef void (* WindowExposuresProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWindow*/,
+ RegionPtr /*prgn*/,
+ RegionPtr /*other_exposed*/
+#endif
+);
+
+typedef void (* PaintWindowProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWindow*/,
+ RegionPtr /*pRegion*/,
+ int /*what*/
+#endif
+);
+
+typedef PaintWindowProcPtr PaintWindowBackgroundProcPtr;
+typedef PaintWindowProcPtr PaintWindowBorderProcPtr;
+
+typedef void (* CopyWindowProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWindow*/,
+ DDXPointRec /*ptOldOrg*/,
+ RegionPtr /*prgnSrc*/
+#endif
+);
+
+typedef void (* ClearToBackgroundProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWindow*/,
+ int /*x*/,
+ int /*y*/,
+ int /*w*/,
+ int /*h*/,
+ Bool /*generateExposures*/
+#endif
+);
+
+typedef void (* ClipNotifyProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWindow*/,
+ int /*dx*/,
+ int /*dy*/
+#endif
+);
+
+typedef PixmapPtr (* CreatePixmapProcPtr)(
+#if NeedNestedPrototypes
+ ScreenPtr /*pScreen*/,
+ int /*width*/,
+ int /*height*/,
+ int /*depth*/
+#endif
+);
+
+typedef Bool (* DestroyPixmapProcPtr)(
+#if NeedNestedPrototypes
+ PixmapPtr /*pPixmap*/
+#endif
+);
+
+typedef void (* SaveDoomedAreasProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWindow*/,
+ RegionPtr /*prgnSave*/,
+ int /*xorg*/,
+ int /*yorg*/
+#endif
+);
+
+typedef RegionPtr (* RestoreAreasProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWindow*/,
+ RegionPtr /*prgnRestore*/
+#endif
+);
+
+typedef void (* ExposeCopyProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pSrc*/,
+ DrawablePtr /*pDst*/,
+ GCPtr /*pGC*/,
+ RegionPtr /*prgnExposed*/,
+ int /*srcx*/,
+ int /*srcy*/,
+ int /*dstx*/,
+ int /*dsty*/,
+ unsigned long /*plane*/
+#endif
+);
+
+typedef RegionPtr (* TranslateBackingStoreProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWindow*/,
+ int /*windx*/,
+ int /*windy*/,
+ RegionPtr /*oldClip*/,
+ int /*oldx*/,
+ int /*oldy*/
+#endif
+);
+
+typedef RegionPtr (* ClearBackingStoreProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWindow*/,
+ int /*x*/,
+ int /*y*/,
+ int /*w*/,
+ int /*h*/,
+ Bool /*generateExposures*/
+#endif
+);
+
+typedef void (* DrawGuaranteeProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWindow*/,
+ GCPtr /*pGC*/,
+ int /*guarantee*/
+#endif
+);
+
+typedef Bool (* RealizeFontProcPtr)(
+#if NeedNestedPrototypes
+ ScreenPtr /*pScreen*/,
+ FontPtr /*pFont*/
+#endif
+);
+
+typedef Bool (* UnrealizeFontProcPtr)(
+#if NeedNestedPrototypes
+ ScreenPtr /*pScreen*/,
+ FontPtr /*pFont*/
+#endif
+);
+
+typedef void (* ConstrainCursorProcPtr)(
+#if NeedNestedPrototypes
+ ScreenPtr /*pScreen*/,
+ BoxPtr /*pBox*/
+#endif
+);
+
+typedef void (* CursorLimitsProcPtr)(
+#if NeedNestedPrototypes
+ ScreenPtr /*pScreen*/,
+ CursorPtr /*pCursor*/,
+ BoxPtr /*pHotBox*/,
+ BoxPtr /*pTopLeftBox*/
+#endif
+);
+
+typedef Bool (* DisplayCursorProcPtr)(
+#if NeedNestedPrototypes
+ ScreenPtr /*pScreen*/,
+ CursorPtr /*pCursor*/
+#endif
+);
+
+typedef Bool (* RealizeCursorProcPtr)(
+#if NeedNestedPrototypes
+ ScreenPtr /*pScreen*/,
+ CursorPtr /*pCursor*/
+#endif
+);
+
+typedef Bool (* UnrealizeCursorProcPtr)(
+#if NeedNestedPrototypes
+ ScreenPtr /*pScreen*/,
+ CursorPtr /*pCursor*/
+#endif
+);
+
+typedef void (* RecolorCursorProcPtr)(
+#if NeedNestedPrototypes
+ ScreenPtr /*pScreen*/,
+ CursorPtr /*pCursor*/,
+ Bool /*displayed*/
+#endif
+);
+
+typedef Bool (* SetCursorPositionProcPtr)(
+#if NeedNestedPrototypes
+ ScreenPtr /*pScreen*/,
+ int /*x*/,
+ int /*y*/,
+ Bool /*generateEvent*/
+#endif
+);
+
+typedef Bool (* CreateGCProcPtr)(
+#if NeedNestedPrototypes
+ GCPtr /*pGC*/
+#endif
+);
+
+typedef Bool (* CreateColormapProcPtr)(
+#if NeedNestedPrototypes
+ ColormapPtr /*pColormap*/
+#endif
+);
+
+typedef void (* DestroyColormapProcPtr)(
+#if NeedNestedPrototypes
+ ColormapPtr /*pColormap*/
+#endif
+);
+
+typedef void (* InstallColormapProcPtr)(
+#if NeedNestedPrototypes
+ ColormapPtr /*pColormap*/
+#endif
+);
+
+typedef void (* UninstallColormapProcPtr)(
+#if NeedNestedPrototypes
+ ColormapPtr /*pColormap*/
+#endif
+);
+
+typedef int (* ListInstalledColormapsProcPtr) (
+#if NeedNestedPrototypes
+ ScreenPtr /*pScreen*/,
+ XID* /*pmaps */
+#endif
+);
+
+typedef void (* StoreColorsProcPtr)(
+#if NeedNestedPrototypes
+ ColormapPtr /*pColormap*/,
+ int /*ndef*/,
+ xColorItem * /*pdef*/
+#endif
+);
+
+typedef void (* ResolveColorProcPtr)(
+#if NeedNestedPrototypes
+ unsigned short* /*pred*/,
+ unsigned short* /*pgreen*/,
+ unsigned short* /*pblue*/,
+ VisualPtr /*pVisual*/
+#endif
+);
+
+#ifdef NEED_SCREEN_REGIONS
+
+typedef RegionPtr (* RegionCreateProcPtr)(
+#if NeedNestedPrototypes
+ BoxPtr /*rect*/,
+ int /*size*/
+#endif
+);
+
+typedef void (* RegionInitProcPtr)(
+#if NeedNestedPrototypes
+ RegionPtr /*pReg*/,
+ BoxPtr /*rect*/,
+ int /*size*/
+#endif
+);
+
+typedef Bool (* RegionCopyProcPtr)(
+#if NeedNestedPrototypes
+ RegionPtr /*dst*/,
+ RegionPtr /*src*/
+#endif
+);
+
+typedef void (* RegionDestroyProcPtr)(
+#if NeedNestedPrototypes
+ RegionPtr /*pReg*/
+#endif
+);
+
+typedef void (* RegionUninitProcPtr)(
+#if NeedNestedPrototypes
+ RegionPtr /*pReg*/
+#endif
+);
+
+typedef Bool (* IntersectProcPtr)(
+#if NeedNestedPrototypes
+ RegionPtr /*newReg*/,
+ RegionPtr /*reg1*/,
+ RegionPtr /*reg2*/
+#endif
+);
+
+typedef Bool (* UnionProcPtr)(
+#if NeedNestedPrototypes
+ RegionPtr /*newReg*/,
+ RegionPtr /*reg1*/,
+ RegionPtr /*reg2*/
+#endif
+);
+
+typedef Bool (* SubtractProcPtr)(
+#if NeedNestedPrototypes
+ RegionPtr /*regD*/,
+ RegionPtr /*regM*/,
+ RegionPtr /*regS*/
+#endif
+);
+
+typedef Bool (* InverseProcPtr)(
+#if NeedNestedPrototypes
+ RegionPtr /*newReg*/,
+ RegionPtr /*reg1*/,
+ BoxPtr /*invRect*/
+#endif
+);
+
+typedef void (* RegionResetProcPtr)(
+#if NeedNestedPrototypes
+ RegionPtr /*pReg*/,
+ BoxPtr /*pBox*/
+#endif
+);
+
+typedef void (* TranslateRegionProcPtr)(
+#if NeedNestedPrototypes
+ RegionPtr /*pReg*/,
+ int /*x*/,
+ int /*y*/
+#endif
+);
+
+typedef int (* RectInProcPtr)(
+#if NeedNestedPrototypes
+ RegionPtr /*region*/,
+ BoxPtr /*prect*/
+#endif
+);
+
+typedef Bool (* PointInRegionProcPtr)(
+#if NeedNestedPrototypes
+ RegionPtr /*pReg*/,
+ int /*x*/,
+ int /*y*/,
+ BoxPtr /*box*/
+#endif
+);
+
+typedef Bool (* RegionNotEmptyProcPtr)(
+#if NeedNestedPrototypes
+ RegionPtr /*pReg*/
+#endif
+);
+
+typedef Bool (* RegionBrokenProcPtr)(
+#if NeedNestedPrototypes
+ RegionPtr /*pReg*/
+#endif
+);
+
+typedef Bool (* RegionBreakProcPtr)(
+#if NeedNestedPrototypes
+ RegionPtr /*pReg*/
+#endif
+);
+
+typedef void (* RegionEmptyProcPtr)(
+#if NeedNestedPrototypes
+ RegionPtr /*pReg*/
+#endif
+);
+
+typedef BoxPtr (* RegionExtentsProcPtr)(
+#if NeedNestedPrototypes
+ RegionPtr /*pReg*/
+#endif
+);
+
+typedef Bool (* RegionAppendProcPtr)(
+#if NeedNestedPrototypes
+ RegionPtr /*dstrgn*/,
+ RegionPtr /*rgn*/
+#endif
+);
+
+typedef Bool (* RegionValidateProcPtr)(
+#if NeedNestedPrototypes
+ RegionPtr /*badreg*/,
+ Bool* /*pOverlap*/
+#endif
+);
+
+#endif /* NEED_SCREEN_REGIONS */
+
+typedef RegionPtr (* BitmapToRegionProcPtr)(
+#if NeedNestedPrototypes
+ PixmapPtr /*pPix*/
+#endif
+);
+
+#ifdef NEED_SCREEN_REGIONS
+
+typedef RegionPtr (* RectsToRegionProcPtr)(
+#if NeedNestedPrototypes
+ int /*nrects*/,
+ xRectangle* /*prect*/,
+ int /*ctype*/
+#endif
+);
+
+#endif /* NEED_SCREEN_REGIONS */
+
+typedef void (* SendGraphicsExposeProcPtr)(
+#if NeedNestedPrototypes
+ ClientPtr /*client*/,
+ RegionPtr /*pRgn*/,
+ XID /*drawable*/,
+ int /*major*/,
+ int /*minor*/
+#endif
+);
+
+typedef void (* ScreenBlockHandlerProcPtr)(
+#if NeedNestedPrototypes
+ int /*screenNum*/,
+ pointer /*blockData*/,
+ pointer /*pTimeout*/,
+ pointer /*pReadmask*/
+#endif
+);
+
+typedef void (* ScreenWakeupHandlerProcPtr)(
+#if NeedNestedPrototypes
+ int /*screenNum*/,
+ pointer /*wakeupData*/,
+ unsigned long /*result*/,
+ pointer /*pReadMask*/
+#endif
+);
+
+typedef Bool (* CreateScreenResourcesProcPtr)(
+#if NeedNestedPrototypes
+ ScreenPtr /*pScreen*/
+#endif
+);
+
+typedef Bool (* ModifyPixmapHeaderProcPtr)(
+#if NeedNestedPrototypes
+ PixmapPtr /*pPixmap*/,
+ int /*width*/,
+ int /*height*/,
+ int /*depth*/,
+ int /*bitsPerPixel*/,
+ int /*devKind*/,
+ pointer /*pPixData*/
+#endif
+);
+
+typedef PixmapPtr (* GetWindowPixmapProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWin*/
+#endif
+);
+
+typedef void (* SetWindowPixmapProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWin*/,
+ PixmapPtr /*pPix*/
+#endif
+);
+
+typedef PixmapPtr (* GetScreenPixmapProcPtr)(
+#if NeedNestedPrototypes
+ ScreenPtr /*pScreen*/
+#endif
+);
+
+typedef void (* SetScreenPixmapProcPtr)(
+#if NeedNestedPrototypes
+ PixmapPtr /*pPix*/
+#endif
+);
+
+typedef void (* MarkWindowProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWin*/
+#endif
+);
+
+typedef Bool (* MarkOverlappedWindowsProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*parent*/,
+ WindowPtr /*firstChild*/,
+ WindowPtr * /*pLayerWin*/
+#endif
+);
+
+typedef Bool (* ChangeSaveUnderProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pLayerWin*/,
+ WindowPtr /*firstChild*/
+#endif
+);
+
+typedef void (* PostChangeSaveUnderProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pLayerWin*/,
+ WindowPtr /*firstChild*/
+#endif
+);
+
+typedef void (* MoveWindowProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWin*/,
+ int /*x*/,
+ int /*y*/,
+ WindowPtr /*pSib*/,
+ VTKind /*kind*/
+#endif
+);
+
+typedef void (* ResizeWindowProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWin*/,
+ int /*x*/,
+ int /*y*/,
+ unsigned int /*w*/,
+ unsigned int /*h*/,
+ WindowPtr /*pSib*/
+#endif
+);
+
+typedef WindowPtr (* GetLayerWindowProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWin*/
+#endif
+);
+
+typedef void (* HandleExposuresProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWin*/
+#endif
+);
+
+typedef void (* ReparentWindowProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWin*/,
+ WindowPtr /*pPriorParent*/
+#endif
+);
+
+#ifdef SHAPE
+typedef void (* SetShapeProcPtr)(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/
+#endif
+);
+#endif /* SHAPE */
+
+typedef void (* ChangeBorderWidthProcPtr)(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/,
+ unsigned int /*width*/
+#endif
+);
+
+typedef void (* MarkUnrealizedWindowProcPtr)(
+#if NeedFunctionPrototypes
+ WindowPtr /*pChild*/,
+ WindowPtr /*pWin*/,
+ Bool /*fromConfigure*/
+#endif
+);
+
+typedef struct _Screen {
+ int myNum; /* index of this instance in Screens[] */
+ ATOM id;
+ short width, height;
+ short mmWidth, mmHeight;
+ short numDepths;
+ unsigned char rootDepth;
+ DepthPtr allowedDepths;
+ unsigned long rootVisual;
+ unsigned long defColormap;
+ short minInstalledCmaps, maxInstalledCmaps;
+ char backingStoreSupport, saveUnderSupport;
+ unsigned long whitePixel, blackPixel;
+ unsigned long rgf; /* array of flags; she's -- HUNGARIAN */
+ GCPtr GCperDepth[MAXFORMATS+1];
+ /* next field is a stipple to use as default in
+ a GC. we don't build default tiles of all depths
+ because they are likely to be of a color
+ different from the default fg pixel, so
+ we don't win anything by building
+ a standard one.
+ */
+ PixmapPtr PixmapPerDepth[1];
+ pointer devPrivate;
+ short numVisuals;
+ VisualPtr visuals;
+ int WindowPrivateLen;
+ unsigned *WindowPrivateSizes;
+ unsigned totalWindowSize;
+ int GCPrivateLen;
+ unsigned *GCPrivateSizes;
+ unsigned totalGCSize;
+
+ /* Random screen procedures */
+
+ CloseScreenProcPtr CloseScreen;
+ QueryBestSizeProcPtr QueryBestSize;
+ SaveScreenProcPtr SaveScreen;
+ GetImageProcPtr GetImage;
+ GetSpansProcPtr GetSpans;
+ PointerNonInterestBoxProcPtr PointerNonInterestBox;
+ SourceValidateProcPtr SourceValidate;
+
+ /* Window Procedures */
+
+ CreateWindowProcPtr CreateWindow;
+ DestroyWindowProcPtr DestroyWindow;
+ PositionWindowProcPtr PositionWindow;
+ ChangeWindowAttributesProcPtr ChangeWindowAttributes;
+ RealizeWindowProcPtr RealizeWindow;
+ UnrealizeWindowProcPtr UnrealizeWindow;
+ ValidateTreeProcPtr ValidateTree;
+ PostValidateTreeProcPtr PostValidateTree;
+ WindowExposuresProcPtr WindowExposures;
+ PaintWindowBackgroundProcPtr PaintWindowBackground;
+ PaintWindowBorderProcPtr PaintWindowBorder;
+ CopyWindowProcPtr CopyWindow;
+ ClearToBackgroundProcPtr ClearToBackground;
+ ClipNotifyProcPtr ClipNotify;
+ RestackWindowProcPtr RestackWindow;
+
+ /* Pixmap procedures */
+
+ CreatePixmapProcPtr CreatePixmap;
+ DestroyPixmapProcPtr DestroyPixmap;
+
+ /* Backing store procedures */
+
+ SaveDoomedAreasProcPtr SaveDoomedAreas;
+ RestoreAreasProcPtr RestoreAreas;
+ ExposeCopyProcPtr ExposeCopy;
+ TranslateBackingStoreProcPtr TranslateBackingStore;
+ ClearBackingStoreProcPtr ClearBackingStore;
+ DrawGuaranteeProcPtr DrawGuarantee;
+ /*
+ * A read/write copy of the lower level backing store vector is needed now
+ * that the functions can be wrapped.
+ */
+ BSFuncRec BackingStoreFuncs;
+
+ /* Font procedures */
+
+ RealizeFontProcPtr RealizeFont;
+ UnrealizeFontProcPtr UnrealizeFont;
+
+ /* Cursor Procedures */
+
+ ConstrainCursorProcPtr ConstrainCursor;
+ CursorLimitsProcPtr CursorLimits;
+ DisplayCursorProcPtr DisplayCursor;
+ RealizeCursorProcPtr RealizeCursor;
+ UnrealizeCursorProcPtr UnrealizeCursor;
+ RecolorCursorProcPtr RecolorCursor;
+ SetCursorPositionProcPtr SetCursorPosition;
+
+ /* GC procedures */
+
+ CreateGCProcPtr CreateGC;
+
+ /* Colormap procedures */
+
+ CreateColormapProcPtr CreateColormap;
+ DestroyColormapProcPtr DestroyColormap;
+ InstallColormapProcPtr InstallColormap;
+ UninstallColormapProcPtr UninstallColormap;
+ ListInstalledColormapsProcPtr ListInstalledColormaps;
+ StoreColorsProcPtr StoreColors;
+ ResolveColorProcPtr ResolveColor;
+
+ /* Region procedures */
+
+#ifdef NEED_SCREEN_REGIONS
+ RegionCreateProcPtr RegionCreate;
+ RegionInitProcPtr RegionInit;
+ RegionCopyProcPtr RegionCopy;
+ RegionDestroyProcPtr RegionDestroy;
+ RegionUninitProcPtr RegionUninit;
+ IntersectProcPtr Intersect;
+ UnionProcPtr Union;
+ SubtractProcPtr Subtract;
+ InverseProcPtr Inverse;
+ RegionResetProcPtr RegionReset;
+ TranslateRegionProcPtr TranslateRegion;
+ RectInProcPtr RectIn;
+ PointInRegionProcPtr PointInRegion;
+ RegionNotEmptyProcPtr RegionNotEmpty;
+ RegionBrokenProcPtr RegionBroken;
+ RegionBreakProcPtr RegionBreak;
+ RegionEmptyProcPtr RegionEmpty;
+ RegionExtentsProcPtr RegionExtents;
+ RegionAppendProcPtr RegionAppend;
+ RegionValidateProcPtr RegionValidate;
+#endif /* NEED_SCREEN_REGIONS */
+ BitmapToRegionProcPtr BitmapToRegion;
+#ifdef NEED_SCREEN_REGIONS
+ RectsToRegionProcPtr RectsToRegion;
+#endif /* NEED_SCREEN_REGIONS */
+ SendGraphicsExposeProcPtr SendGraphicsExpose;
+
+ /* os layer procedures */
+
+ ScreenBlockHandlerProcPtr BlockHandler;
+ ScreenWakeupHandlerProcPtr WakeupHandler;
+
+ pointer blockData;
+ pointer wakeupData;
+
+ /* anybody can get a piece of this array */
+ DevUnion *devPrivates;
+
+ CreateScreenResourcesProcPtr CreateScreenResources;
+ ModifyPixmapHeaderProcPtr ModifyPixmapHeader;
+
+ GetWindowPixmapProcPtr GetWindowPixmap;
+ SetWindowPixmapProcPtr SetWindowPixmap;
+ GetScreenPixmapProcPtr GetScreenPixmap;
+ SetScreenPixmapProcPtr SetScreenPixmap;
+
+ PixmapPtr pScratchPixmap; /* scratch pixmap "pool" */
+
+#ifdef PIXPRIV
+ int PixmapPrivateLen;
+ unsigned int *PixmapPrivateSizes;
+ unsigned int totalPixmapSize;
+#endif
+
+ MarkWindowProcPtr MarkWindow;
+ MarkOverlappedWindowsProcPtr MarkOverlappedWindows;
+ ChangeSaveUnderProcPtr ChangeSaveUnder;
+ PostChangeSaveUnderProcPtr PostChangeSaveUnder;
+ MoveWindowProcPtr MoveWindow;
+ ResizeWindowProcPtr ResizeWindow;
+ GetLayerWindowProcPtr GetLayerWindow;
+ HandleExposuresProcPtr HandleExposures;
+ ReparentWindowProcPtr ReparentWindow;
+
+#ifdef SHAPE
+ SetShapeProcPtr SetShape;
+#endif /* SHAPE */
+
+ ChangeBorderWidthProcPtr ChangeBorderWidth;
+ MarkUnrealizedWindowProcPtr MarkUnrealizedWindow;
+
+} ScreenRec;
+
+typedef struct _ScreenInfo {
+ int imageByteOrder;
+ int bitmapScanlineUnit;
+ int bitmapScanlinePad;
+ int bitmapBitOrder;
+ int numPixmapFormats;
+ PixmapFormatRec
+ formats[MAXFORMATS];
+ int arraySize;
+ int numScreens;
+ ScreenPtr screens[MAXSCREENS];
+ int numVideoScreens;
+} ScreenInfo;
+
+extern ScreenInfo screenInfo;
+
+extern void InitOutput(
+#if NeedFunctionPrototypes
+ ScreenInfo * /*pScreenInfo*/,
+ int /*argc*/,
+ char ** /*argv*/
+#endif
+);
+
+#endif /* SCREENINTSTRUCT_H */
diff --git a/Xincludes/xc/programs/Xserver/include/validate.h b/Xincludes/xc/programs/Xserver/include/validate.h
new file mode 100644
index 0000000..467533d
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/validate.h
@@ -0,0 +1,42 @@
+/* $Xorg: validate.h,v 1.4 2001/02/09 02:05:16 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.
+*/
+/* $XFree86: xc/programs/Xserver/include/validate.h,v 1.4 2001/01/17 22:36:58 dawes Exp $ */
+
+#ifndef VALIDATE_H
+#define VALIDATE_H
+
+#include "miscstruct.h"
+#include "regionstr.h"
+
+typedef enum { VTOther, VTStack, VTMove, VTUnmap, VTMap, VTBroken } VTKind;
+
+/* union _Validate is now device dependent; see mivalidate.h for an example */
+typedef union _Validate *ValidatePtr;
+
+#define UnmapValData ((ValidatePtr)1)
+
+#endif /* VALIDATE_H */
diff --git a/Xincludes/xc/programs/Xserver/include/window.h b/Xincludes/xc/programs/Xserver/include/window.h
new file mode 100644
index 0000000..c46714a
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/window.h
@@ -0,0 +1,362 @@
+/* $Xorg: window.h,v 1.4 2001/02/09 02:05:16 xorgcvs 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 WINDOW_H
+#define WINDOW_H
+
+#include "misc.h"
+#include "region.h"
+#include "screenint.h"
+#include "X11/Xproto.h"
+
+#define TOTALLY_OBSCURED 0
+#define UNOBSCURED 1
+#define OBSCURED 2
+
+#define VisibilityNotViewable 3
+
+/* return values for tree-walking callback procedures */
+#define WT_STOPWALKING 0
+#define WT_WALKCHILDREN 1
+#define WT_DONTWALKCHILDREN 2
+#define WT_NOMATCH 3
+#define NullWindow ((WindowPtr) 0)
+
+typedef struct _BackingStore *BackingStorePtr;
+typedef struct _Window *WindowPtr;
+
+typedef int (*VisitWindowProcPtr)(
+#if NeedNestedPrototypes
+ WindowPtr /*pWin*/,
+ pointer /*data*/
+#endif
+);
+
+extern int TraverseTree(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/,
+ VisitWindowProcPtr /*func*/,
+ pointer /*data*/
+#endif
+);
+
+extern int WalkTree(
+#if NeedFunctionPrototypes
+ ScreenPtr /*pScreen*/,
+ VisitWindowProcPtr /*func*/,
+ pointer /*data*/
+#endif
+);
+
+extern WindowPtr AllocateWindow(
+#if NeedFunctionPrototypes
+ ScreenPtr /*pScreen*/
+#endif
+);
+
+extern Bool CreateRootWindow(
+#if NeedFunctionPrototypes
+ ScreenPtr /*pScreen*/
+#endif
+);
+
+extern void InitRootWindow(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/
+#endif
+);
+
+extern void ClippedRegionFromBox(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/,
+ RegionPtr /*Rgn*/,
+ int /*x*/,
+ int /*y*/,
+ int /*w*/,
+ int /*h*/
+#endif
+);
+
+extern WindowPtr RealChildHead(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/
+#endif
+);
+
+extern WindowPtr CreateWindow(
+#if NeedFunctionPrototypes
+ Window /*wid*/,
+ WindowPtr /*pParent*/,
+ int /*x*/,
+ int /*y*/,
+ unsigned int /*w*/,
+ unsigned int /*h*/,
+ unsigned int /*bw*/,
+ unsigned int /*class*/,
+ Mask /*vmask*/,
+ XID* /*vlist*/,
+ int /*depth*/,
+ ClientPtr /*client*/,
+ VisualID /*visual*/,
+ int* /*error*/
+#endif
+);
+
+extern int DeleteWindow(
+#if NeedFunctionPrototypes
+ pointer /*pWin*/,
+ XID /*wid*/
+#endif
+);
+
+extern void DestroySubwindows(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/,
+ ClientPtr /*client*/
+#endif
+);
+
+/* Quartz support on Mac OS X uses the HIToolbox
+ framework whose ChangeWindowAttributes function conflicts here. */
+#ifdef __DARWIN__
+#define ChangeWindowAttributes Darwin_X_ChangeWindowAttributes
+#endif
+extern int ChangeWindowAttributes(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/,
+ Mask /*vmask*/,
+ XID* /*vlist*/,
+ ClientPtr /*client*/
+#endif
+);
+
+/* Quartz support on Mac OS X uses the HIToolbox
+ framework whose GetWindowAttributes function conflicts here. */
+#ifdef __DARWIN__
+#define GetWindowAttributes(w,c,x) Darwin_X_GetWindowAttributes(w,c,x)
+extern void Darwin_X_GetWindowAttributes(
+#else
+extern void GetWindowAttributes(
+#endif
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/,
+ ClientPtr /*client*/,
+ xGetWindowAttributesReply* /* wa */
+#endif
+);
+
+extern RegionPtr CreateUnclippedWinSize(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/
+#endif
+);
+
+extern void GravityTranslate(
+#if NeedFunctionPrototypes
+ int /*x*/,
+ int /*y*/,
+ int /*oldx*/,
+ int /*oldy*/,
+ int /*dw*/,
+ int /*dh*/,
+ unsigned /*gravity*/,
+ int* /*destx*/,
+ int* /*desty*/
+#endif
+);
+
+extern int ConfigureWindow(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/,
+ Mask /*mask*/,
+ XID* /*vlist*/,
+ ClientPtr /*client*/
+#endif
+);
+
+extern int CirculateWindow(
+#if NeedFunctionPrototypes
+ WindowPtr /*pParent*/,
+ int /*direction*/,
+ ClientPtr /*client*/
+#endif
+);
+
+extern int ReparentWindow(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/,
+ WindowPtr /*pParent*/,
+ int /*x*/,
+ int /*y*/,
+ ClientPtr /*client*/
+#endif
+);
+
+extern int MapWindow(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/,
+ ClientPtr /*client*/
+#endif
+);
+
+extern void MapSubwindows(
+#if NeedFunctionPrototypes
+ WindowPtr /*pParent*/,
+ ClientPtr /*client*/
+#endif
+);
+
+extern int UnmapWindow(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/,
+ Bool /*fromConfigure*/
+#endif
+);
+
+extern void UnmapSubwindows(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/
+#endif
+);
+
+extern void HandleSaveSet(
+#if NeedFunctionPrototypes
+ ClientPtr /*client*/
+#endif
+);
+
+extern Bool VisibleBoundingBoxFromPoint(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/,
+ int /*x*/,
+ int /*y*/,
+ BoxPtr /*box*/
+#endif
+);
+
+extern Bool PointInWindowIsVisible(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/,
+ int /*x*/,
+ int /*y*/
+#endif
+);
+
+extern RegionPtr NotClippedByChildren(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/
+#endif
+);
+
+extern void SendVisibilityNotify(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/
+#endif
+);
+
+extern void SaveScreens(
+#if NeedFunctionPrototypes
+ int /*on*/,
+ int /*mode*/
+#endif
+);
+
+extern WindowPtr FindWindowWithOptional(
+#if NeedFunctionPrototypes
+ WindowPtr /*w*/
+#endif
+);
+
+extern void CheckWindowOptionalNeed(
+#if NeedFunctionPrototypes
+ WindowPtr /*w*/
+#endif
+);
+
+extern Bool MakeWindowOptional(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/
+#endif
+);
+
+extern void DisposeWindowOptional(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/
+#endif
+);
+
+extern WindowPtr MoveWindowInStack(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/,
+ WindowPtr /*pNextSib*/
+#endif
+);
+
+void SetWinSize(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/
+#endif
+);
+
+void SetBorderSize(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/
+#endif
+);
+
+void ResizeChildrenWinSize(
+#if NeedFunctionPrototypes
+ WindowPtr /*pWin*/,
+ int /*dx*/,
+ int /*dy*/,
+ int /*dw*/,
+ int /*dh*/
+#endif
+);
+
+#endif /* WINDOW_H */
diff --git a/Xincludes/xc/programs/Xserver/include/xf86_ansic.h b/Xincludes/xc/programs/Xserver/include/xf86_ansic.h
new file mode 100644
index 0000000..a9166de
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/xf86_ansic.h
@@ -0,0 +1,342 @@
+/*
+ * Copyright 1997-2000 by The XFree86 Project, Inc
+ *
+ * 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 holders
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. The above listed
+ * copyright holders make 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 HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDERS 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/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h,v 3.47 2001/05/18 20:22:30 tsi Exp $ */
+
+#ifndef _XF86_ANSIC_H
+#define _XF86_ANSIC_H
+
+/* Handle <stdarg.h> */
+
+#ifndef IN_MODULE
+# include <stdarg.h>
+#else /* !IN_MODULE */
+# ifndef __OS2ELF__
+# include <stdarg.h>
+# else /* __OS2ELF__ */
+ /* EMX/gcc_elf under OS/2 does not have native header files */
+# if !defined (_VA_LIST)
+# define _VA_LIST
+ typedef char *va_list;
+# endif
+# define _VA_ROUND(t) ((sizeof (t) + 3) & -4)
+# if !defined (va_start)
+# define va_start(ap,v) ap = (va_list)&v + ((sizeof (v) + 3) & -4)
+# define va_end(ap) (ap = 0, (void)0)
+# define va_arg(ap,t) (ap += _VA_ROUND (t), *(t *)(ap - _VA_ROUND (t)))
+# endif
+# endif /* __OS2ELF__ */
+#endif /* IN_MODULE */
+
+/*
+ * The first set of definitions are required both for modules and
+ * libc_wrapper.c.
+ */
+
+#if defined(XFree86LOADER) || defined(NEED_XF86_TYPES)
+
+#if !defined(SYSV) && !defined(SVR4) && !defined(Lynx) || defined(SCO)
+#define HAVE_VSSCANF
+#define HAVE_VFSCANF
+#endif
+
+#ifndef NULL
+#if (defined(SVR4) || defined(SYSV)) && !defined(__GNUC__)
+#define NULL 0
+#else
+#define NULL ((void *)0)
+#endif
+#endif
+#ifndef EOF
+#define EOF (-1)
+#endif
+
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
+/* <limits.h> stuff */
+#define x_BITSPERBYTE 8
+#define x_BITS(type) (x_BITSPERBYTE * (int)sizeof(type))
+#define x_SHORTBITS x_BITS(short)
+#define x_INTBITS x_BITS(int)
+#define x_LONGBITS x_BITS(long)
+#ifndef SHRT_MIN
+#define SHRT_MIN ((short)(1 << (x_SHORTBITS - 1)))
+#endif
+
+#ifndef FONTMODULE
+#include "misc.h"
+#endif
+#include "xf86_libc.h"
+#ifndef SHRT_MAX
+#define SHRT_MAX ((short)~SHRT_MIN)
+#endif
+#ifndef USHRT_MAX
+#define USHRT_MAX ((unsigned short)~0)
+#endif
+#ifndef MINSHORT
+#define MINSHORT SHRT_MIN
+#endif
+#ifndef MAXSHORT
+#define MAXSHORT SHRT_MAX
+#endif
+#ifndef INT_MIN
+#define INT_MIN (1 << (x_INTBITS - 1))
+#endif
+#ifndef INT_MAX
+#define INT_MAX (~INT_MIN)
+#endif
+#ifndef UINT_MAX
+#define UINT_MAX (~0)
+#endif
+#ifndef MININT
+#define MININT INT_MIN
+#endif
+#ifndef MAXINT
+#define MAXINT INT_MAX
+#endif
+#ifndef LONG_MIN
+#define LONG_MIN ((long)(1 << (x_LONGBITS - 1)))
+#endif
+#ifndef LONG_MAX
+#define LONG_MAX ((long)~LONG_MIN)
+#endif
+#ifndef ULONG_MAX
+#define ULONG_MAX ((unsigned long)~0UL)
+#endif
+#ifndef MINLONG
+#define MINLONG LONG_MIN
+#endif
+#ifndef MAXLONG
+#define MAXLONG LONG_MAX
+#endif
+
+#endif /* XFree86LOADER || NEED_XF86_TYPES */
+
+#if defined(XFree86LOADER) || defined(NEED_XF86_PROTOTYPES)
+/*
+ * ANSI C compilers only.
+ */
+
+/* ANSI C emulation library */
+
+extern void xf86abort(void);
+extern int xf86abs(int);
+extern double xf86acos(double);
+extern double xf86asin(double);
+extern double xf86atan(double);
+extern double xf86atan2(double,double);
+extern double xf86atof(const char*);
+extern int xf86atoi(const char*);
+extern long xf86atol(const char*);
+extern void *xf86bsearch(const void *, const void *, xf86size_t, xf86size_t,
+ int (*)(const void *, const void *));
+extern double xf86ceil(double);
+extern void* xf86calloc(xf86size_t,xf86size_t);
+extern void xf86clearerr(XF86FILE*);
+extern double xf86cos(double);
+extern void xf86exit(int);
+extern double xf86exp(double);
+extern double xf86fabs(double);
+extern int xf86fclose(XF86FILE*);
+extern int xf86feof(XF86FILE*);
+extern int xf86ferror(XF86FILE*);
+extern int xf86fflush(XF86FILE*);
+extern int xf86fgetc(XF86FILE*);
+extern int xf86getc(XF86FILE*);
+extern int xf86fgetpos(XF86FILE*,XF86fpos_t*);
+extern char* xf86fgets(char*,INT32,XF86FILE*);
+extern int xf86finite(double);
+extern double xf86floor(double);
+extern double xf86fmod(double,double);
+extern XF86FILE* xf86fopen(const char*,const char*);
+extern double xf86frexp(double, int*);
+extern int xf86printf(const char*,...);
+extern int xf86fprintf(XF86FILE*,const char*,...);
+extern int xf86fputc(int,XF86FILE*);
+extern int xf86fputs(const char*,XF86FILE*);
+extern xf86size_t xf86fread(void*,xf86size_t,xf86size_t,XF86FILE*);
+extern void xf86free(void*);
+extern XF86FILE* xf86freopen(const char*,const char*,XF86FILE*);
+#if defined(HAVE_VFSCANF) || !defined(NEED_XF86_PROTOTYPES)
+extern int xf86fscanf(XF86FILE*,const char*,...);
+#else
+extern int xf86fscanf(/*XF86FILE*,const char*,char *,char *,char *,char *,
+ char *,char *,char *,char *,char *,char * */);
+#endif
+extern int xf86fseek(XF86FILE*,long,int);
+extern int xf86fsetpos(XF86FILE*,const XF86fpos_t*);
+extern long xf86ftell(XF86FILE*);
+extern xf86size_t xf86fwrite(const void*,xf86size_t,xf86size_t,XF86FILE*);
+extern char* xf86getenv(const char*);
+extern int xf86isalnum(int);
+extern int xf86isalpha(int);
+extern int xf86iscntrl(int);
+extern int xf86isdigit(int);
+extern int xf86isgraph(int);
+extern int xf86islower(int);
+extern int xf86isprint(int);
+extern int xf86ispunct(int);
+extern int xf86isspace(int);
+extern int xf86isupper(int);
+extern int xf86isxdigit(int);
+extern long xf86labs(long);
+extern double xf86ldexp(double,int);
+extern double xf86log(double);
+extern double xf86log10(double);
+extern void* xf86malloc(xf86size_t);
+extern void* xf86memchr(const void*,int,xf86size_t);
+extern int xf86memcmp(const void*,const void*,xf86size_t);
+extern void* xf86memcpy(void*,const void*,xf86size_t);
+extern void* xf86memmove(void*,const void*,xf86size_t);
+extern void* xf86memset(void*,int,xf86size_t);
+extern double xf86modf(double,double*);
+extern void xf86perror(const char*);
+extern double xf86pow(double,double);
+extern void xf86qsort(void*, xf86size_t, xf86size_t,
+ int(*)(const void*, const void*));
+extern void* xf86realloc(void*,xf86size_t);
+extern int xf86remove(const char*);
+extern int xf86rename(const char*,const char*);
+extern void xf86rewind(XF86FILE*);
+extern int xf86setbuf(XF86FILE*,char*);
+extern int xf86setvbuf(XF86FILE*,char*,int,xf86size_t);
+extern double xf86sin(double);
+extern int xf86sprintf(char*,const char*,...);
+extern int xf86snprintf(char*,xf86size_t,const char*,...);
+extern double xf86sqrt(double);
+#if defined(HAVE_VSSCANF) || !defined(NEED_XF86_PROTOTYPES)
+extern int xf86sscanf(char*,const char*,...);
+#else
+extern int xf86sscanf(/*char*,const char*,char *,char *,char *,char *,
+ char *,char *,char *,char *,char *,char * */);
+#endif
+extern char* xf86strcat(char*,const char*);
+extern char* xf86strchr(const char*, int c);
+extern int xf86strcmp(const char*,const char*);
+extern int xf86strcasecmp(const char*,const char*);
+extern char* xf86strcpy(char*,const char*);
+extern xf86size_t xf86strcspn(const char*,const char*);
+extern char* xf86strerror(int);
+extern xf86size_t xf86strlen(const char*);
+extern char* xf86strncat(char *, const char *, xf86size_t);
+extern int xf86strncmp(const char*,const char*,xf86size_t);
+extern int xf86strncasecmp(const char*,const char*,xf86size_t);
+extern char* xf86strncpy(char*,const char*,xf86size_t);
+extern char* xf86strpbrk(const char*,const char*);
+extern char* xf86strrchr(const char*,int);
+extern xf86size_t xf86strspn(const char*,const char*);
+extern char* xf86strstr(const char*,const char*);
+extern double xf86strtod(const char*,char**);
+extern char* xf86strtok(char*,const char*);
+extern long xf86strtol(const char*,char**,int);
+extern unsigned long xf86strtoul(const char*,char**,int);
+extern double xf86tan(double);
+extern XF86FILE* xf86tmpfile(void);
+extern char* xf86tmpnam(char*);
+extern int xf86tolower(int);
+extern int xf86toupper(int);
+extern int xf86ungetc(int,XF86FILE*);
+extern int xf86vfprintf(XF86FILE*,const char*,va_list);
+extern int xf86vsprintf(char*,const char*,va_list);
+extern int xf86vsnprintf(char*,xf86size_t,const char*,va_list);
+
+extern int xf86open(const char*, int,...);
+extern int xf86close(int);
+extern long xf86lseek(int, long, int);
+extern int xf86ioctl(int, unsigned long, pointer);
+extern xf86ssize_t xf86read(int, void *, xf86size_t);
+extern xf86ssize_t xf86write(int, const void *, xf86size_t);
+extern void* xf86mmap(void*, xf86size_t, int, int, int, xf86size_t /* off_t */);
+extern int xf86munmap(void*, xf86size_t);
+extern int xf86stat(const char *, struct xf86stat *);
+extern int xf86fstat(int, struct xf86stat *);
+extern int xf86access(const char *, int);
+extern int xf86errno;
+extern int xf86GetErrno(void);
+
+extern double xf86HUGE_VAL;
+
+extern double xf86hypot(double,double);
+
+/* non-ANSI C functions */
+extern XF86DIR* xf86opendir(const char*);
+extern int xf86closedir(XF86DIR*);
+extern XF86DIRENT* xf86readdir(XF86DIR*);
+extern void xf86rewinddir(XF86DIR*);
+extern void xf86bcopy(const void*,void*,xf86size_t);
+extern int xf86ffs(int);
+extern char* xf86strdup(const char*);
+extern void xf86bzero(void*,unsigned int);
+extern int xf86execl(const char *, const char *, ...);
+extern long xf86fpossize(void);
+extern int xf86chmod(const char *, xf86mode_t);
+extern int xf86chown(const char *, xf86uid_t, xf86gid_t);
+extern xf86uid_t xf86geteuid(void);
+extern xf86gid_t xf86getegid(void);
+extern int xf86getpid(void);
+extern int xf86mknod(const char *, xf86mode_t, xf86dev_t);
+extern int xf86mkdir(const char *, xf86mode_t);
+unsigned int xf86sleep(unsigned int seconds);
+/* sysv IPC */
+extern int xf86shmget(xf86key_t key, int size, int xf86shmflg);
+extern char * xf86shmat(int id, char *addr, int xf86shmflg);
+extern int xf86shmdt(char *addr);
+extern int xf86shmctl(int id, int xf86cmd, pointer buf);
+extern int xf86setjmp(xf86jmp_buf env);
+extern void xf86longjmp(xf86jmp_buf env, int val);
+
+#else /* XFree86LOADER || NEED_XF86_PROTOTYPES */
+#include <unistd.h>
+#include <stdio.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <ctype.h>
+#ifdef HAVE_SYSV_IPC
+#include <sys/ipc.h>
+#include <sys/shm.h>
+#endif
+#include <sys/stat.h>
+#define stat_t struct stat
+#endif /* XFree86LOADER || NEED_XF86_PROTOTYPES */
+
+/*
+ * These things are always required by drivers (but not by libc_wrapper.c),
+ * even for a static server because some OSs don't provide them.
+ */
+
+extern int xf86getpagesize(void);
+extern void xf86usleep(unsigned long);
+extern void xf86getsecs(long *, long *);
+#ifndef DONT_DEFINE_WRAPPERS
+#undef getpagesize
+#define getpagesize() xf86getpagesize()
+#undef usleep
+#define usleep(ul) xf86usleep(ul)
+#undef getsecs
+#define getsecs(a, b) xf86getsecs(a, b)
+#endif
+#endif /* _XF86_ANSIC_H */
diff --git a/Xincludes/xc/programs/Xserver/include/xf86_libc.h b/Xincludes/xc/programs/Xserver/include/xf86_libc.h
new file mode 100644
index 0000000..f0e36d0
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/include/xf86_libc.h
@@ -0,0 +1,658 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h,v 3.50 2001/04/10 16:08:03 dawes Exp $ */
+
+
+
+/*
+ * This file is an attempt to make developing code for the new loadable module
+ * architecure simpler. It tries to use macros to hide all libc wrappers so
+ * that all that is needed to "port" a module to this architecture is to
+ * include this one header file
+ *
+ * Revision history:
+ *
+ *
+ * 0.4 Apr 12 1997 add the ANSI defines
+ * 0.3 Feb 24 1997 handle getenv
+ * 0.2 Feb 24 1997 hide few FILE functions
+ * 0.1 Feb 24 1997 hide the trivial functions mem* str*
+ */
+
+#ifndef XF86_LIBC_H
+#define XF86_LIBC_H 1
+
+#include "Xfuncs.h"
+
+/*
+ * The first set of definitions are required both for modules and
+ * libc_wrapper.c.
+ */
+
+#if defined(XFree86LOADER) || defined(NEED_XF86_TYPES)
+
+/*
+ * First, the new data types
+ *
+ * note: if some pointer is declared "opaque" here, pass it between
+ * xf86* functions only, and don't rely on it having a whatever internal
+ * structure, even if some source file might reveal the existence of
+ * such a structure.
+ */
+typedef void XF86FILE; /* opaque FILE replacement */
+extern XF86FILE* xf86stdin;
+extern XF86FILE* xf86stdout;
+extern XF86FILE* xf86stderr;
+
+typedef void XF86fpos_t; /* opaque fpos_t replacement */
+
+#define _XF86NAMELEN 263 /* enough for a larger filename */
+ /* (divisble by 8) */
+typedef void XF86DIR; /* opaque DIR replacement */
+
+/* Note: the following is POSIX! POSIX only requires the d_name member.
+ * Normal Unix has often a number of other members, but don't rely on that
+ */
+struct _xf86dirent { /* types in struct dirent/direct: */
+ char d_name[_XF86NAMELEN+1]; /* char [MAXNAMLEN]; might be smaller or unaligned */
+};
+typedef struct _xf86dirent XF86DIRENT;
+
+typedef unsigned long xf86size_t;
+typedef signed long xf86ssize_t;
+typedef unsigned long xf86dev_t;
+typedef unsigned int xf86mode_t;
+typedef unsigned int xf86uid_t;
+typedef unsigned int xf86gid_t;
+
+struct xf86stat {
+ xf86dev_t st_rdev; /* This is incomplete, and makes assumptions */
+};
+
+/* sysv IPC */
+typedef int xf86key_t;
+
+/* setjmp/longjmp */
+typedef int xf86jmp_buf[20];
+
+/* for setvbuf */
+#define XF86_IONBF 1
+#define XF86_IOFBF 2
+#define XF86_IOLBF 3
+
+/* for open (XXX not complete) */
+#define XF86_O_RDONLY 0x0000
+#define XF86_O_WRONLY 0x0001
+#define XF86_O_RDWR 0x0002
+#define XF86_O_CREAT 0x0200
+
+/* for mmap */
+#define XF86_PROT_EXEC 0x0001
+#define XF86_PROT_READ 0x0002
+#define XF86_PROT_WRITE 0x0004
+#define XF86_PROT_NONE 0x0008
+#define XF86_MAP_FIXED 0x0001
+#define XF86_MAP_SHARED 0x0002
+#define XF86_MAP_PRIVATE 0x0004
+#define XF86_MAP_FAILED ((void *)-1)
+
+/* for fseek */
+#define XF86_SEEK_SET 0
+#define XF86_SEEK_CUR 1
+#define XF86_SEEK_END 2
+
+/* for access */
+#define XF86_R_OK 0
+#define XF86_W_OK 1
+#define XF86_X_OK 2
+#define XF86_F_OK 3
+
+/* for chmod */
+#define XF86_S_ISUID 04000 /* set user ID on execution */
+#define XF86_S_ISGID 02000 /* set group ID on execution */
+#define XF86_S_ISVTX 01000 /* sticky bit */
+#define XF86_S_IRUSR 00400 /* read by owner */
+#define XF86_S_IWUSR 00200 /* write by owner */
+#define XF86_S_IXUSR 00100 /* execute/search by owner */
+#define XF86_S_IRGRP 00040 /* read by group */
+#define XF86_S_IWGRP 00020 /* write by group */
+#define XF86_S_IXGRP 00010 /* execute/search by group */
+#define XF86_S_IROTH 00004 /* read by others */
+#define XF86_S_IWOTH 00002 /* write by others */
+#define XF86_S_IXOTH 00001 /* execute/search by others */
+
+/* for mknod */
+#define XF86_S_IFREG 0010000
+#define XF86_S_IFCHR 0020000
+#define XF86_S_IFBLK 0040000
+#define XF86_S_IFIFO 0100000
+
+/*
+ * errno values
+ * They start at 1000 just so they don't match real errnos at all
+ */
+#define xf86_UNKNOWN 1000
+#define xf86_EACCES 1001
+#define xf86_EAGAIN 1002
+#define xf86_EBADF 1003
+#define xf86_EEXIST 1004
+#define xf86_EFAULT 1005
+#define xf86_EINTR 1006
+#define xf86_EINVAL 1007
+#define xf86_EISDIR 1008
+#define xf86_ELOOP 1009
+#define xf86_EMFILE 1010
+#define xf86_ENAMETOOLONG 1011
+#define xf86_ENFILE 1012
+#define xf86_ENOENT 1013
+#define xf86_ENOMEM 1014
+#define xf86_ENOSPC 1015
+#define xf86_ENOTDIR 1016
+#define xf86_EPIPE 1017
+#define xf86_EROFS 1018
+#define xf86_ETXTBSY 1019
+#define xf86_ENOTTY 1020
+#define xf86_ENOSYS 1021
+#define xf86_EBUSY 1022
+#define xf86_ENODEV 1023
+#define xf86_EIO 1024
+
+/* sysv IPV */
+/* xf86shmget() */
+#define XF86IPC_CREAT 01000
+#define XF86IPC_EXCL 02000
+#define XF86IPC_NOWAIT 04000
+#define XF86SHM_R 0400
+#define XF86SHM_W 0200
+#define XF86IPC_PRIVATE ((xf86key_t)0)
+/* xf86shmat() */
+#define XF86SHM_RDONLY 010000 /* attach read-only else read-write */
+#define XF86SHM_RND 020000 /* round attach address to SHMLBA */
+#define XF86SHM_REMAP 040000 /* take-over region on attach */
+/* xf86shmclt() */
+#define XF86IPC_RMID 0
+
+#endif /* defined(XFree86LOADER) || defined(NEED_XF86_TYPES) */
+
+/*
+ * the rest of this file should only be included for code that is supposed
+ * to go into modules
+ */
+
+#if defined(XFree86LOADER) && !defined(DONT_DEFINE_WRAPPERS)
+
+#undef abort
+#define abort() xf86abort()
+#undef abs
+#define abs(i) xf86abs(i)
+#undef acos
+#define acos(d) xf86acos(d)
+#undef asin
+#define asin(d) xf86asin(d)
+#undef atan
+#define atan(d) xf86atan(d)
+#undef atan2
+#define atan2(d1,d2) xf86atan2(d1,d2)
+#undef atof
+#define atof(ccp) xf86atof(ccp)
+#undef atoi
+#define atoi(ccp) xf86atoi(ccp)
+#undef atol
+#define atol(ccp) xf86atol(ccp)
+#undef bsearch
+#define bsearch(a,b,c,d,e) xf86bsearch(a,b,c,d,e)
+#undef ceil
+#define ceil(d) xf86ceil(d)
+#undef calloc
+#define calloc(I1,I2) xf86calloc(I1,I2)
+#undef clearerr
+#define clearerr(FP) xf86clearerr(FP)
+#undef cos
+#define cos(d) xf86cos(d)
+#undef exit
+#define exit(i) xf86exit(i)
+#undef exp
+#define exp(d) xf86exp(d)
+#undef fabs
+#define fabs(d) xf86fabs(d)
+#undef fclose
+#define fclose(FP) xf86fclose(FP)
+#undef feof
+#define feof(FP) xf86feof(FP)
+#undef ferror
+#define ferror(FP) xf86ferror(FP)
+#undef fflush
+#define fflush(FP) xf86fflush(FP)
+#undef fgetc
+#define fgetc(FP) xf86fgetc(FP)
+#undef getc
+#define getc(FP) xf86getc(FP)
+#undef fgetpos
+#define fgetpos(FP,fpp) xf86fgetpos(FP,fpp)
+#undef fgets
+#define fgets(cp,i,FP) xf86fgets(cp,i,FP)
+#undef finite
+#define finite(d) xf86finite(d)
+#undef floor
+#define floor(d) xf86floor(d)
+#undef fmod
+#define fmod(d1,d2) xf86fmod(d1,d2)
+#undef fopen
+#define fopen(ccp1,ccp2) xf86fopen(ccp1,ccp2)
+#undef printf
+#define printf xf86printf
+#undef fprintf
+#define fprintf xf86fprintf
+#undef fputc
+#define fputc(i,FP) xf86fputc(i,FP)
+#undef fputs
+#define fputs(ccp,FP) xf86fputs(ccp,FP)
+#undef fread
+#define fread(vp,I1,I2,FP) xf86fread(vp,I1,I2,FP)
+#undef free
+#define free(vp) xf86free(vp)
+#undef freopen
+#define freopen(ccp1,ccp2,FP) xf86freopen(ccp1,ccp2,FP)
+#undef frexp
+#define frexp(x,exp) xf86frexp(x,exp)
+#undef fscanf
+#define fscanf xf86fscanf
+#undef fseek
+#define fseek(FP,l,i) xf86fseek(FP,l,i)
+#undef fsetpos
+#define fsetpos(FP,cfpp) xf86fsetpos(FP,cfpp)
+#undef ftell
+#define ftell(FP) xf86ftell(FP)
+#undef fwrite
+#define fwrite(cvp,I1,I2,FP) xf86fwrite(cvp,I1,I2,FP)
+#undef getenv
+#define getenv(ccp) xf86getenv(ccp)
+#undef isalnum
+#define isalnum(i) xf86isalnum(i)
+#undef isalpha
+#define isalpha(i) xf86isalpha(i)
+#undef iscntrl
+#define iscntrl(i) xf86iscntrl(i)
+#undef isdigit
+#define isdigit(i) xf86isdigit(i)
+#undef isgraph
+#define isgraph(i) xf86isgraph(i)
+#undef islower
+#define islower(i) xf86islower(i)
+#undef isprint
+#define isprint(i) xf86isprint(i)
+#undef ispunct
+#define ispunct(i) xf86ispunct(i)
+#undef isspace
+#define isspace(i) xf86isspace(i)
+#undef isupper
+#define isupper(i) xf86isupper(i)
+#undef isxdigit
+#define isxdigit(i) xf86isxdigit(i)
+#undef labs
+#define labs(l) xf86labs(l)
+#undef ldexp
+#define ldexp(x, exp) xf86ldexp(x, exp)
+#undef log
+#define log(d) xf86log(d)
+#undef log10
+#define log10(d) xf86log10(d)
+#undef malloc
+#define malloc(I) xf86malloc(I)
+#undef memchr
+#define memchr(cvp,i,I) xf86memchr(cvp,i,I)
+#undef memcmp
+#define memcmp(cvp1,cvp2,I) xf86memcmp(cvp1,cvp2,I)
+#undef memcpy
+#define memcpy(vp,cvp,I) xf86memcpy(vp,cvp,I)
+#undef memmove
+#define memmove(vp,cvp,I) xf86memmove(vp,cvp,I)
+#undef memset
+#define memset(vp,int,I) xf86memset(vp,int,I)
+#undef modf
+#define modf(d,dp) xf86modf(d,dp)
+#undef perror
+#define perror(ccp) xf86perror(ccp)
+#undef pow
+#define pow(d1,d2) xf86pow(d1,d2)
+#undef realloc
+#define realloc(vp,I) xf86realloc(vp,I)
+#undef remove
+#define remove(ccp) xf86remove(ccp)
+#undef rename
+#define rename(ccp1,ccp2) xf86rename(ccp1,ccp2)
+#undef rewind
+#define rewind(FP) xf86rewind(FP)
+#undef setbuf
+#define setbuf(FP,cp) xf86setbuf(FP,cp)
+#undef setvbuf
+#define setvbuf(FP,cp,i,I) xf86setvbuf(FP,cp,i,I)
+#undef sin
+#define sin(d) xf86sin(d)
+#undef snprintf
+#define snprintf xf86snprintf
+#undef sprintf
+#define sprintf xf86sprintf
+#undef sqrt
+#define sqrt(d) xf86sqrt(d)
+#undef sscanf
+#define sscanf xf86sscanf
+#undef strcat
+#define strcat(cp,ccp) xf86strcat(cp,ccp)
+#undef strcmp
+#define strcmp(ccp1,ccp2) xf86strcmp(ccp1,ccp2)
+#undef strcasecmp
+#define strcasecmp(ccp1,ccp2) xf86strcasecmp(ccp1,ccp2)
+#undef strcpy
+#define strcpy(cp,ccp) xf86strcpy(cp,ccp)
+#undef strcspn
+#define strcspn(ccp1,ccp2) xf86strcspn(ccp1,ccp2)
+#undef strerror
+#define strerror(i) xf86strerror(i)
+#undef strlen
+#define strlen(ccp) xf86strlen(ccp)
+#undef strncmp
+#define strncmp(ccp1,ccp2,I) xf86strncmp(ccp1,ccp2,I)
+#undef strncasecmp
+#define strncasecmp(ccp1,ccp2,I) xf86strncasecmp(ccp1,ccp2,I)
+#undef strncpy
+#define strncpy(cp,ccp,I) xf86strncpy(cp,ccp,I)
+#undef strpbrk
+#define strpbrk(ccp1,ccp2) xf86strpbrk(ccp1,ccp2)
+#undef strchr
+#define strchr(ccp,i) xf86strchr(ccp,i)
+#undef strrchr
+#define strrchr(ccp,i) xf86strrchr(ccp,i)
+#undef strspn
+#define strspn(ccp1,ccp2) xf86strspn(ccp1,ccp2)
+#undef strstr
+#define strstr(ccp1,ccp2) xf86strstr(ccp1,ccp2)
+#undef srttod
+#define strtod(ccp,cpp) xf86strtod(ccp,cpp)
+#undef strtok
+#define strtok(cp,ccp) xf86strtok(cp,ccp)
+#undef strtol
+#define strtol(ccp,cpp,i) xf86strtol(ccp,cpp,i)
+#undef strtoul
+#define strtoul(ccp,cpp,i) xf86strtoul(ccp,cpp,i)
+#undef tan
+#define tan(d) xf86tan(d)
+#undef tmpfile
+#define tmpfile() xf86tmpfile()
+#undef tolower
+#define tolower(i) xf86tolower(i)
+#undef toupper
+#define toupper(i) xf86toupper(i)
+#undef ungetc
+#define ungetc(i,FP) xf86ungetc(i,FP)
+#undef vfprinf
+#define vfprintf xf86vfprintf
+#undef vsnprintf
+#define vsnprintf xf86vsnprintf
+#undef vsprintf
+#define vsprintf xf86vsprintf
+/* XXX Disable assert as if NDEBUG was defined */
+/* Some X headers defined this away too */
+#undef assert
+#define assert(a) ((void)0)
+#undef HUGE_VAL
+#define HUGE_VAL xf86HUGE_VAL
+
+#undef hypot
+#define hypot(x,y) xf86hypot(x,y)
+
+#define qsort(b, n, s, f) xf86qsort(b, n, s, f)
+
+/* non-ANSI C functions */
+#undef opendir
+#define opendir(cp) xf86opendir(cp)
+#undef closedir
+#define closedir(DP) xf86closedir(DP)
+#undef readdir
+#define readdir(DP) xf86readdir(DP)
+#undef rewinddir
+#define rewinddir(DP) xf86rewinddir(DP)
+#undef bcopy
+#define bcopy(vp,cvp,I) xf86memmove(cvp,vp,I)
+#undef ffs
+#define ffs(i) xf86ffs(i)
+#undef strdup
+#define strdup(ccp) xf86strdup(ccp)
+#undef bzero
+#define bzero(vp,ui) xf86bzero(vp,ui)
+#undef execl
+#define execl xf86execl
+#undef chmod
+#define chmod(a,b) xf86chmod(a,b)
+#undef chown
+#define chown(a,b,c) xf86chown(a,b,c)
+#undef geteuid
+#define geteuid xf86geteuid
+#undef getegid
+#define getegid xf86getegid
+#undef getpid
+#define getpid xf86getpid
+#undef mknod
+#define mknod(a,b,c) xf86mknod(a,b,c)
+#undef sleep
+#define sleep(a) xf86sleep(a)
+#undef mkdir
+#define mkdir(a,b) xf86mkdir(a,b)
+#undef getpagesize
+#define getpagesize xf86getpagesize
+#define shmget(a,b,c) xf86shmget(a,b,c)
+#define shmat(a,b,c) xf86shmat(a,b,c)
+#define shmdt(a) xf86shmdt(a)
+#define shmctl(a,b,c) xf86shmctl(a,b,c)
+#define setjmp(a) xf86setjmp(a)
+#define longjmp(a,b) xf86longjmp(a,b)
+
+#undef S_ISUID
+#define S_ISUID XF86_S_ISUID
+#undef S_ISGID
+#define S_ISGID XF86_S_ISGID
+#undef S_ISVTX
+#define S_ISVTX XF86_S_ISVTX
+#undef S_IRUSR
+#define S_IRUSR XF86_S_IRUSR
+#undef S_IWUSR
+#define S_IWUSR XF86_S_IWUSR
+#undef S_IXUSR
+#define S_IXUSR XF86_S_IXUSR
+#undef S_IRGRP
+#define S_IRGRP XF86_S_IRGRP
+#undef S_IWGRP
+#define S_IWGRP XF86_S_IWGRP
+#undef S_IXGRP
+#define S_IXGRP XF86_S_IXGRP
+#undef S_IROTH
+#define S_IROTH XF86_S_IROTH
+#undef S_IWOTH
+#define S_IWOTH XF86_S_IWOTH
+#undef S_IXOTH
+#define S_IXOTH XF86_S_IXOTH
+#undef S_IFREG
+#define S_IFREG XF86_S_IFREG
+#undef S_IFCHR
+#define S_IFCHR XF86_S_IFCHR
+#undef S_IFBLK
+#define S_IFBLK XF86_S_IFBLK
+#undef S_IFIFO
+#define S_IFIFO XF86_S_IFIFO
+
+/* some types */
+#undef FILE
+#define FILE XF86FILE
+#undef fpos_t
+#define fpos_t XF86fpos_t
+#undef DIR
+#define DIR XF86DIR
+#undef DIRENT
+#define DIRENT XF86DIRENT
+#undef size_t
+#define size_t xf86size_t
+#undef ssize_t
+#define ssize_t xf86ssize_t
+#undef dev_t
+#define dev_t xf86dev_t
+#undef mode_t
+#define mode_t xf86mode_t
+#undef uid_t
+#define uid_t xf86uid_t
+#undef gid_t
+#define gid_t xf86gid_t
+#undef jmp_buf
+#define jmp_buf xf86jmp_buf
+#define stat_t struct xf86stat
+
+/*
+ * There should be no need to #undef any of these. If they are already
+ * defined it is because some illegal header has been included.
+ */
+
+/* some vars */
+#undef stdin
+#define stdin xf86stdin
+#undef stdout
+#define stdout xf86stdout
+#undef stderr
+#define stderr xf86stderr
+
+#undef SEEK_SET
+#define SEEK_SET XF86_SEEK_SET
+#undef SEEK_CUR
+#define SEEK_CUR XF86_SEEK_CUR
+#undef SEEK_END
+#define SEEK_END XF86_SEEK_END
+
+/*
+ * XXX Basic I/O functions BAD,BAD,BAD!
+ */
+#define open xf86open
+#define close(a) xf86close(a)
+#define lseek(a,b,c) xf86lseek(a,b,c)
+#define ioctl(a,b,c) xf86ioctl(a,b,c)
+#define read(a,b,c) xf86read(a,b,c)
+#define write(a,b,c) xf86write(a,b,c)
+#define mmap(a,b,c,d,e,f) xf86mmap(a,b,c,d,e,f)
+#define munmap(a,b) xf86munmap(a,b)
+#define stat(a,b) xf86stat(a,b)
+#define fstat(a,b) xf86fstat(a,b)
+#define access(a,b) xf86access(a,b)
+#undef O_RDONLY
+#define O_RDONLY XF86_O_RDONLY
+#undef O_WRONLY
+#define O_WRONLY XF86_O_WRONLY
+#undef O_RDWR
+#define O_RDWR XF86_O_RDWR
+#undef O_CREAT
+#define O_CREAT XF86_O_CREAT
+#undef PROT_EXEC
+#define PROT_EXEC XF86_PROT_EXEC
+#undef PROT_READ
+#define PROT_READ XF86_PROT_READ
+#undef PROT_WRITE
+#define PROT_WRITE XF86_PROT_WRITE
+#undef PROT_NONE
+#define PROT_NONE XF86_PROT_NONE
+#undef MAP_FIXED
+#define MAP_FIXED XF86_MAP_FIXED
+#undef MAP_SHARED
+#define MAP_SHARED XF86_MAP_SHARED
+#undef MAP_PRIVATE
+#define MAP_PRIVATE XF86_MAP_PRIVATE
+#undef MAP_FAILED
+#define MAP_FAILED XF86_MAP_FAILED
+#undef R_OK
+#define R_OK XF86_R_OK
+#undef W_OK
+#define W_OK XF86_W_OK
+#undef X_OK
+#define X_OK XF86_X_OK
+#undef F_OK
+#define F_OK XF86_F_OK
+#ifndef __EMX__
+#undef errno
+#define errno xf86errno
+#endif
+#undef putchar
+#define putchar(i) xf86fputc(i, xf86stdout)
+#undef puts
+#define puts(s) xf86fputs(s, xf86stdout)
+
+#undef EACCES
+#define EACCES xf86_EACCES
+#undef EAGAIN
+#define EAGAIN xf86_EAGAIN
+#undef EBADF
+#define EBADF xf86_EBADF
+#undef EEXIST
+#define EEXIST xf86_EEXIST
+#undef EFAULT
+#define EFAULT xf86_EFAULT
+#undef EINTR
+#define EINTR xf86_EINTR
+#undef EINVAL
+#define EINVAL xf86_EINVAL
+#undef EISDIR
+#define EISDIR xf86_EISDIR
+#undef ELOOP
+#define ELOOP xf86_ELOOP
+#undef EMFILE
+#define EMFILE xf86_EMFILE
+#undef ENAMETOOLONG
+#define ENAMETOOLONG xf86_ENAMETOOLONG
+#undef ENFILE
+#define ENFILE xf86_ENFILE
+#undef ENOENT
+#define ENOENT xf86_ENOENT
+#undef ENOMEM
+#define ENOMEM xf86_ENOMEM
+#undef ENOSPC
+#define ENOSPC xf86_ENOSPC
+#undef ENOTDIR
+#define ENOTDIR xf86_ENOTDIR
+#undef EPIPE
+#define EPIPE xf86_EPIPE
+#undef EROFS
+#define EROFS xf86_EROFS
+#undef ETXTBSY
+#define ETXTBSY xf86_ETXTBSY
+#undef ENOTTY
+#define ENOTTY xf86_ENOTTY
+#undef ENOSYS
+#define ENOSYS xf86_ENOSYS
+#undef EBUSY
+#define EBUSY xf86_EBUSY
+#undef ENODEV
+#define ENODEV xf86_ENODEV
+#undef EIO
+#define EIO xf86_EIO
+
+/* IPC stuff */
+#undef SHM_RDONLY
+#define SHM_RDONLY XF86SHM_RDONLY
+#undef SHM_RND
+#define SHM_RND XF86SHM_RND
+#undef SHM_REMAP
+#define SHM_REMAP XF86SHM_REMAP
+#undef IPC_RMID
+#define IPC_RMID XF86IPC_RMID
+#undef IPC_CREAT
+#define IPC_CREAT XF86IPC_CREAT
+#undef IPC_EXCL
+#define IPC_EXCL XF86IPC_EXCL
+#undef PC_NOWAIT
+#define IPC_NOWAIT XF86IPC_NOWAIT
+#undef SHM_R
+#define SHM_R XF86SHM_R
+#undef SHM_W
+#define SHM_W XF86SHM_W
+#undef IPC_PRIVATE
+#define IPC_PRIVATE XF86IPC_PRIVATE
+
+/* Some ANSI macros */
+#undef FILENAME_MAX
+#define FILENAME_MAX 1024
+
+#endif /* XFree86LOADER */
+
+#endif /* XF86_LIBC_H */
diff --git a/Xincludes/xc/programs/Xserver/mi/mipointer.h b/Xincludes/xc/programs/Xserver/mi/mipointer.h
new file mode 100644
index 0000000..f8e7fd0
--- /dev/null
+++ b/Xincludes/xc/programs/Xserver/mi/mipointer.h
@@ -0,0 +1,162 @@
+/*
+ * mipointer.h
+ *
+ */
+
+/* $Xorg: mipointer.h,v 1.4 2001/02/09 02:05:21 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.
+*/
+/* $XFree86: xc/programs/Xserver/mi/mipointer.h,v 3.8 2001/08/06 20:51:19 dawes Exp $ */
+
+#ifndef MIPOINTER_H
+#define MIPOINTER_H
+
+#include "cursor.h"
+#include "input.h"
+
+typedef struct _miPointerSpriteFuncRec {
+ Bool (*RealizeCursor)(
+ ScreenPtr /* pScr */,
+ CursorPtr /* pCurs */
+ );
+ Bool (*UnrealizeCursor)(
+ ScreenPtr /* pScr */,
+ CursorPtr /* pCurs */
+ );
+ void (*SetCursor)(
+ ScreenPtr /* pScr */,
+ CursorPtr /* pCurs */,
+ int /* x */,
+ int /* y */
+ );
+ void (*MoveCursor)(
+ ScreenPtr /* pScr */,
+ int /* x */,
+ int /* y */
+ );
+} miPointerSpriteFuncRec, *miPointerSpriteFuncPtr;
+
+typedef struct _miPointerScreenFuncRec {
+ Bool (*CursorOffScreen)(
+ ScreenPtr* /* ppScr */,
+ int* /* px */,
+ int* /* py */
+ );
+ void (*CrossScreen)(
+ ScreenPtr /* pScr */,
+ int /* entering */
+ );
+ void (*WarpCursor)(
+ ScreenPtr /* pScr */,
+ int /* x */,
+ int /* y */
+ );
+ void (*EnqueueEvent)(
+ xEventPtr /* event */
+ );
+ void (*NewEventScreen)(
+ ScreenPtr /* pScr */,
+ Bool /* fromDIX */
+ );
+} miPointerScreenFuncRec, *miPointerScreenFuncPtr;
+
+extern Bool miDCInitialize(
+ ScreenPtr /*pScreen*/,
+ miPointerScreenFuncPtr /*screenFuncs*/
+);
+
+extern Bool miPointerInitialize(
+ ScreenPtr /*pScreen*/,
+ miPointerSpriteFuncPtr /*spriteFuncs*/,
+ miPointerScreenFuncPtr /*screenFuncs*/,
+ Bool /*waitForUpdate*/
+);
+
+extern void miPointerWarpCursor(
+ ScreenPtr /*pScreen*/,
+ int /*x*/,
+ int /*y*/
+);
+
+extern int miPointerGetMotionBufferSize(
+ void
+);
+
+extern int miPointerGetMotionEvents(
+ DeviceIntPtr /*pPtr*/,
+ xTimecoord * /*coords*/,
+ unsigned long /*start*/,
+ unsigned long /*stop*/,
+ ScreenPtr /*pScreen*/
+);
+
+extern void miPointerUpdate(
+ void
+);
+
+extern void miPointerDeltaCursor(
+ int /*dx*/,
+ int /*dy*/,
+ unsigned long /*time*/
+);
+
+extern void miPointerAbsoluteCursor(
+ int /*x*/,
+ int /*y*/,
+ unsigned long /*time*/
+);
+
+extern void miPointerPosition(
+ int * /*x*/,
+ int * /*y*/
+);
+
+#undef miRegisterPointerDevice
+extern void miRegisterPointerDevice(
+ ScreenPtr /*pScreen*/,
+ DevicePtr /*pDevice*/
+);
+
+extern void miPointerSetNewScreen(
+ int, /*screen_no*/
+ int, /*x*/
+ int /*y*/
+);
+extern ScreenPtr miPointerCurrentScreen(
+ void
+);
+
+#define miRegisterPointerDevice(pScreen,pDevice) \
+ _miRegisterPointerDevice(pScreen,pDevice)
+
+extern void _miRegisterPointerDevice(
+ ScreenPtr /*pScreen*/,
+ DeviceIntPtr /*pDevice*/
+);
+
+extern int miPointerScreenIndex;
+
+#endif /* MIPOINTER_H */