diff options
Diffstat (limited to 'nx-X11/programs/Xserver/include')
58 files changed, 4052 insertions, 1662 deletions
diff --git a/nx-X11/programs/Xserver/include/.gitignore b/nx-X11/programs/Xserver/include/.gitignore new file mode 100644 index 000000000..919ccf080 --- /dev/null +++ b/nx-X11/programs/Xserver/include/.gitignore @@ -0,0 +1 @@ +osdep.h diff --git a/nx-X11/programs/Xserver/include/Imakefile b/nx-X11/programs/Xserver/include/Imakefile index 210067635..4c168edf1 100644 --- a/nx-X11/programs/Xserver/include/Imakefile +++ b/nx-X11/programs/Xserver/include/Imakefile @@ -1,22 +1,7 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:53:29 cpqbld Exp $ - - - - -XCOMM $XFree86: xc/programs/Xserver/include/Imakefile,v 3.21 2001/01/17 22:36:56 dawes Exp $ - HEADERS = os.h misc.h -#if defined(XorgVersion) || defined(XFree86Version) \ +#if defined(XorgVersion) \ || defined(BSDOSArchitecture) -#if DoLoadableServer -LinkSourceFile(xf86Module.h,$(XF86COMSRC)) -LinkSourceFile(xf86Opt.h,$(XF86COMSRC)) -#endif -LinkSourceFile(xf86_libc.h,$(XF86OSSRC)) -LinkSourceFile(xf86_ansic.h,$(XF86OSSRC)) -LinkSourceFile(xf86Version.h,$(XF86SRC)) -LinkSourceFile(compiler.h,$(XF86COMSRC)) #endif LinkSourceFile(osdep.h,../os) @@ -29,8 +14,10 @@ all:: depend:: InstallDriverSDKNonExecFile(XIstubs.h,$(DRIVERSDKINCLUDEDIR)) +InstallDriverSDKNonExecFile(Xprintf.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(bstore.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(bstorestr.h,$(DRIVERSDKINCLUDEDIR)) +InstallDriverSDKNonExecFile(client.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(colormap.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(colormapst.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(cursor.h,$(DRIVERSDKINCLUDEDIR)) @@ -45,6 +32,7 @@ InstallDriverSDKNonExecFile(gcstruct.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(globals.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(input.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(inputstr.h,$(DRIVERSDKINCLUDEDIR)) +InstallDriverSDKNonExecFile(list.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(misc.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(miscstruct.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(opaque.h,$(DRIVERSDKINCLUDEDIR)) @@ -63,5 +51,5 @@ InstallDriverSDKNonExecFile(validate.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(window.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(windowstr.h,$(DRIVERSDKINCLUDEDIR)) -BuildIncludes($(HEADERS),X11,..) -InstallMultipleFlags($(HEADERS),$(INCDIR)/X11,$(INSTINCFLAGS)) +BuildIncludes($(HEADERS),nx-X11,..) +InstallMultipleFlags($(HEADERS),$(INCDIR)/nx-X11,$(INSTINCFLAGS)) diff --git a/nx-X11/programs/Xserver/include/XIstubs.h b/nx-X11/programs/Xserver/include/XIstubs.h index e005493c4..45f6eb10c 100644 --- a/nx-X11/programs/Xserver/include/XIstubs.h +++ b/nx-X11/programs/Xserver/include/XIstubs.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/include/XIstubs.h,v 3.1 1996/04/15 11:34:22 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> diff --git a/nx-X11/programs/Xserver/include/Xprintf.h b/nx-X11/programs/Xserver/include/Xprintf.h new file mode 100644 index 000000000..e9ee79d22 --- /dev/null +++ b/nx-X11/programs/Xserver/include/Xprintf.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef XPRINTF_H +#define XPRINTF_H + +#include <stdio.h> +#include <stdarg.h> +#include <nx-X11/Xfuncproto.h> + +#ifndef _X_RESTRICT_KYWD +#if defined(restrict) /* assume autoconf set it correctly */ || \ + (defined(__STDC__) && (__STDC_VERSION__ - 0 >= 199901L)) /* C99 */ +#define _X_RESTRICT_KYWD restrict +#elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */ +#define _X_RESTRICT_KYWD __restrict__ +#else +#define _X_RESTRICT_KYWD +#endif +#endif + +/* + * These functions provide a portable implementation of the common (but not + * yet universal) asprintf & vasprintf routines to allocate a buffer big + * enough to sprintf the arguments to. The XNF variants terminate the server + * if the allocation fails. + * The buffer allocated is returned in the pointer provided in the first + * argument. The return value is the size of the allocated buffer, or -1 + * on failure. + */ +extern _X_EXPORT int +Xasprintf(char **ret, const char *_X_RESTRICT_KYWD fmt, ...) +_X_ATTRIBUTE_PRINTF(2, 3); +extern _X_EXPORT int +Xvasprintf(char **ret, const char *_X_RESTRICT_KYWD fmt, va_list va) +_X_ATTRIBUTE_PRINTF(2, 0); +extern _X_EXPORT int +XNFasprintf(char **ret, const char *_X_RESTRICT_KYWD fmt, ...) +_X_ATTRIBUTE_PRINTF(2, 3); +extern _X_EXPORT int +XNFvasprintf(char **ret, const char *_X_RESTRICT_KYWD fmt, va_list va) +_X_ATTRIBUTE_PRINTF(2, 0); + +#if !defined(HAVE_ASPRINTF) && !defined(HAVE_VASPRINTF) +#define asprintf Xasprintf +#define vasprintf Xvasprintf +#endif + +/* + * These functions provide a portable implementation of the linux kernel + * scnprintf & vscnprintf routines that return the number of bytes actually + * copied during a snprintf, (excluding the final '\0'). + */ +extern _X_EXPORT int +Xscnprintf(char *s, int n, const char * _X_RESTRICT_KYWD fmt, ...) +_X_ATTRIBUTE_PRINTF(3,4); +extern _X_EXPORT int +Xvscnprintf(char *s, int n, const char * _X_RESTRICT_KYWD fmt, va_list va) +_X_ATTRIBUTE_PRINTF(3,0); + +#endif /* XPRINTF_H */ diff --git a/nx-X11/programs/Xserver/include/bstore.h b/nx-X11/programs/Xserver/include/bstore.h index 098abcd86..843d6bb35 100644 --- a/nx-X11/programs/Xserver/include/bstore.h +++ b/nx-X11/programs/Xserver/include/bstore.h @@ -1,4 +1,3 @@ -/* $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 * diff --git a/nx-X11/programs/Xserver/include/bstorestr.h b/nx-X11/programs/Xserver/include/bstorestr.h index 8f21855c4..14e2fe1da 100644 --- a/nx-X11/programs/Xserver/include/bstorestr.h +++ b/nx-X11/programs/Xserver/include/bstorestr.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/include/bstorestr.h,v 1.2 2001/01/06 20:58:12 tsi Exp $*/ /* * Copyright (c) 1987 by the Regents of the University of California * diff --git a/nx-X11/programs/Xserver/include/client.h b/nx-X11/programs/Xserver/include/client.h new file mode 100644 index 000000000..87f2b1172 --- /dev/null +++ b/nx-X11/programs/Xserver/include/client.h @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). All + * rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice 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 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/* Author: Rami Ylimäki <rami.ylimaki@vincit.fi> */ + +#ifndef CLIENT_H +#define CLIENT_H + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif /* HAVE_DIX_CONFIG_H */ +#include <X11/Xfuncproto.h> +#include <sys/types.h> + +/* Client IDs. Use GetClientPid, GetClientCmdName and GetClientCmdArgs + * instead of accessing the fields directly. */ +typedef struct { + pid_t pid; /* process ID, -1 if not available */ + const char *cmdname; /* process name, NULL if not available */ + const char *cmdargs; /* process arguments, NULL if not available */ +} ClientIdRec, *ClientIdPtr; + +struct _Client; + +/* Initialize and clean up. */ +void ReserveClientIds(struct _Client *client); +void ReleaseClientIds(struct _Client *client); + +/* Determine client IDs for caching. Exported on purpose for + * extensions such as SELinux. */ +extern _X_EXPORT pid_t DetermineClientPid(struct _Client *client); +extern _X_EXPORT void DetermineClientCmd(pid_t, const char **cmdname, + const char **cmdargs); + +/* Query cached client IDs. Exported on purpose for drivers. */ +extern _X_EXPORT pid_t GetClientPid(struct _Client *client); +extern _X_EXPORT const char *GetClientCmdName(struct _Client *client); +extern _X_EXPORT const char *GetClientCmdArgs(struct _Client *client); + +#endif /* CLIENT_H */ diff --git a/nx-X11/programs/Xserver/include/closestr.h b/nx-X11/programs/Xserver/include/closestr.h index d70f754b2..b19108d94 100644 --- a/nx-X11/programs/Xserver/include/closestr.h +++ b/nx-X11/programs/Xserver/include/closestr.h @@ -1,4 +1,3 @@ -/* $Xorg: closestr.h,v 1.4 2001/02/09 02:05:14 xorgcvs Exp $ */ /* Copyright 1991, 1998 The Open Group @@ -26,14 +25,12 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/include/closestr.h,v 3.4 2001/12/14 19:59:53 dawes Exp $ */ #ifndef CLOSESTR_H #define CLOSESTR_H -#define NEED_REPLIES -#include <X11/Xproto.h> +#include <nx-X11/Xproto.h> #include "closure.h" #include "dix.h" #include "misc.h" @@ -69,7 +66,7 @@ typedef struct _LFWIstate { int current_fpe; int max_names; Bool list_started; - pointer private; + void * private; } LFWIstateRec, *LFWIstatePtr; typedef struct _LFWIclosure { diff --git a/nx-X11/programs/Xserver/include/closure.h b/nx-X11/programs/Xserver/include/closure.h index 839303c96..b261f5e0d 100644 --- a/nx-X11/programs/Xserver/include/closure.h +++ b/nx-X11/programs/Xserver/include/closure.h @@ -1,4 +1,3 @@ -/* $Xorg: closure.h,v 1.4 2001/02/09 02:05:14 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group diff --git a/nx-X11/programs/Xserver/include/colormap.h b/nx-X11/programs/Xserver/include/colormap.h index 1f2c33075..be3803848 100644 --- a/nx-X11/programs/Xserver/include/colormap.h +++ b/nx-X11/programs/Xserver/include/colormap.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/include/colormap.h,v 1.5 2001/12/14 19:59:53 dawes Exp $ */ /* Copyright 1987, 1998 The Open Group @@ -45,12 +44,11 @@ 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 <nx-X11/Xproto.h> #include "screenint.h" #include "window.h" @@ -87,16 +85,16 @@ extern int CreateColormap( int /*client*/); extern int FreeColormap( - pointer /*pmap*/, + void * /*pmap*/, XID /*mid*/); extern int TellLostMap( WindowPtr /*pwin*/, - pointer /* Colormap *pmid */); + void * /* Colormap *pmid */); extern int TellGainedMap( WindowPtr /*pwin*/, - pointer /* Colormap *pmid */); + void * /* Colormap *pmid */); extern int CopyColormapAndFree( Colormap /*mid*/, @@ -140,7 +138,7 @@ extern int QueryColors( xrgb* /*prgbList*/); extern int FreeClientPixels( - pointer /*pcr*/, + void * /*pcr*/, XID /*fakeid*/); extern int AllocColorCells( @@ -181,4 +179,8 @@ extern int IsMapInstalled( Colormap /*map*/, WindowPtr /*pWin*/); +extern Bool ResizeVisualArray(ScreenPtr /* pScreen */ , + int /* new_vis_count */ , + DepthPtr /* depth */ ); + #endif /* CMAP_H */ diff --git a/nx-X11/programs/Xserver/include/colormapst.h b/nx-X11/programs/Xserver/include/colormapst.h index 5ceee9870..a8fa055de 100644 --- a/nx-X11/programs/Xserver/include/colormapst.h +++ b/nx-X11/programs/Xserver/include/colormapst.h @@ -44,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Xorg: colormapst.h,v 1.4 2001/02/09 02:05:14 xorgcvs Exp $ */ #ifndef CMAPSTRUCT_H #define CMAPSTRUCT_H 1 @@ -113,7 +112,7 @@ typedef struct _ColormapRec Entry *red; Entry *green; Entry *blue; - pointer devPriv; + void * devPriv; DevUnion *devPrivates; /* dynamic devPrivates added after devPriv already existed - must keep devPriv */ } ColormapRec; diff --git a/nx-X11/programs/Xserver/include/cursor.h b/nx-X11/programs/Xserver/include/cursor.h index 9eb799e1c..4b9444888 100644 --- a/nx-X11/programs/Xserver/include/cursor.h +++ b/nx-X11/programs/Xserver/include/cursor.h @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/include/cursor.h,v 1.6 2005/08/24 11:18:30 daniels Exp $ */ -/* $XFree86: xc/programs/Xserver/include/cursor.h,v 1.6 2002/09/17 01:15:14 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -46,7 +44,6 @@ 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 @@ -68,7 +65,7 @@ typedef struct _CursorMetric *CursorMetricPtr; extern CursorPtr rootCursor; extern int FreeCursor( - pointer /*pCurs*/, + void * /*pCurs*/, XID /*cid*/); /* Quartz support on Mac OS X pulls in the QuickDraw diff --git a/nx-X11/programs/Xserver/include/cursorstr.h b/nx-X11/programs/Xserver/include/cursorstr.h index c877d6cc9..bc7d24c04 100644 --- a/nx-X11/programs/Xserver/include/cursorstr.h +++ b/nx-X11/programs/Xserver/include/cursorstr.h @@ -1,4 +1,3 @@ -/* $Xorg: cursorstr.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/include/cursorstr.h,v 1.8 2002/11/30 06:21:51 keithp Exp $ */ #ifndef CURSORSTRUCT_H #define CURSORSTRUCT_H @@ -65,7 +63,7 @@ typedef struct _CursorBits { Bool emptyMask; /* all zeros mask */ unsigned short width, height, xhot, yhot; /* metrics */ int refcnt; /* can be shared */ - pointer devPriv[MAXSCREENS]; /* set by pScr->RealizeCursor*/ + void * devPriv[MAXSCREENS]; /* set by pScr->RealizeCursor*/ #ifdef ARGB_CURSOR CARD32 *argb; /* full-color alpha blended */ #endif @@ -76,7 +74,7 @@ typedef struct _Cursor { unsigned short foreRed, foreGreen, foreBlue; /* device-independent color */ unsigned short backRed, backGreen, backBlue; /* device-independent color */ int refcnt; - pointer devPriv[MAXSCREENS]; /* set by pScr->RealizeCursor*/ + void * devPriv[MAXSCREENS]; /* set by pScr->RealizeCursor*/ #ifdef XFIXES CARD32 serialNumber; Atom name; @@ -92,7 +90,4 @@ typedef struct { ScreenPtr pScreen; } HotSpot; -#ifdef XEVIE -extern HotSpot xeviehot; -#endif #endif /* CURSORSTRUCT_H */ diff --git a/nx-X11/programs/Xserver/include/dix.h b/nx-X11/programs/Xserver/include/dix.h index 1b8fc4265..4a57f724d 100644 --- a/nx-X11/programs/Xserver/include/dix.h +++ b/nx-X11/programs/Xserver/include/dix.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/include/dix.h,v 3.26 2003/01/12 02:44:27 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,11 +44,12 @@ 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 <stdint.h> + #include "gc.h" #include "window.h" #include "input.h" @@ -71,9 +71,14 @@ SOFTWARE. if ((sizeof(req) >> 2) > client->req_len )\ return(BadLength) +#define REQUEST_AT_LEAST_EXTRA_SIZE(req, extra) \ + if (((sizeof(req) + ((uint64_t) extra)) >> 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)) \ + ((n >> 2) >= client->req_len) || \ + ((((uint64_t) sizeof(req) + (n) + 3) >> 2) != (uint64_t) client->req_len)) \ return(BadLength) #define LEGAL_NEW_RESOURCE(id,client)\ @@ -86,15 +91,11 @@ SOFTWARE. /* 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)) + ((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);\ @@ -108,9 +109,6 @@ SOFTWARE. } #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);\ @@ -122,10 +120,7 @@ SOFTWARE. } #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);\ + pGC = (GC *) SecurityLookupIDByType(client, rid, RT_GC, mode);\ if (!pGC)\ {\ client->errorValue = rid;\ @@ -133,20 +128,17 @@ SOFTWARE. } #define VERIFY_DRAWABLE(pDraw, did, client)\ - SECURITY_VERIFY_DRAWABLE(pDraw, did, client, SecurityUnknownAccess) + SECURITY_VERIFY_DRAWABLE(pDraw, did, client, DixUnknownAccess) #define VERIFY_GEOMETRABLE(pDraw, did, client)\ - SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, SecurityUnknownAccess) + SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, DixUnknownAccess) #define VERIFY_GC(pGC, rid, client)\ - SECURITY_VERIFY_GC(pGC, rid, client, SecurityUnknownAccess) + SECURITY_VERIFY_GC(pGC, rid, client, DixUnknownAccess) #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) \ @@ -159,9 +151,6 @@ SOFTWARE. } #define VERIFY_GEOMETRABLE(pDraw, did, client)\ - if (client->lastDrawableID == did)\ - pDraw = client->lastDrawable;\ - else \ {\ pDraw = (DrawablePtr) LookupIDByClass(did, RC_DRAWABLE);\ if (!pDraw) \ @@ -172,10 +161,7 @@ SOFTWARE. } #define VERIFY_GC(pGC, rid, client)\ - if (client->lastGCID == rid)\ - pGC = client->lastGC;\ - else\ - pGC = (GC *)LookupIDByType(rid, RT_GC);\ + pGC = (GC *)LookupIDByType(rid, RT_GC);\ if (!pGC)\ {\ client->errorValue = rid;\ @@ -247,23 +233,12 @@ SOFTWARE. #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);\ + SECURITY_VERIFY_GEOMETRABLE(pDraw, drawID, client, DixWriteAccess);\ + SECURITY_VERIFY_GC(pGC, stuff->gc, client, DixReadAccess);\ 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)\ @@ -274,12 +249,12 @@ SOFTWARE. if ((pClient)->swapped) \ (*ReplySwapVector[((xReq *)(pClient)->requestBuffer)->reqType]) \ (pClient, (int)(size), pReply); \ - else (void) WriteToClient(pClient, (int)(size), (char *)(pReply)); } + else WriteToClient(pClient, (int)(size), (pReply)); } #define WriteSwappedDataToClient(pClient, size, pbuf) \ if ((pClient)->swapped) \ (*(pClient)->pSwapReplyFunc)(pClient, (int)(size), pbuf); \ - else (void) WriteToClient (pClient, (int)(size), (char *)(pbuf)); + else WriteToClient (pClient, (int)(size), (pbuf)); typedef struct _TimeStamp *TimeStampPtr; @@ -320,10 +295,8 @@ extern void UpdateCurrentTimeIf(void); extern void InitSelections(void); -extern void FlushClientCaches(XID /*id*/); - extern int dixDestroyPixmap( - pointer /*value*/, + void * /*value*/, XID /*pid*/); extern void CloseDownRetainedResources(void); @@ -331,10 +304,10 @@ extern void CloseDownRetainedResources(void); extern void InitClient( ClientPtr /*client*/, int /*i*/, - pointer /*ospriv*/); + void * /*ospriv*/); extern ClientPtr NextAvailableClient( - pointer /*ospriv*/); + void * /*ospriv*/); extern void SendErrorToClient( ClientPtr /*client*/, @@ -368,10 +341,6 @@ extern int DoGetImage( Mask /*planemask*/, xGetImageReply ** /*im_return*/); -#ifdef LBX -extern void IncrementClientCount(void); -#endif /* LBX */ - #if defined(DDXBEFORERESET) extern void ddxBeforeReset (void); #endif @@ -379,8 +348,8 @@ extern void ddxBeforeReset (void); /* dixutils.c */ extern void CopyISOLatin1Lowered( - unsigned char * /*dest*/, - unsigned char * /*source*/, + char * /*dest*/, + const char * /*source*/, int /*length*/); extern int CompareISOLatin1Lowered( @@ -396,7 +365,7 @@ extern WindowPtr SecurityLookupWindow( ClientPtr /*client*/, Mask /*access_mode*/); -extern pointer SecurityLookupDrawable( +extern void * SecurityLookupDrawable( XID /*rid*/, ClientPtr /*client*/, Mask /*access_mode*/); @@ -405,7 +374,7 @@ extern WindowPtr LookupWindow( XID /*rid*/, ClientPtr /*client*/); -extern pointer LookupDrawable( +extern void * LookupDrawable( XID /*rid*/, ClientPtr /*client*/); @@ -415,7 +384,7 @@ extern WindowPtr LookupWindow( XID /*rid*/, ClientPtr /*client*/); -extern pointer LookupDrawable( +extern void * LookupDrawable( XID /*rid*/, ClientPtr /*client*/); @@ -444,27 +413,27 @@ extern void DeleteWindowFromAnySaveSet( WindowPtr /*pWin*/); extern void BlockHandler( - pointer /*pTimeout*/, - pointer /*pReadmask*/); + void * /*pTimeout*/, + void * /*pReadmask*/); extern void WakeupHandler( int /*result*/, - pointer /*pReadmask*/); + void * /*pReadmask*/); typedef void (* WakeupHandlerProcPtr)( - pointer /* blockData */, + void * /* blockData */, int /* result */, - pointer /* pReadmask */); + void * /* pReadmask */); extern Bool RegisterBlockAndWakeupHandlers( BlockHandlerProcPtr /*blockHandler*/, WakeupHandlerProcPtr /*wakeupHandler*/, - pointer /*blockData*/); + void * /*blockData*/); extern void RemoveBlockAndWakeupHandlers( BlockHandlerProcPtr /*blockHandler*/, WakeupHandlerProcPtr /*wakeupHandler*/, - pointer /*blockData*/); + void * /*blockData*/); extern void InitBlockAndWakeupHandlers(void); @@ -475,19 +444,19 @@ extern void ProcessWorkQueueZombies(void); extern Bool QueueWorkProc( Bool (* /*function*/)( ClientPtr /*clientUnused*/, - pointer /*closure*/), + void * /*closure*/), ClientPtr /*client*/, - pointer /*closure*/ + void * /*closure*/ ); typedef Bool (* ClientSleepProcPtr)( ClientPtr /*client*/, - pointer /*closure*/); + void * /*closure*/); extern Bool ClientSleep( ClientPtr /*client*/, ClientSleepProcPtr /* function */, - pointer /*closure*/); + void * /*closure*/); #ifndef ___CLIENTSIGNAL_DEFINED___ #define ___CLIENTSIGNAL_DEFINED___ @@ -504,14 +473,14 @@ extern Bool ClientIsAsleep( /* atom.c */ extern Atom MakeAtom( - char * /*string*/, + const char * /*string*/, unsigned /*len*/, Bool /*makeit*/); extern Bool ValidAtom( Atom /*atom*/); -extern char *NameForAtom( +extern const char *NameForAtom( Atom /*atom*/); extern void AtomError(void); @@ -627,7 +596,7 @@ extern void RecalculateDeliverableEvents( WindowPtr /* pWin */); extern int OtherClientGone( - pointer /* value */, + void * /* value */, XID /* id */); extern void DoFocusEvents( @@ -716,16 +685,16 @@ typedef struct _CallbackList *CallbackListPtr; /* also in misc.h */ #endif typedef void (*CallbackProcPtr) ( - CallbackListPtr *, pointer, pointer); + CallbackListPtr *, void *, void *); typedef Bool (*AddCallbackProcPtr) ( - CallbackListPtr *, CallbackProcPtr, pointer); + CallbackListPtr *, CallbackProcPtr, void *); typedef Bool (*DeleteCallbackProcPtr) ( - CallbackListPtr *, CallbackProcPtr, pointer); + CallbackListPtr *, CallbackProcPtr, void *); typedef void (*CallCallbacksProcPtr) ( - CallbackListPtr *, pointer); + CallbackListPtr *, void *); typedef void (*DeleteCallbackListProcPtr) ( CallbackListPtr *); @@ -744,16 +713,16 @@ extern Bool CreateCallbackList( extern Bool AddCallback( CallbackListPtr * /*pcbl*/, CallbackProcPtr /*callback*/, - pointer /*data*/); + void * /*data*/); extern Bool DeleteCallback( CallbackListPtr * /*pcbl*/, CallbackProcPtr /*callback*/, - pointer /*data*/); + void * /*data*/); extern void CallCallbacks( CallbackListPtr * /*pcbl*/, - pointer /*call_data*/); + void * /*call_data*/); extern void DeleteCallbackList( CallbackListPtr * /*pcbl*/); diff --git a/nx-X11/programs/Xserver/include/dixevents.h b/nx-X11/programs/Xserver/include/dixevents.h index 46a5faef0..2a9458f08 100644 --- a/nx-X11/programs/Xserver/include/dixevents.h +++ b/nx-X11/programs/Xserver/include/dixevents.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/include/dixevents.h,v 3.4 2001/09/04 14:03:27 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> diff --git a/nx-X11/programs/Xserver/include/dixfont.h b/nx-X11/programs/Xserver/include/dixfont.h index c6b8676da..21d917fe5 100644 --- a/nx-X11/programs/Xserver/include/dixfont.h +++ b/nx-X11/programs/Xserver/include/dixfont.h @@ -1,4 +1,3 @@ -/* $Xorg: dixfont.h,v 1.3 2000/08/17 19:53:29 cpqbld Exp $ */ /*********************************************************** Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. @@ -21,7 +20,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/include/dixfont.h,v 3.7 2001/02/02 21:39:02 herrb Exp $ */ #ifndef DIXFONT_H #define DIXFONT_H 1 @@ -31,11 +29,21 @@ SOFTWARE. #include "closure.h" #include <X11/fonts/fontstruct.h> +#ifdef HAS_XFONT2 +# include <X11/fonts/libxfont2.h> +#else +# include <X11/fonts/fontutil.h> +#endif /* HAS XFONT2 */ + #define NullDIXFontProp ((DIXFontPropPtr)0) typedef struct _DIXFontProp *DIXFontPropPtr; +#ifdef HAS_XFONT2 +xfont2_fpe_funcs_rec const **fpe_functions; +#else extern FPEFunctions *fpe_functions; +#endif /* HAS_XFONT2 */ extern int FontToXError(int /*err*/); @@ -45,9 +53,9 @@ extern void QueueFontWakeup(FontPathElementPtr /*fpe*/); extern void RemoveFontWakeup(FontPathElementPtr /*fpe*/); -extern void FontWakeup(pointer /*data*/, +extern void FontWakeup(void * /*data*/, int /*count*/, - pointer /*LastSelectMask*/); + void * /*LastSelectMask*/); extern int OpenFont(ClientPtr /*client*/, XID /*fid*/, @@ -55,7 +63,7 @@ extern int OpenFont(ClientPtr /*client*/, unsigned /*lenfname*/, char * /*pfontname*/); -extern int CloseFont(pointer /*pfont*/, +extern int CloseFont(void * /*pfont*/, XID /*fid*/); typedef struct _xQueryFontReply *xQueryFontReplyPtr; @@ -102,8 +110,7 @@ extern int ImageText(ClientPtr /*client*/, extern int SetFontPath(ClientPtr /*client*/, int /*npaths*/, - unsigned char * /*paths*/, - int * /*error*/); + unsigned char * /*paths*/); extern int SetDefaultFontPath(char * /*path*/); @@ -127,14 +134,25 @@ extern void InitFonts(void); extern void FreeFonts(void); +#ifdef HAS_XFONT2 +extern void GetGlyphs(FontPtr /*font */ , + unsigned long /*count */ , + unsigned char * /*chars */ , + FontEncoding /*fontEncoding */ , + unsigned long * /*glyphcount */ , + CharInfoPtr * /*glyphs */ ); +#else extern FontPtr find_old_font(XID /*id*/); -extern void GetGlyphs(FontPtr /*font*/, - unsigned long /*count*/, - unsigned char * /*chars*/, - FontEncoding /*fontEncoding*/, - unsigned long * /*glyphcount*/, - CharInfoPtr * /*glyphs*/); +#define GetGlyphs dixGetGlyphs +extern void dixGetGlyphs(FontPtr /*font*/, + unsigned long /*count*/, + unsigned char * /*chars*/, + FontEncoding /*fontEncoding*/, + unsigned long * /*glyphcount*/, + CharInfoPtr * /*glyphs*/); + +extern void register_fpe_functions(void); extern void QueryGlyphExtents(FontPtr /*pFont*/, CharInfoPtr * /*charinfo*/, @@ -145,6 +163,7 @@ extern Bool QueryTextExtents(FontPtr /*pFont*/, unsigned long /*count*/, unsigned char * /*chars*/, ExtentInfoPtr /*info*/); +#endif /* HAS_XFONT2 */ extern Bool ParseGlyphCachingMode(char * /*str*/); diff --git a/nx-X11/programs/Xserver/include/dixfontstr.h b/nx-X11/programs/Xserver/include/dixfontstr.h index 948bf1adb..3e76f9e6a 100644 --- a/nx-X11/programs/Xserver/include/dixfontstr.h +++ b/nx-X11/programs/Xserver/include/dixfontstr.h @@ -1,4 +1,3 @@ -/* $Xorg: dixfontstr.h,v 1.3 2000/08/17 19:53:29 cpqbld Exp $ */ /*********************************************************** Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. @@ -28,9 +27,11 @@ SOFTWARE. #include "servermd.h" #include "dixfont.h" #include <X11/fonts/fontstruct.h> +#ifdef HAS_XFONT2 +# include <X11/fonts/libxfont2.h> +#endif /* HAS_XFONT2 */ #include "closure.h" -#define NEED_REPLIES -#include <X11/Xproto.h> /* for xQueryFontReply */ +#include <nx-X11/Xproto.h> /* for xQueryFontReply */ #define FONTCHARSET(font) (font) #define FONTMAXBOUNDS(font,field) (font)->info.maxbounds.field diff --git a/nx-X11/programs/Xserver/include/dixgrabs.h b/nx-X11/programs/Xserver/include/dixgrabs.h index 042e063db..f1f7c2cb5 100644 --- a/nx-X11/programs/Xserver/include/dixgrabs.h +++ b/nx-X11/programs/Xserver/include/dixgrabs.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/include/dixgrabs.h,v 3.0 1996/04/15 11:34:27 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> @@ -43,7 +42,7 @@ extern GrabPtr CreateGrab( CursorPtr /* cursor */); extern int DeletePassiveGrab( - pointer /* value */, + void * /* value */, XID /* id */); extern Bool GrabMatchesSecond( diff --git a/nx-X11/programs/Xserver/include/dixstruct.h b/nx-X11/programs/Xserver/include/dixstruct.h index 6266ec9f8..cdd2543a6 100644 --- a/nx-X11/programs/Xserver/include/dixstruct.h +++ b/nx-X11/programs/Xserver/include/dixstruct.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/include/dixstruct.h,v 3.19tsi Exp $ */ /*********************************************************** Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. @@ -21,17 +20,17 @@ 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 "client.h" #include "dix.h" #include "resource.h" #include "cursor.h" #include "gc.h" #include "pixmap.h" -#include <X11/Xmd.h> +#include <nx-X11/Xmd.h> /* * direct-mapped hash table, used by resource manager to store @@ -93,9 +92,10 @@ typedef struct _Window *SaveSetElt; typedef struct _Client { int index; Mask clientAsMask; - pointer requestBuffer; - pointer osPrivate; /* for OS layer, including scheduler */ + void *requestBuffer; + void *osPrivate; /* for OS layer, including scheduler */ Bool swapped; + Bool local; ReplySwapPtr pSwapReplyFunc; XID errorValue; int sequence; @@ -103,13 +103,9 @@ typedef struct _Client { int clientGone; int noClientException; /* this client died or needs to be * killed */ - DrawablePtr lastDrawable; - Drawable lastDrawableID; - GCPtr lastGC; - GContext lastGCID; SaveSetElt *saveSet; int numSaved; - pointer screenPrivate[MAXSCREENS]; + void *screenPrivate[MAXSCREENS]; int (**requestVector) ( ClientPtr /* pClient */); CARD32 req_len; /* length of current request */ @@ -129,35 +125,28 @@ typedef struct _Client { unsigned char requestLog[MAX_REQUEST_LOG]; int requestLogIndex; #endif -#ifdef LBX - int (*readRequest)(ClientPtr /*client*/); -#endif unsigned long replyBytesRemaining; #ifdef XCSECURITY XID authId; unsigned int trustLevel; - pointer (* CheckAccess)( + void * (* CheckAccess)( ClientPtr /*pClient*/, XID /*id*/, RESTYPE /*classes*/, Mask /*access_mode*/, - pointer /*resourceval*/); -#endif -#ifdef XAPPGROUP - struct _AppGroupRec* appgroup; + void * /*resourceval*/); #endif struct _FontResolution * (*fontResFunc) ( /* no need for font.h */ ClientPtr /* pClient */, int * /* num */); -#ifdef SMART_SCHEDULE int smart_priority; long smart_start_tick; long smart_stop_tick; long smart_check_tick; -#endif + + ClientIdPtr clientIds; } ClientRec; -#ifdef SMART_SCHEDULE /* * Scheduling interface */ @@ -165,20 +154,19 @@ 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); -#ifdef NXAGENT_SERVER -extern Bool SmartScheduleStopTimer(void); +#ifdef HAVE_SETITIMER +#if HAVE_SETITIMER +extern Bool SmartScheduleSignalEnable; +#else +#define SmartScheduleSignalEnable FALSE #endif +#endif +extern void SmartScheduleStartTimer(void); +extern void SmartScheduleStopTimer(void); #define SMART_MAX_PRIORITY (20) #define SMART_MIN_PRIORITY (-20) -extern Bool SmartScheduleInit(void); - -#endif +extern void SmartScheduleInit(void); /* This prototype is used pervasively in Xext, dix */ #define DISPATCH_PROC(func) int func(ClientPtr /* client */) @@ -187,10 +175,10 @@ typedef struct _WorkQueue { struct _WorkQueue *next; Bool (*function) ( ClientPtr /* pClient */, - pointer /* closure */ + void * /* closure */ ); ClientPtr client; - pointer closure; + void *closure; } WorkQueueRec; extern TimeStamp currentTime; @@ -204,7 +192,7 @@ extern TimeStamp ClientTimeToServerTime(CARD32 /*c*/); typedef struct _CallbackRec { CallbackProcPtr proc; - pointer data; + void * data; Bool deleted; struct _CallbackRec *next; } CallbackRec, *CallbackPtr; @@ -225,10 +213,6 @@ extern int (* ProcVector[256]) (ClientPtr /*client*/); extern int (* SwappedProcVector[256]) (ClientPtr /*client*/); -#ifdef K5AUTH -extern int (*k5_Vector[256])(ClientPtr /*client*/); -#endif - extern ReplySwapPtr ReplySwapVector[256]; extern int ProcBadRequest(ClientPtr /*client*/); diff --git a/nx-X11/programs/Xserver/include/dixstruct.h.NX.original b/nx-X11/programs/Xserver/include/dixstruct.h.NX.original deleted file mode 100644 index 6266ec9f8..000000000 --- a/nx-X11/programs/Xserver/include/dixstruct.h.NX.original +++ /dev/null @@ -1,236 +0,0 @@ -/* $XFree86: xc/programs/Xserver/include/dixstruct.h,v 3.19tsi 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) ( - ClientPtr /* pClient */, - int /* size */, - void * /* pbuf */); - -extern void ReplyNotSwappd ( - ClientPtr /* pClient */, - int /* size */, - void * /* pbuf */); - -typedef enum {ClientStateInitial, - ClientStateAuthenticating, - ClientStateRunning, - ClientStateRetained, - ClientStateGone, - ClientStateCheckingSecurity, - ClientStateCheckedSecurity} ClientState; - -#ifdef XFIXES -typedef struct _saveSet { - struct _Window *windowPtr; - Bool toRoot; - Bool remap; -} SaveSetElt; -#define SaveSetWindow(ss) ((ss).windowPtr) -#define SaveSetToRoot(ss) ((ss).toRoot) -#define SaveSetRemap(ss) ((ss).remap) -#define SaveSetAssignWindow(ss,w) ((ss).windowPtr = (w)) -#define SaveSetAssignToRoot(ss,tr) ((ss).toRoot = (tr)) -#define SaveSetAssignRemap(ss,rm) ((ss).remap = (rm)) -#else -typedef struct _Window *SaveSetElt; -#define SaveSetWindow(ss) (ss) -#define SaveSetToRoot(ss) FALSE -#define SaveSetRemap(ss) TRUE -#define SaveSetAssignWindow(ss,w) ((ss) = (w)) -#define SaveSetAssignToRoot(ss,tr) -#define SaveSetAssignRemap(ss,rm) -#endif - -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; - SaveSetElt *saveSet; - int numSaved; - pointer screenPrivate[MAXSCREENS]; - int (**requestVector) ( - ClientPtr /* pClient */); - 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)(ClientPtr /*client*/); -#endif - unsigned long replyBytesRemaining; -#ifdef XCSECURITY - XID authId; - unsigned int trustLevel; - pointer (* CheckAccess)( - ClientPtr /*pClient*/, - XID /*id*/, - RESTYPE /*classes*/, - Mask /*access_mode*/, - pointer /*resourceval*/); -#endif -#ifdef XAPPGROUP - struct _AppGroupRec* appgroup; -#endif - struct _FontResolution * (*fontResFunc) ( /* no need for font.h */ - ClientPtr /* pClient */, - int * /* num */); -#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); -#ifdef NXAGENT_SERVER -extern Bool SmartScheduleStopTimer(void); -#endif -#define SMART_MAX_PRIORITY (20) -#define SMART_MIN_PRIORITY (-20) - -extern Bool SmartScheduleInit(void); - -#endif - -/* This prototype is used pervasively in Xext, dix */ -#define DISPATCH_PROC(func) int func(ClientPtr /* client */) - -typedef struct _WorkQueue { - struct _WorkQueue *next; - Bool (*function) ( - ClientPtr /* pClient */, - pointer /* closure */ -); - ClientPtr client; - pointer closure; -} WorkQueueRec; - -extern TimeStamp currentTime; -extern TimeStamp lastDeviceEventTime; - -extern int CompareTimeStamps( - TimeStamp /*a*/, - TimeStamp /*b*/); - -extern TimeStamp ClientTimeToServerTime(CARD32 /*c*/); - -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]) (ClientPtr /*client*/); - -extern int (* ProcVector[256]) (ClientPtr /*client*/); - -extern int (* SwappedProcVector[256]) (ClientPtr /*client*/); - -#ifdef K5AUTH -extern int (*k5_Vector[256])(ClientPtr /*client*/); -#endif - -extern ReplySwapPtr ReplySwapVector[256]; - -extern int ProcBadRequest(ClientPtr /*client*/); - -#endif /* DIXSTRUCT_H */ diff --git a/nx-X11/programs/Xserver/include/dixstruct.h.X.original b/nx-X11/programs/Xserver/include/dixstruct.h.X.original deleted file mode 100644 index d7d810272..000000000 --- a/nx-X11/programs/Xserver/include/dixstruct.h.X.original +++ /dev/null @@ -1,233 +0,0 @@ -/* $XFree86: xc/programs/Xserver/include/dixstruct.h,v 3.19tsi 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) ( - ClientPtr /* pClient */, - int /* size */, - void * /* pbuf */); - -extern void ReplyNotSwappd ( - ClientPtr /* pClient */, - int /* size */, - void * /* pbuf */); - -typedef enum {ClientStateInitial, - ClientStateAuthenticating, - ClientStateRunning, - ClientStateRetained, - ClientStateGone, - ClientStateCheckingSecurity, - ClientStateCheckedSecurity} ClientState; - -#ifdef XFIXES -typedef struct _saveSet { - struct _Window *windowPtr; - Bool toRoot; - Bool remap; -} SaveSetElt; -#define SaveSetWindow(ss) ((ss).windowPtr) -#define SaveSetToRoot(ss) ((ss).toRoot) -#define SaveSetRemap(ss) ((ss).remap) -#define SaveSetAssignWindow(ss,w) ((ss).windowPtr = (w)) -#define SaveSetAssignToRoot(ss,tr) ((ss).toRoot = (tr)) -#define SaveSetAssignRemap(ss,rm) ((ss).remap = (rm)) -#else -typedef struct _Window *SaveSetElt; -#define SaveSetWindow(ss) (ss) -#define SaveSetToRoot(ss) FALSE -#define SaveSetRemap(ss) TRUE -#define SaveSetAssignWindow(ss,w) ((ss) = (w)) -#define SaveSetAssignToRoot(ss,tr) -#define SaveSetAssignRemap(ss,rm) -#endif - -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; - SaveSetElt *saveSet; - int numSaved; - pointer screenPrivate[MAXSCREENS]; - int (**requestVector) ( - ClientPtr /* pClient */); - 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)(ClientPtr /*client*/); -#endif - unsigned long replyBytesRemaining; -#ifdef XCSECURITY - XID authId; - unsigned int trustLevel; - pointer (* CheckAccess)( - ClientPtr /*pClient*/, - XID /*id*/, - RESTYPE /*classes*/, - Mask /*access_mode*/, - pointer /*resourceval*/); -#endif -#ifdef XAPPGROUP - struct _AppGroupRec* appgroup; -#endif - struct _FontResolution * (*fontResFunc) ( /* no need for font.h */ - ClientPtr /* pClient */, - int * /* num */); -#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(void); - -#endif - -/* This prototype is used pervasively in Xext, dix */ -#define DISPATCH_PROC(func) int func(ClientPtr /* client */) - -typedef struct _WorkQueue { - struct _WorkQueue *next; - Bool (*function) ( - ClientPtr /* pClient */, - pointer /* closure */ -); - ClientPtr client; - pointer closure; -} WorkQueueRec; - -extern TimeStamp currentTime; -extern TimeStamp lastDeviceEventTime; - -extern int CompareTimeStamps( - TimeStamp /*a*/, - TimeStamp /*b*/); - -extern TimeStamp ClientTimeToServerTime(CARD32 /*c*/); - -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]) (ClientPtr /*client*/); - -extern int (* ProcVector[256]) (ClientPtr /*client*/); - -extern int (* SwappedProcVector[256]) (ClientPtr /*client*/); - -#ifdef K5AUTH -extern int (*k5_Vector[256])(ClientPtr /*client*/); -#endif - -extern ReplySwapPtr ReplySwapVector[256]; - -extern int ProcBadRequest(ClientPtr /*client*/); - -#endif /* DIXSTRUCT_H */ diff --git a/nx-X11/programs/Xserver/include/exevents.h b/nx-X11/programs/Xserver/include/exevents.h index 91c7acb6b..1169a6c4e 100644 --- a/nx-X11/programs/Xserver/include/exevents.h +++ b/nx-X11/programs/Xserver/include/exevents.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/include/exevents.h,v 3.1 1996/04/15 11:34:29 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> diff --git a/nx-X11/programs/Xserver/include/extension.h b/nx-X11/programs/Xserver/include/extension.h index 34750173b..f9e74e82c 100644 --- a/nx-X11/programs/Xserver/include/extension.h +++ b/nx-X11/programs/Xserver/include/extension.h @@ -1,4 +1,3 @@ -/* $Xorg: extension.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/include/extension.h,v 1.5 2001/12/14 19:59:54 dawes Exp $ */ #ifndef EXTENSION_H #define EXTENSION_H diff --git a/nx-X11/programs/Xserver/include/extinit.h b/nx-X11/programs/Xserver/include/extinit.h index 37fa9a245..b1a0f215d 100644 --- a/nx-X11/programs/Xserver/include/extinit.h +++ b/nx-X11/programs/Xserver/include/extinit.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/include/extinit.h,v 3.2 2001/08/01 00:44:58 tsi Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> diff --git a/nx-X11/programs/Xserver/include/extnsionst.h b/nx-X11/programs/Xserver/include/extnsionst.h index daf37bf43..da4cee57c 100644 --- a/nx-X11/programs/Xserver/include/extnsionst.h +++ b/nx-X11/programs/Xserver/include/extnsionst.h @@ -1,4 +1,3 @@ -/* $Xorg: extnsionst.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/include/extnsionst.h,v 3.8 2003/04/27 21:31:04 herrb Exp $ */ #ifndef EXTENSIONSTRUCT_H #define EXTENSIONSTRUCT_H @@ -67,7 +65,7 @@ typedef struct _ExtensionEntry { int errorLast; int num_aliases; char **aliases; - pointer extPrivate; + void * extPrivate; unsigned short (* MinorOpcode)( /* called for errors */ ClientPtr /* client */); #ifdef XCSECURITY diff --git a/nx-X11/programs/Xserver/include/gc.h b/nx-X11/programs/Xserver/include/gc.h index 77c2f20c6..75a38617e 100644 --- a/nx-X11/programs/Xserver/include/gc.h +++ b/nx-X11/programs/Xserver/include/gc.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/include/gc.h,v 1.5 2001/12/14 19:59:54 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,14 +44,27 @@ 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 <X11/Xdefs.h> /* for Bool */ -#include <X11/Xproto.h> +#include <nx-X11/X.h> /* for GContext, Mask */ + +#ifndef _XTYPEDEF_POINTER +/* Don't let Xdefs.h define 'pointer' */ +#define _XTYPEDEF_POINTER 1 +#endif /* _XTYPEDEF_POINTER */ + +/* FIXME: for building this code against Xlib versions older than apprx. 04/2014 + * we still have to define the pointer type via Xdefs.h. + * + * The nx-libs code itself does not require the pointer definition. + */ +#undef _XTYPEDEF_POINTER + +#include <nx-X11/Xdefs.h> /* for Bool */ + +#include <nx-X11/Xproto.h> #include "screenint.h" /* for ScreenPtr */ #include "pixmap.h" /* for DrawablePtr */ @@ -103,7 +115,7 @@ extern int DoChangeGC( typedef union { CARD32 val; - pointer ptr; + void * ptr; } ChangeGCVal, *ChangeGCValPtr; extern int dixChangeGC( @@ -125,7 +137,7 @@ extern int CopyGC( BITS32 /*mask*/); extern int FreeGC( - pointer /*pGC*/, + void * /*pGC*/, XID /*gid*/); extern void SetGCMask( diff --git a/nx-X11/programs/Xserver/include/gcstruct.h b/nx-X11/programs/Xserver/include/gcstruct.h index c2226ba17..9a8169cab 100644 --- a/nx-X11/programs/Xserver/include/gcstruct.h +++ b/nx-X11/programs/Xserver/include/gcstruct.h @@ -1,4 +1,3 @@ -/* $Xorg: gcstruct.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -47,7 +46,6 @@ SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/include/gcstruct.h,v 1.7 2003/04/27 21:31:04 herrb Exp $ */ #ifndef GCSTRUCT_H #define GCSTRUCT_H @@ -58,7 +56,7 @@ SOFTWARE. #include "region.h" #include "pixmap.h" #include "screenint.h" -#include <X11/Xprotostr.h> +#include <nx-X11/Xprotostr.h> /* * functions which modify the state of the GC @@ -85,7 +83,7 @@ typedef struct _GCFuncs { void (* ChangeClip)( GCPtr /*pGC*/, int /*type*/, - pointer /*pvalue*/, + void * /*pvalue*/, int /*nrects*/); void (* DestroyClip)( @@ -244,7 +242,7 @@ typedef struct _GCOps { int /*y*/, unsigned int /*nglyph*/, CharInfoPtr * /*ppci*/, - pointer /*pglyphBase*/); + void * /*pglyphBase*/); void (* PolyGlyphBlt)( DrawablePtr /*pDrawable*/, @@ -253,7 +251,7 @@ typedef struct _GCOps { int /*y*/, unsigned int /*nglyph*/, CharInfoPtr * /*ppci*/, - pointer /*pglyphBase*/); + void * /*pglyphBase*/); void (* PushPixels)( GCPtr /*pGC*/, @@ -309,7 +307,7 @@ typedef struct _GC { struct _Font *font; DDXPointRec clipOrg; DDXPointRec lastWinOrg; /* position of window last validated */ - pointer clientClip; + void * clientClip; unsigned long stateChanges; /* masked with GC_<kind> */ unsigned long serialNumber; GCFuncs *funcs; diff --git a/nx-X11/programs/Xserver/include/globals.h b/nx-X11/programs/Xserver/include/globals.h index 0f2864825..1c4d73e64 100644 --- a/nx-X11/programs/Xserver/include/globals.h +++ b/nx-X11/programs/Xserver/include/globals.h @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/include/globals.h,v 1.9 2005/08/24 11:18:31 daniels Exp $ */ -/* $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_ @@ -14,14 +12,13 @@ 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 char *ConnectionInfo; extern Bool noTestExtensions; extern DDXPointRec dixScreenOrigins[MAXSCREENS]; @@ -46,6 +43,7 @@ extern Bool PanoramiXMapped; extern Bool PanoramiXVisibilityNotifySent; extern Bool PanoramiXWindowExposureSent; extern Bool PanoramiXOneExposeRequest; +extern Bool PanoramiXExtensionDisabledHack; #endif #ifdef BIGREQS @@ -72,22 +70,10 @@ extern Bool noDPSExtension; extern Bool noDPMSExtension; #endif -#ifdef EVI -extern Bool noEVIExtension; -#endif - -#ifdef FONTCACHE -extern Bool noFontCacheExtension; -#endif - #ifdef GLXEXT extern Bool noGlxExtension; #endif -#ifdef LBX -extern Bool noLbxExtension; -#endif - #ifdef SCREENSAVER extern Bool noScreenSaverExtension; #endif @@ -96,16 +82,9 @@ extern Bool noScreenSaverExtension; extern Bool noMITShmExtension; #endif -#ifdef MITMISC -extern Bool noMITMiscExtension; -#endif - -#ifdef MULTIBUFFER -extern Bool noMultibufferExtension; -#endif - #ifdef RANDR extern Bool noRRExtension; +extern Bool noRRXineramaExtension; #endif #ifdef RENDER @@ -124,46 +103,22 @@ extern Bool noSecurityExtension; extern Bool noSyncExtension; #endif -#ifdef TOGCUP -extern Bool noXcupExtension; -#endif - #ifdef RES extern Bool noResExtension; #endif -#ifdef XAPPGROUP -extern Bool noXagExtension; -#endif - #ifdef XCMISC extern Bool noXCMiscExtension; #endif -#ifdef XEVIE -extern Bool noXevieExtension; -#endif - #ifdef XF86BIGFONT extern Bool noXFree86BigfontExtension; #endif -#ifdef XFreeXDGA -extern Bool noXFree86DGAExtension; -#endif - #ifdef XF86DRI extern Bool noXFree86DRIExtension; #endif -#ifdef XF86MISC -extern Bool noXFree86MiscExtension; -#endif - -#ifdef XF86VIDMODE -extern Bool noXFree86VidModeExtension; -#endif - #ifdef XFIXES extern Bool noXFixesExtension; #endif diff --git a/nx-X11/programs/Xserver/include/input.h b/nx-X11/programs/Xserver/include/input.h index bcaa01e6f..7cfbf32a7 100644 --- a/nx-X11/programs/Xserver/include/input.h +++ b/nx-X11/programs/Xserver/include/input.h @@ -1,4 +1,3 @@ -/* $Xorg: input.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */ /************************************************************ Copyright 1987, 1998 The Open Group @@ -45,15 +44,14 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/include/input.h,v 3.8 2003/04/27 21:31:04 herrb Exp $ */ #ifndef INPUT_H #define INPUT_H #include "misc.h" #include "screenint.h" -#include <X11/Xmd.h> -#include <X11/Xproto.h> +#include <nx-X11/Xmd.h> +#include <nx-X11/Xproto.h> #include "window.h" /* for WindowPtr */ #define DEVICE_INIT 0 @@ -104,7 +102,7 @@ typedef void (*DeviceUnwrapProc)( ); typedef struct _DeviceRec { - pointer devicePrivate; + void * devicePrivate; ProcessInputProc processInputProc; /* current */ ProcessInputProc realInputProc; /* deliver */ ProcessInputProc enqueueInputProc; /* enqueue */ @@ -255,7 +253,7 @@ extern Bool InitFocusClassDeviceStruct( typedef void (*BellProcPtr)( int /*percent*/, DeviceIntPtr /*device*/, - pointer /*ctrl*/, + void * /*ctrl*/, int); typedef void (*KbdCtrlProcPtr)( diff --git a/nx-X11/programs/Xserver/include/inputstr.h b/nx-X11/programs/Xserver/include/inputstr.h index b54e8a1d5..5e2e26968 100644 --- a/nx-X11/programs/Xserver/include/inputstr.h +++ b/nx-X11/programs/Xserver/include/inputstr.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/include/inputstr.h,v 1.6 2003/04/27 21:31:04 herrb Exp $ */ /************************************************************ Copyright 1987, 1998 The Open Group @@ -46,7 +45,6 @@ SOFTWARE. ********************************************************/ -/* $Xorg: inputstr.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */ #ifndef INPUTSTRUCT_H #define INPUTSTRUCT_H diff --git a/nx-X11/programs/Xserver/include/list.h b/nx-X11/programs/Xserver/include/list.h new file mode 100644 index 000000000..3f0574d43 --- /dev/null +++ b/nx-X11/programs/Xserver/include/list.h @@ -0,0 +1,494 @@ +/* + * Copyright © 2010 Intel Corporation + * Copyright © 2010 Francisco Jerez <currojerez@riseup.net> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + */ + +#ifndef _XORG_LIST_H_ +#define _XORG_LIST_H_ + +#include <stddef.h> /* offsetof() */ + +/** + * @file Classic doubly-link circular list implementation. + * For real usage examples of the linked list, see the file test/list.c + * + * Example: + * We need to keep a list of struct foo in the parent struct bar, i.e. what + * we want is something like this. + * + * struct bar { + * ... + * struct foo *list_of_foos; -----> struct foo {}, struct foo {}, struct foo{} + * ... + * } + * + * We need one list head in bar and a list element in all list_of_foos (both are of + * data type 'struct xorg_list'). + * + * struct bar { + * ... + * struct xorg_list list_of_foos; + * ... + * } + * + * struct foo { + * ... + * struct xorg_list entry; + * ... + * } + * + * Now we initialize the list head: + * + * struct bar bar; + * ... + * xorg_list_init(&bar.list_of_foos); + * + * Then we create the first element and add it to this list: + * + * struct foo *foo = malloc(...); + * .... + * xorg_list_add(&foo->entry, &bar.list_of_foos); + * + * Repeat the above for each element you want to add to the list. Deleting + * works with the element itself. + * xorg_list_del(&foo->entry); + * free(foo); + * + * Note: calling xorg_list_del(&bar.list_of_foos) will set bar.list_of_foos to an empty + * list again. + * + * Looping through the list requires a 'struct foo' as iterator and the + * name of the field the subnodes use. + * + * struct foo *iterator; + * xorg_list_for_each_entry(iterator, &bar.list_of_foos, entry) { + * if (iterator->something == ...) + * ... + * } + * + * Note: You must not call xorg_list_del() on the iterator if you continue the + * loop. You need to run the safe for-each loop instead: + * + * struct foo *iterator, *next; + * xorg_list_for_each_entry_safe(iterator, next, &bar.list_of_foos, entry) { + * if (...) + * xorg_list_del(&iterator->entry); + * } + * + */ + +/** + * The linkage struct for list nodes. This struct must be part of your + * to-be-linked struct. struct xorg_list is required for both the head of the + * list and for each list node. + * + * Position and name of the struct xorg_list field is irrelevant. + * There are no requirements that elements of a list are of the same type. + * There are no requirements for a list head, any struct xorg_list can be a list + * head. + */ +struct xorg_list { + struct xorg_list *next, *prev; +}; + +/** + * Initialize the list as an empty list. + * + * Example: + * xorg_list_init(&bar->list_of_foos); + * + * @param list The list to initialize + */ +static inline void +xorg_list_init(struct xorg_list *list) +{ + list->next = list->prev = list; +} + +static inline void +__xorg_list_add(struct xorg_list *entry, + struct xorg_list *prev, struct xorg_list *next) +{ + next->prev = entry; + entry->next = next; + entry->prev = prev; + prev->next = entry; +} + +/** + * Insert a new element after the given list head. The new element does not + * need to be initialised as empty list. + * The list changes from: + * head → some element → ... + * to + * head → new element → older element → ... + * + * Example: + * struct foo *newfoo = malloc(...); + * xorg_list_add(&newfoo->entry, &bar->list_of_foos); + * + * @param entry The new element to prepend to the list. + * @param head The existing list. + */ +static inline void +xorg_list_add(struct xorg_list *entry, struct xorg_list *head) +{ + __xorg_list_add(entry, head, head->next); +} + +/** + * Append a new element to the end of the list given with this list head. + * + * The list changes from: + * head → some element → ... → lastelement + * to + * head → some element → ... → lastelement → new element + * + * Example: + * struct foo *newfoo = malloc(...); + * xorg_list_append(&newfoo->entry, &bar->list_of_foos); + * + * @param entry The new element to prepend to the list. + * @param head The existing list. + */ +static inline void +xorg_list_append(struct xorg_list *entry, struct xorg_list *head) +{ + __xorg_list_add(entry, head->prev, head); +} + +static inline void +__xorg_list_del(struct xorg_list *prev, struct xorg_list *next) +{ + next->prev = prev; + prev->next = next; +} + +/** + * Remove the element from the list it is in. Using this function will reset + * the pointers to/from this element so it is removed from the list. It does + * NOT free the element itself or manipulate it otherwise. + * + * Using xorg_list_del on a pure list head (like in the example at the top of + * this file) will NOT remove the first element from + * the list but rather reset the list as empty list. + * + * Example: + * xorg_list_del(&foo->entry); + * + * @param entry The element to remove. + */ +static inline void +xorg_list_del(struct xorg_list *entry) +{ + __xorg_list_del(entry->prev, entry->next); + xorg_list_init(entry); +} + +/** + * Check if the list is empty. + * + * Example: + * xorg_list_is_empty(&bar->list_of_foos); + * + * @return True if the list contains one or more elements or False otherwise. + */ +static inline int +xorg_list_is_empty(struct xorg_list *head) +{ + return head->next == head; +} + +/** + * Returns a pointer to the container of this list element. + * + * Example: + * struct foo* f; + * f = container_of(&foo->entry, struct foo, entry); + * assert(f == foo); + * + * @param ptr Pointer to the struct xorg_list. + * @param type Data type of the list element. + * @param member Member name of the struct xorg_list field in the list element. + * @return A pointer to the data struct containing the list head. + */ +#ifndef container_of +#define container_of(ptr, type, member) \ + (type *)((char *)(ptr) - offsetof(type, member)) +#endif + +/** + * Alias of container_of + */ +#define xorg_list_entry(ptr, type, member) \ + container_of(ptr, type, member) + +/** + * Retrieve the first list entry for the given list pointer. + * + * Example: + * struct foo *first; + * first = xorg_list_first_entry(&bar->list_of_foos, struct foo, list_of_foos); + * + * @param ptr The list head + * @param type Data type of the list element to retrieve + * @param member Member name of the struct xorg_list field in the list element. + * @return A pointer to the first list element. + */ +#define xorg_list_first_entry(ptr, type, member) \ + xorg_list_entry((ptr)->next, type, member) + +/** + * Retrieve the last list entry for the given listpointer. + * + * Example: + * struct foo *first; + * first = xorg_list_last_entry(&bar->list_of_foos, struct foo, list_of_foos); + * + * @param ptr The list head + * @param type Data type of the list element to retrieve + * @param member Member name of the struct xorg_list field in the list element. + * @return A pointer to the last list element. + */ +#define xorg_list_last_entry(ptr, type, member) \ + xorg_list_entry((ptr)->prev, type, member) + +#ifdef HAVE_TYPEOF +#define __container_of(ptr, sample, member) \ + container_of(ptr, typeof(*sample), member) +#else +/* This implementation of __container_of has undefined behavior according + * to the C standard, but it works in many cases. If your compiler doesn't + * support typeof() and fails with this implementation, please try a newer + * compiler. + */ +#define __container_of(ptr, sample, member) \ + (void *)((char *)(ptr) \ + - ((char *)&(sample)->member - (char *)(sample))) +#endif + +/** + * Loop through the list given by head and set pos to struct in the list. + * + * Example: + * struct foo *iterator; + * xorg_list_for_each_entry(iterator, &bar->list_of_foos, entry) { + * [modify iterator] + * } + * + * This macro is not safe for node deletion. Use xorg_list_for_each_entry_safe + * instead. + * + * @param pos Iterator variable of the type of the list elements. + * @param head List head + * @param member Member name of the struct xorg_list in the list elements. + * + */ +#define xorg_list_for_each_entry(pos, head, member) \ + for (pos = NULL, \ + pos = __container_of((head)->next, pos, member); \ + &pos->member != (head); \ + pos = __container_of(pos->member.next, pos, member)) + +/** + * Loop through the list, keeping a backup pointer to the element. This + * macro allows for the deletion of a list element while looping through the + * list. + * + * See xorg_list_for_each_entry for more details. + */ +#define xorg_list_for_each_entry_safe(pos, tmp, head, member) \ + for (pos = NULL, \ + pos = __container_of((head)->next, pos, member), \ + tmp = __container_of(pos->member.next, pos, member); \ + &pos->member != (head); \ + pos = tmp, tmp = __container_of(pos->member.next, tmp, member)) + +/* NULL-Terminated List Interface + * + * The interface below does _not_ use the struct xorg_list as described above. + * It is mainly for legacy structures that cannot easily be switched to + * struct xorg_list. + * + * This interface is for structs like + * struct foo { + * [...] + * struct foo *next; + * [...] + * }; + * + * The position and field name of "next" are arbitrary. + */ + +/** + * Init the element as null-terminated list. + * + * Example: + * struct foo *list = malloc(); + * nt_list_init(list, next); + * + * @param list The list element that will be the start of the list + * @param member Member name of the field pointing to next struct + */ +#define nt_list_init(_list, _member) \ + (_list)->_member = NULL + +/** + * Returns the next element in the list or NULL on termination. + * + * Example: + * struct foo *element = list; + * while ((element = nt_list_next(element, next)) { } + * + * This macro is not safe for node deletion. Use nt_list_for_each_entry_safe + * instead. + * + * @param list The list or current element. + * @param member Member name of the field pointing to next struct. + */ +#define nt_list_next(_list, _member) \ + (_list)->_member + +/** + * Iterate through each element in the list. + * + * Example: + * struct foo *iterator; + * nt_list_for_each_entry(iterator, list, next) { + * [modify iterator] + * } + * + * @param entry Assigned to the current list element + * @param list The list to iterate through. + * @param member Member name of the field pointing to next struct. + */ +#define nt_list_for_each_entry(_entry, _list, _member) \ + for (_entry = _list; _entry; _entry = (_entry)->_member) + +/** + * Iterate through each element in the list, keeping a backup pointer to the + * element. This macro allows for the deletion of a list element while + * looping through the list. + * + * See nt_list_for_each_entry for more details. + * + * @param entry Assigned to the current list element + * @param tmp The pointer to the next element + * @param list The list to iterate through. + * @param member Member name of the field pointing to next struct. + */ +#define nt_list_for_each_entry_safe(_entry, _tmp, _list, _member) \ + for (_entry = _list, _tmp = (_entry) ? (_entry)->_member : NULL;\ + _entry; \ + _entry = _tmp, _tmp = (_tmp) ? (_tmp)->_member: NULL) + +/** + * Append the element to the end of the list. This macro may be used to + * merge two lists. + * + * Example: + * struct foo *elem = malloc(...); + * nt_list_init(elem, next) + * nt_list_append(elem, list, struct foo, next); + * + * Resulting list order: + * list_item_0 -> list_item_1 -> ... -> elem_item_0 -> elem_item_1 ... + * + * @param entry An entry (or list) to append to the list + * @param list The list to append to. This list must be a valid list, not + * NULL. + * @param type The list type + * @param member Member name of the field pointing to next struct + */ +#define nt_list_append(_entry, _list, _type, _member) \ + do { \ + _type *__iterator = _list; \ + while (__iterator->_member) { __iterator = __iterator->_member;}\ + __iterator->_member = _entry; \ + } while (0) + +/** + * Insert the element at the next position in the list. This macro may be + * used to insert a list into a list. + * + * struct foo *elem = malloc(...); + * nt_list_init(elem, next) + * nt_list_insert(elem, list, struct foo, next); + * + * Resulting list order: + * list_item_0 -> elem_item_0 -> elem_item_1 ... -> list_item_1 -> ... + * + * @param entry An entry (or list) to append to the list + * @param list The list to insert to. This list must be a valid list, not + * NULL. + * @param type The list type + * @param member Member name of the field pointing to next struct + */ +#define nt_list_insert(_entry, _list, _type, _member) \ + do { \ + nt_list_append((_list)->_member, _entry, _type, _member); \ + (_list)->_member = _entry; \ + } while (0) + +/** + * Delete the entry from the list by iterating through the list and + * removing any reference from the list to the entry. + * + * Example: + * struct foo *elem = <assign to right element> + * nt_list_del(elem, list, struct foo, next); + * + * @param entry The entry to delete from the list. entry is always + * re-initialized as a null-terminated list. + * @param list The list containing the entry, set to the new list without + * the removed entry. + * @param type The list type + * @param member Member name of the field pointing to the next entry + */ +#define nt_list_del(_entry, _list, _type, _member) \ + do { \ + _type *__e = _entry; \ + if (__e == NULL || _list == NULL) break; \ + if ((_list) == __e) { \ + _list = __e->_member; \ + } else { \ + _type *__prev = _list; \ + while (__prev->_member && __prev->_member != __e) \ + __prev = nt_list_next(__prev, _member); \ + if (__prev->_member) \ + __prev->_member = __e->_member; \ + } \ + nt_list_init(__e, _member); \ + } while(0) + +/** + * DO NOT USE THIS. + * This is a remainder of the xfree86 DDX attempt of having a set of generic + * list functions. Unfortunately, the xf86OptionRec uses it and we can't + * easily get rid of it. Do not use for new code. + */ +typedef struct generic_list_rec { + void *next; +} GenericListRec, *GenericListPtr, *glp; + +#endif diff --git a/nx-X11/programs/Xserver/include/misc.h b/nx-X11/programs/Xserver/include/misc.h index 5944a427f..27137cd50 100644 --- a/nx-X11/programs/Xserver/include/misc.h +++ b/nx-X11/programs/Xserver/include/misc.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/include/misc.h,v 3.28 2001/12/14 19:59:55 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -66,7 +65,6 @@ 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 /* @@ -77,17 +75,30 @@ OF THIS SOFTWARE. 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> +#include <nx-X11/Xosdefs.h> +#include <nx-X11/Xfuncproto.h> +#include <nx-X11/Xmd.h> +#include <nx-X11/X.h> +#include <stdint.h> + +#ifndef _XTYPEDEF_POINTER +/* Don't let Xdefs.h define 'pointer' */ +#define _XTYPEDEF_POINTER 1 +#endif /* _XTYPEDEF_POINTER */ + +/* FIXME: for building this code against Xlib versions older than apprx. 04/2014 + * we still have to define the pointer type via Xdefs.h. + * + * The nx-libs code itself does not require the pointer definition. + * + */ +#undef _XTYPEDEF_POINTER + +#include <nx-X11/Xdefs.h> -#ifndef IN_MODULE #ifndef NULL #include <stddef.h> #endif -#endif #ifndef MAXSCREENS #define MAXSCREENS 16 @@ -115,9 +126,7 @@ typedef struct _CallbackList *CallbackListPtr; /* also in dix.h */ 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 +#include <nx-X11/Xfuncs.h> /* for bcopy, bzero, and bcmp */ #define NullBox ((BoxPtr)0) #define MILLI_PER_MIN (1000 * 60) @@ -145,12 +154,10 @@ typedef struct _xReq *xReqPtr; #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 @@ -166,7 +173,6 @@ typedef struct _xReq *xReqPtr; */ #define lowbit(x) ((x) & (~(x) + 1)) -#ifndef IN_MODULE /* XXX Not for modules */ #include <limits.h> #if !defined(MAXSHORT) || !defined(MINSHORT) || \ @@ -191,7 +197,57 @@ typedef struct _xReq *xReqPtr; #include <ctype.h> #include <stdio.h> /* for fopen, etc... */ -#endif +/** + * Calculate the number of bytes needed to hold bits. + * @param bits The minimum number of bits needed. + * @return The number of bytes needed to hold bits. + */ +static __inline__ int +bits_to_bytes(const int bits) { + return ((bits + 7) >> 3); +} +/** + * Calculate the number of 4-byte units needed to hold the given number of + * bytes. + * @param bytes The minimum number of bytes needed. + * @return The number of 4-byte units needed to hold bytes. + */ +static __inline__ int +bytes_to_int32(const int bytes) { + return (((bytes) + 3) >> 2); +} + +/** + * Calculate the number of bytes (in multiples of 4) needed to hold bytes. + * @param bytes The minimum number of bytes needed. + * @return The closest multiple of 4 that is equal or higher than bytes. + */ +static __inline__ int +pad_to_int32(const int bytes) { + return (((bytes) + 3) & ~3); +} + +/** + * Compare the two version numbers comprising of major.minor. + * + * @return A value less than 0 if a is less than b, 0 if a is equal to b, + * or a value greater than 0 + */ +static inline int +version_compare(uint32_t a_major, uint32_t a_minor, + uint32_t b_major, uint32_t b_minor) +{ + if (a_major > b_major) + return 1; + if (a_major < b_major) + return -1; + if (a_minor > b_minor) + return 1; + if (a_minor < b_minor) + return -1; + + return 0; +} /* some macros to help swap requests, replies, and events */ @@ -210,32 +266,107 @@ typedef struct _xReq *xReqPtr; #define SwapRestL(stuff) \ SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff)) +#if defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) +void __attribute__ ((error("wrong sized variable passed to swap"))) +wrong_size(void); +#else +static inline void +wrong_size(void) +{ +} +#endif + +#if !(defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) +static inline int +__builtin_constant_p(int x) +{ + return 0; +} +#endif + +/* byte swap a 64-bit value */ +static inline void +swap_uint64(uint64_t *x) +{ + char n; + + n = ((char *) x)[0]; + ((char *) x)[0] = ((char *) x)[7]; + ((char *) x)[7] = n; + + n = ((char *) x)[1]; + ((char *) x)[1] = ((char *) x)[6]; + ((char *) x)[6] = n; + + n = ((char *) x)[2]; + ((char *) x)[2] = ((char *) x)[5]; + ((char *) x)[5] = n; + + n = ((char *) x)[3]; + ((char *) x)[3] = ((char *) x)[4]; + ((char *) x)[4] = n; +} + +#define swapll(x) do { \ + if (sizeof(*(x)) != 8) \ + wrong_size(); \ + swap_uint64((uint64_t *)(x)); \ + } while (0) + /* 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; } +static inline void +swap_uint32(uint32_t * x) +{ + char 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; +} + +#define swapl(x) do { \ + if (sizeof(*(x)) != 4) \ + wrong_size(); \ + if (__builtin_constant_p((uintptr_t)(x) & 3) && ((uintptr_t)(x) & 3) == 0) \ + *(x) = lswapl(*(x)); \ + else \ + swap_uint32((uint32_t *)(x)); \ + } while (0) + +/* byte swap a 16-bit value */ +static inline void +swap_uint16(uint16_t * x) +{ + char n = ((char *) x)[0]; + + ((char *) x)[0] = ((char *) x)[1]; + ((char *) x)[1] = n; +} + +#define swaps(x) do { \ + if (sizeof(*(x)) != 2) \ + wrong_size(); \ + if (__builtin_constant_p((uintptr_t)(x) & 1) && ((uintptr_t)(x) & 1) == 0) \ + *(x) = lswaps(*(x)); \ + else \ + swap_uint16((uint16_t *)(x)); \ + } while (0) /* 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]; } +#define cpswapl(src, dst) do { \ + if (sizeof((src)) != 4 || sizeof((dst)) != 4) \ + wrong_size(); \ + (dst) = lswapl((src)); \ + } while (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]; } +#define cpswaps(src, dst) do { \ + if (sizeof((src)) != 2 || sizeof((dst)) != 2) \ + wrong_size(); \ + (dst) = lswaps((src)); \ + } while (0) extern void SwapLongs( CARD32 *list, @@ -251,7 +382,7 @@ extern int Ones( unsigned long /*mask*/); typedef struct _xPoint *DDXPointPtr; -typedef struct _Box *BoxPtr; +typedef struct pixman_box16 *BoxPtr; typedef struct _xEvent *xEventPtr; typedef struct _xRectangle *xRectanglePtr; typedef struct _GrabRec *GrabPtr; diff --git a/nx-X11/programs/Xserver/include/miscstruct.h b/nx-X11/programs/Xserver/include/miscstruct.h index 6a16007b7..f3cd47614 100644 --- a/nx-X11/programs/Xserver/include/miscstruct.h +++ b/nx-X11/programs/Xserver/include/miscstruct.h @@ -1,4 +1,3 @@ -/* $Xorg: miscstruct.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,23 +44,22 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/include/miscstruct.h,v 3.4 2003/04/27 21:31:04 herrb Exp $ */ #ifndef MISCSTRUCT_H #define MISCSTRUCT_H 1 +#include <pixman.h> + #include "misc.h" -#include <X11/Xprotostr.h> +#include <nx-X11/Xprotostr.h> #include "gc.h" typedef xPoint DDXPointRec; -typedef struct _Box { - short x1, y1, x2, y2; -} BoxRec; +typedef struct pixman_box16 BoxRec; typedef union _DevUnion { - pointer ptr; + void * ptr; long val; unsigned long uval; RegionPtr (*fptr)( diff --git a/nx-X11/programs/Xserver/include/opaque.h b/nx-X11/programs/Xserver/include/opaque.h index ca29afdc0..8312b4a21 100644 --- a/nx-X11/programs/Xserver/include/opaque.h +++ b/nx-X11/programs/Xserver/include/opaque.h @@ -1,4 +1,3 @@ -/* $Xorg: opaque.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */ /* Copyright 1987, 1998 The Open Group @@ -26,12 +25,11 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/include/opaque.h,v 1.13 2003/07/24 13:50:25 eich Exp $ */ #ifndef OPAQUE_H #define OPAQUE_H -#include <X11/Xmd.h> +#include <nx-X11/Xmd.h> #include "globals.h" @@ -54,6 +52,8 @@ extern int defaultScreenSaverAllowExposures; extern int argcGlobal; extern char **argvGlobal; extern char *display; +extern int displayfd; +extern Bool explicit_display; extern int defaultBackingStore; extern Bool disableBackingStore; @@ -78,6 +78,6 @@ extern long maxBigRequestSize; extern Bool blackRoot; extern Bool CoreDump; - +extern Bool NoListenAll; #endif /* OPAQUE_H */ diff --git a/nx-X11/programs/Xserver/include/os.h b/nx-X11/programs/Xserver/include/os.h index 0b3354eec..be41e0118 100644 --- a/nx-X11/programs/Xserver/include/os.h +++ b/nx-X11/programs/Xserver/include/os.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/include/os.h,v 3.54 2003/10/30 21:21:06 herrb Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -46,20 +45,12 @@ 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 <X11/Xalloca.h> -#ifndef IN_MODULE #include <stdarg.h> -#else -#include "xf86_ansic.h" -#endif #define NullFID ((FID) 0) @@ -75,29 +66,25 @@ SOFTWARE. #define MAX_BIG_REQUEST_SIZE 4194303 #endif -typedef pointer FID; +typedef void * FID; typedef struct _FontPathRec *FontPathPtr; typedef struct _NewClientRec *NewClientPtr; -#ifndef xalloc +#ifndef xnfalloc #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 xnfrealloc(ptr, size) XNFrealloc((void *)(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) + +#define xallocarray(num, size) reallocarray(NULL, (num), (size)) #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 @@ -106,21 +93,13 @@ typedef struct _NewClientRec *NewClientPtr; #define SIGVAL void #endif -extern Bool OsDelayInitColors; extern void (*OsVendorVErrorFProc)(const char *, va_list args); extern int WaitForSomething( int* /*pClientsReady*/ ); -#ifdef LBX -#define ReadRequestFromClient(client) ((client)->readRequest(client)) -extern int StandardReadRequestFromClient(ClientPtr /*client*/); - -extern int ClientConnectionNumber(ClientPtr /*client*/); -#else extern int ReadRequestFromClient(ClientPtr /*client*/); -#endif /* LBX */ extern Bool InsertFakeRequest( ClientPtr /*client*/, @@ -135,12 +114,14 @@ extern void FlushIfCriticalOutputPending(void); extern void SetCriticalOutputPending(void); -extern int WriteToClient(ClientPtr /*who*/, int /*count*/, char* /*buf*/); +extern int WriteToClient(ClientPtr /*who*/, int /*count*/, const void* /*__buf*/); extern void ResetOsBuffers(void); extern void InitConnectionLimits(void); +extern void NotifyParentProcess(void); + extern void CreateWellKnownSockets(void); extern void ResetWellKnownSockets(void); @@ -156,17 +137,22 @@ extern char *ClientAuthorized( unsigned int /*string_n*/, char* /*auth_string*/); -extern Bool EstablishNewConnections( - ClientPtr /*clientUnused*/, - pointer /*closure*/); - extern void CheckConnections(void); extern void CloseDownConnection(ClientPtr /*client*/); -extern void AddEnabledDevice(int /*fd*/); +typedef void (*NotifyFdProcPtr)(int fd, int ready, void *data); + +#define X_NOTIFY_NONE 0 +#define X_NOTIFY_READ 1 +#define X_NOTIFY_WRITE 2 + +extern Bool SetNotifyFd(int fd, NotifyFdProcPtr notify_fd, int mask, void *data); -extern void RemoveEnabledDevice(int /*fd*/); +static inline void RemoveNotifyFd(int fd) +{ + (void) SetNotifyFd(fd, NULL, X_NOTIFY_NONE, NULL); +} extern void OnlyListenToOneClient(ClientPtr /*client*/); @@ -180,16 +166,12 @@ extern void MakeClientGrabImpervious(ClientPtr /*client*/); extern void MakeClientGrabPervious(ClientPtr /*client*/); -#ifdef LBX -extern void CloseDownFileDescriptor(ClientPtr /* client */); -#endif - extern void AvailableClientInput(ClientPtr /* client */); extern CARD32 GetTimeInMillis(void); extern void AdjustWaitForDelay( - pointer /*waitTime*/, + void * /*waitTime*/, unsigned long /*newdelay*/); typedef struct _OsTimerRec *OsTimerPtr; @@ -197,7 +179,7 @@ typedef struct _OsTimerRec *OsTimerPtr; typedef CARD32 (*OsTimerCallback)( OsTimerPtr /* timer */, CARD32 /* time */, - pointer /* arg */); + void * /* arg */); extern void TimerInit(void); @@ -211,7 +193,7 @@ extern OsTimerPtr TimerSet( int /* flags */, CARD32 /* millis */, OsTimerCallback /* func */, - pointer /* arg */); + void * /* arg */); extern void TimerCheck(void); extern void TimerCancel(OsTimerPtr /* pTimer */); @@ -238,28 +220,25 @@ extern void ProcessCommandLine(int /*argc*/, char* /*argv*/[]); extern int set_font_authorizations( char ** /* authorizations */, int * /*authlen */, - pointer /* client */); - -#ifndef _HAVE_XALLOC_DECLS -#define _HAVE_XALLOC_DECLS -extern pointer Xalloc(unsigned long /*amount*/); -extern pointer Xcalloc(unsigned long /*amount*/); -extern pointer Xrealloc(pointer /*ptr*/, unsigned long /*amount*/); -extern void Xfree(pointer /*ptr*/); -#endif + void * /* client */); -extern pointer XNFalloc(unsigned long /*amount*/); -extern pointer XNFcalloc(unsigned long /*amount*/); -extern pointer XNFrealloc(pointer /*ptr*/, unsigned long /*amount*/); +extern void * XNFalloc(unsigned long /*amount*/); +extern void * XNFcalloc(unsigned long /*amount*/); +extern void * XNFrealloc(void * /*ptr*/, unsigned long /*amount*/); extern void OsInitAllocator(void); extern char *Xstrdup(const char *s); extern char *XNFstrdup(const char *s); -extern char *Xprintf(const char *fmt, ...); -extern char *Xvprintf(const char *fmt, va_list va); -extern char *XNFprintf(const char *fmt, ...); -extern char *XNFvprintf(const char *fmt, va_list va); + +/* Include new X*asprintf API */ +#include "Xprintf.h" + +/* Older api deprecated in favor of the asprintf versions */ +extern _X_EXPORT char *Xprintf(const char *fmt, ...) _X_ATTRIBUTE_PRINTF(1,2) _X_DEPRECATED; +extern _X_EXPORT char *Xvprintf(const char *fmt, va_list va)_X_ATTRIBUTE_PRINTF(1,0) _X_DEPRECATED; +extern _X_EXPORT char *XNFprintf(const char *fmt, ...) _X_ATTRIBUTE_PRINTF(1,2) _X_DEPRECATED; +extern _X_EXPORT char *XNFvprintf(const char *fmt, va_list va)_X_ATTRIBUTE_PRINTF(1,0) _X_DEPRECATED; typedef SIGVAL (*OsSigHandlerPtr)(int /* sig */); @@ -294,12 +273,12 @@ void OsBlockSignals (void); void OsReleaseSignals (void); -#if !defined(WIN32) && !defined(__UNIXOS2__) +#if !defined(WIN32) extern int System(char *); -extern pointer Popen(char *, char *); -extern int Pclose(pointer); -extern pointer Fopen(char *, char *); -extern int Fclose(pointer); +extern void * Popen(char *, char *); +extern int Pclose(void *); +extern void * Fopen(char *, char *); +extern int Fclose(void *); #else #define System(a) system(a) #define Popen(a,b) popen(a,b) @@ -315,24 +294,24 @@ extern int AddHost( ClientPtr /*client*/, int /*family*/, unsigned /*length*/, - pointer /*pAddr*/); + void * /*pAddr*/); extern Bool ForEachHostInFamily ( int /*family*/, Bool (* /*func*/ )( unsigned char * /* addr */, short /* len */, - pointer /* closure */), - pointer /*closure*/); + void * /* closure */), + void * /*closure*/); extern int RemoveHost( ClientPtr /*client*/, int /*family*/, unsigned /*length*/, - pointer /*pAddr*/); + void * /*pAddr*/); extern int GetHosts( - pointer * /*data*/, + void ** /*data*/, int * /*pnHosts*/, int * /*pLen*/, BOOL * /*pEnabled*/); @@ -341,10 +320,26 @@ typedef struct sockaddr * sockaddrPtr; extern int InvalidHost(sockaddrPtr /*saddr*/, int /*len*/, ClientPtr client); -extern int LocalClient(ClientPtr /* client */); - extern int LocalClientCred(ClientPtr, int *, int *); +#define LCC_UID_SET (1 << 0) +#define LCC_GID_SET (1 << 1) +#define LCC_PID_SET (1 << 2) +#define LCC_ZID_SET (1 << 3) + +typedef struct { + int fieldsSet; /* Bit mask of fields set */ + int euid; /* Effective uid */ + int egid; /* Primary effective group id */ + int nSuppGids; /* Number of supplementary group ids */ + int *pSuppGids; /* Array of supplementary group ids */ + int pid; /* Process id */ + int zoneid; /* Only set on Solaris 10 & later */ +} LocalClientCredRec; + +extern int GetLocalClientCreds(ClientPtr, LocalClientCredRec **); +extern void FreeLocalClientCreds(LocalClientCredRec *); + extern int ChangeAccessControl(ClientPtr /*client*/, int /*fEnabled*/); extern int GetAccessControl(void); @@ -362,7 +357,7 @@ extern void AccessUsingXdmcp(void); extern void DefineSelf(int /*fd*/); -extern void AugmentSelf(pointer /*from*/, int /*len*/); +extern void AugmentSelf(void * /*from*/, int /*len*/); extern void InitAuthorization(char * /*filename*/); @@ -467,7 +462,7 @@ typedef struct { extern CallbackListPtr ReplyCallback; typedef struct { ClientPtr client; - pointer replyData; + const void * replyData; unsigned long dataLenBytes; unsigned long bytesRemaining; Bool startOfReply; @@ -480,6 +475,24 @@ extern void AbortDDX(void); extern void ddxGiveUp(void); extern int TimeSinceLastInputEvent(void); +#ifndef HAVE_REALLOCARRAY +#define reallocarray xreallocarray +extern _X_EXPORT void * +reallocarray(void *optr, size_t nmemb, size_t size); +#endif + +#ifndef HAVE_STRLCPY +extern _X_EXPORT size_t +strlcpy(char *dst, const char *src, size_t siz); +extern _X_EXPORT size_t +strlcat(char *dst, const char *src, size_t siz); +#endif + +#ifndef HAVE_TIMINGSAFE_MEMCMP +extern _X_EXPORT int +timingsafe_memcmp(const void *b1, const void *b2, size_t len); +#endif + /* Logging. */ typedef enum _LogParameter { XLOG_FLUSH, @@ -512,6 +525,7 @@ typedef enum { #endif extern const char *LogInit(const char *fname, const char *backup); +extern void LogSetDisplay(void); extern void LogClose(void); extern Bool LogSetParameter(LogParameter param, int value); extern void LogVWrite(int verb, const char *f, va_list args); @@ -537,7 +551,7 @@ extern void ErrorF(const char *f, ...) _printf_attribute(1,2); extern void Error(char *str); extern void LogPrintMarkers(void); -#if defined(NEED_SNPRINTF) && !defined(IN_MODULE) +#if defined(NEED_SNPRINTF) extern int snprintf(char *str, size_t size, const char *format, ...) _printf_attribute(3,4); extern int vsnprintf(char *str, size_t size, const char *format, va_list ap); diff --git a/nx-X11/programs/Xserver/include/pixmap.h b/nx-X11/programs/Xserver/include/pixmap.h index 6cea329ec..7d893d57c 100644 --- a/nx-X11/programs/Xserver/include/pixmap.h +++ b/nx-X11/programs/Xserver/include/pixmap.h @@ -1,4 +1,3 @@ -/* $Xorg: pixmap.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86$ */ #ifndef PIXMAP_H #define PIXMAP_H @@ -92,7 +90,7 @@ extern PixmapPtr GetScratchPixmapHeader( int /*depth*/, int /*bitsPerPixel*/, int /*devKind*/, - pointer /*pPixData*/); + void * /*pPixData*/); extern void FreeScratchPixmapHeader( PixmapPtr /*pPixmap*/); diff --git a/nx-X11/programs/Xserver/include/pixmapstr.h b/nx-X11/programs/Xserver/include/pixmapstr.h index 22a1f1025..5d38c1c3b 100644 --- a/nx-X11/programs/Xserver/include/pixmapstr.h +++ b/nx-X11/programs/Xserver/include/pixmapstr.h @@ -1,4 +1,3 @@ -/* $Xorg: pixmapstr.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86$ */ #ifndef PIXMAPSTRUCT_H #define PIXMAPSTRUCT_H @@ -83,6 +81,7 @@ typedef struct _Pixmap { short screen_x; short screen_y; #endif + unsigned usage_hint; /* see CREATE_PIXMAP_USAGE_* */ } PixmapRec; #endif /* PIXMAPSTRUCT_H */ diff --git a/nx-X11/programs/Xserver/include/property.h b/nx-X11/programs/Xserver/include/property.h index 21a38d51c..79aa1679c 100644 --- a/nx-X11/programs/Xserver/include/property.h +++ b/nx-X11/programs/Xserver/include/property.h @@ -1,4 +1,3 @@ -/* $Xorg: property.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/include/property.h,v 1.3 2001/12/14 19:59:55 dawes Exp $ */ #ifndef PROPERTY_H #define PROPERTY_H @@ -61,7 +59,7 @@ extern int ChangeWindowProperty( int /*format*/, int /*mode*/, unsigned long /*len*/, - pointer /*value*/, + void * /*value*/, Bool /*sendevent*/); extern int DeleteProperty( diff --git a/nx-X11/programs/Xserver/include/propertyst.h b/nx-X11/programs/Xserver/include/propertyst.h index 177fca171..493d6595e 100644 --- a/nx-X11/programs/Xserver/include/propertyst.h +++ b/nx-X11/programs/Xserver/include/propertyst.h @@ -1,4 +1,3 @@ -/* $Xorg: propertyst.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,7 +44,6 @@ 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 @@ -61,15 +59,7 @@ typedef struct _Property { 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 + void *data; /* private to client */ } PropertyRec; #endif /* PROPERTYSTRUCT_H */ diff --git a/nx-X11/programs/Xserver/include/protocol-versions.h b/nx-X11/programs/Xserver/include/protocol-versions.h new file mode 100644 index 000000000..9b9319fd2 --- /dev/null +++ b/nx-X11/programs/Xserver/include/protocol-versions.h @@ -0,0 +1,182 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ + +/** + * This file specifies the server-supported protocol versions. + */ +#ifndef PROTOCOL_VERSIONS_H +#define PROTOCOL_VERSIONS_H + +#ifdef NXAGENT_SERVER +# define XTRANS_SEND_FDS 0 +#endif + +/* Composite */ +#define SERVER_COMPOSITE_MAJOR_VERSION 0 +#define SERVER_COMPOSITE_MINOR_VERSION 4 + +/* Damage */ +#define SERVER_DAMAGE_MAJOR_VERSION 1 +#ifndef NXAGENT_SERVER +#define SERVER_DAMAGE_MINOR_VERSION 1 +#else /* !defined(NXAGENT_SERVER) */ +#define SERVER_DAMAGE_MINOR_VERSION 0 +#endif /* !defined(NXAGENT_SERVER) */ + +#ifndef NXAGENT_SERVER +/* DRI3 */ +#define SERVER_DRI3_MAJOR_VERSION 1 +#define SERVER_DRI3_MINOR_VERSION 0 +#endif /* !defined(NXAGENT_SERVER) */ + +#ifndef NXAGENT_SERVER +/* DMX */ +#define SERVER_DMX_MAJOR_VERSION 2 +#define SERVER_DMX_MINOR_VERSION 2 +#define SERVER_DMX_PATCH_VERSION 20040604 +#endif /* !defined(NXAGENT_SERVER) */ + +#ifndef NXAGENT_SERVER +/* Generic event extension */ +#define SERVER_GE_MAJOR_VERSION 1 +#define SERVER_GE_MINOR_VERSION 0 +#endif /* !defined(NXAGENT_SERVER) */ + +/* GLX */ +#define SERVER_GLX_MAJOR_VERSION 1 +#ifndef NXAGENT_SERVER +#define SERVER_GLX_MINOR_VERSION 4 +#else +#define SERVER_GLX_MINOR_VERSION 2 +#endif + +/* Xinerama */ +#define SERVER_PANORAMIX_MAJOR_VERSION 1 +#define SERVER_PANORAMIX_MINOR_VERSION 1 + +#ifndef NXAGENT_SERVER +/* Present */ +#define SERVER_PRESENT_MAJOR_VERSION 1 +#define SERVER_PRESENT_MINOR_VERSION 0 +#endif /* !defined(NXAGENT_SERVER) */ + +/* RandR */ +#define SERVER_RANDR_MAJOR_VERSION 1 +#define SERVER_RANDR_MINOR_VERSION 5 + +/* Record */ +#define SERVER_RECORD_MAJOR_VERSION 1 +#define SERVER_RECORD_MINOR_VERSION 13 + +/* Render */ +#define SERVER_RENDER_MAJOR_VERSION 0 +#ifndef NXAGENT_SERVER +#define SERVER_RENDER_MINOR_VERSION 11 +#else /* !defined(NXAGENT_SERVER) */ +#define SERVER_RENDER_MINOR_VERSION 10 +#endif /* !defined(NXAGENT_SERVER) */ + +/* RandR Xinerama */ +#define SERVER_RRXINERAMA_MAJOR_VERSION 1 +#define SERVER_RRXINERAMA_MINOR_VERSION 1 + +/* Screensaver */ +#define SERVER_SAVER_MAJOR_VERSION 1 +#define SERVER_SAVER_MINOR_VERSION 1 + +/* Security */ +#define SERVER_SECURITY_MAJOR_VERSION 1 +#define SERVER_SECURITY_MINOR_VERSION 0 + +/* Shape */ +#define SERVER_SHAPE_MAJOR_VERSION 1 +#define SERVER_SHAPE_MINOR_VERSION 1 + +/* SHM */ +#define SERVER_SHM_MAJOR_VERSION 1 +#ifndef NXAGENT_SERVER +#if XTRANS_SEND_FDS +#define SERVER_SHM_MINOR_VERSION 2 +#else +#define SERVER_SHM_MINOR_VERSION 1 +#endif +#else /* !defined(NXAGENT_SERVER) */ +#define SERVER_SHM_MINOR_VERSION 1 +#endif /* !defined(NXAGENT_SERVER) */ + +/* Sync */ +#define SERVER_SYNC_MAJOR_VERSION 3 +#ifndef NXAGENT_SERVER +#define SERVER_SYNC_MINOR_VERSION 1 +#else /* !defined(NXAGENT_SERVER) */ +#define SERVER_SYNC_MINOR_VERSION 0 +#endif /* !defined(NXAGENT_SERVER) */ + +/* Big Font */ +#define SERVER_XF86BIGFONT_MAJOR_VERSION 1 +#define SERVER_XF86BIGFONT_MINOR_VERSION 1 + +#ifndef NXAGENT_SERVER +/* Vidmode */ +#define SERVER_XF86VIDMODE_MAJOR_VERSION 2 +#define SERVER_XF86VIDMODE_MINOR_VERSION 2 +#endif /* !defined(NXAGENT_SERVER) */ + +/* Fixes */ +#ifndef NXAGENT_SERVER +#define SERVER_XFIXES_MAJOR_VERSION 5 +#define SERVER_XFIXES_MINOR_VERSION 0 +#else /* !defined(NXAGENT_SERVER) */ +#define SERVER_XFIXES_MAJOR_VERSION 3 +#define SERVER_XFIXES_MINOR_VERSION 0 +#endif /* !defined(NXAGENT_SERVER) */ + +/* X Input */ +#ifndef NXAGENT_SERVER +#define SERVER_XI_MAJOR_VERSION 2 +#define SERVER_XI_MINOR_VERSION 3 +#else /* !defined(NXAGENT_SERVER) */ +#define SERVER_XI_MAJOR_VERSION 1 +#define SERVER_XI_MINOR_VERSION 3 +#endif /* !defined(NXAGENT_SERVER) */ + +/* XKB */ +#define SERVER_XKB_MAJOR_VERSION 1 +#define SERVER_XKB_MINOR_VERSION 0 + +/* Resource */ +#define SERVER_XRES_MAJOR_VERSION 1 +#ifndef NXAGENT_SERVER +#define SERVER_XRES_MINOR_VERSION 2 +#else /* !defined(NXAGENT_SERVER) */ +#define SERVER_XRES_MINOR_VERSION 0 +#endif /* !defined(NXAGENT_SERVER) */ + +#ifndef NXAGENT_SERVER +/* XvMC */ +#define SERVER_XVMC_MAJOR_VERSION 1 +#define SERVER_XVMC_MINOR_VERSION 1 +#endif /* !defined(NXAGENT_SERVER) */ + +#endif /* PROTOCOL_VERSIONS_H */ diff --git a/nx-X11/programs/Xserver/include/region.h b/nx-X11/programs/Xserver/include/region.h index 0340b0db6..e9d7e778c 100644 --- a/nx-X11/programs/Xserver/include/region.h +++ b/nx-X11/programs/Xserver/include/region.h @@ -1,4 +1,3 @@ -/* $Xorg: region.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group diff --git a/nx-X11/programs/Xserver/include/regionstr.h b/nx-X11/programs/Xserver/include/regionstr.h index 000bf3f41..959b9c423 100644 --- a/nx-X11/programs/Xserver/include/regionstr.h +++ b/nx-X11/programs/Xserver/include/regionstr.h @@ -1,5 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/include/regionstr.h,v 1.7 2005/08/24 11:18:31 daniels Exp $ */ -/* $Xorg: regionstr.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -46,12 +44,16 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/include/regionstr.h,v 1.12tsi Exp $ */ #ifndef REGIONSTRUCT_H #define REGIONSTRUCT_H -typedef struct _Region RegionRec, *RegionPtr; +#include <pixman.h> + +typedef struct pixman_region16 RegionRec, *RegionPtr; + +#include <stddef.h> +#include <limits.h> #include "miscstruct.h" @@ -67,346 +69,343 @@ typedef struct _Region RegionRec, *RegionPtr; * clip region */ -typedef struct _RegData { - long size; - long numRects; -/* BoxRec rects[size]; in memory but not explicitly declared */ -} RegDataRec, *RegDataPtr; - -struct _Region { - BoxRec extents; - RegDataPtr data; -}; - -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) (®ION_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))) - -/* Keith recommends weaning the region code of pScreen argument */ -#define REG_pScreen screenInfo.screens[0] - -#ifdef NEED_SCREEN_REGIONS - -#define REGION_CREATE(_pScreen, _rect, _size) \ - (*(REG_pScreen)->RegionCreate)(_rect, _size) - -#define REGION_INIT(_pScreen, _pReg, _rect, _size) \ - (*(REG_pScreen)->RegionInit)(_pReg, _rect, _size) - -#define REGION_COPY(_pScreen, dst, src) \ - (*(REG_pScreen)->RegionCopy)(dst, src) - -#define REGION_DESTROY(_pScreen, _pReg) \ - (*(REG_pScreen)->RegionDestroy)(_pReg) - -#define REGION_UNINIT(_pScreen, _pReg) \ - (*(REG_pScreen)->RegionUninit)(_pReg) - -#define REGION_INTERSECT(_pScreen, newReg, reg1, reg2) \ - (*(REG_pScreen)->Intersect)(newReg, reg1, reg2) - -#define REGION_UNION(_pScreen, newReg, reg1, reg2) \ - (*(REG_pScreen)->Union)(newReg, reg1, reg2) - -#define REGION_SUBTRACT(_pScreen, newReg, reg1, reg2) \ - (*(REG_pScreen)->Subtract)(newReg, reg1, reg2) - -#define REGION_INVERSE(_pScreen, newReg, reg1, invRect) \ - (*(REG_pScreen)->Inverse)(newReg, reg1, invRect) - -#define REGION_RESET(_pScreen, _pReg, _pBox) \ - (*(REG_pScreen)->RegionReset)(_pReg, _pBox) - -#define REGION_TRANSLATE(_pScreen, _pReg, _x, _y) \ - (*(REG_pScreen)->TranslateRegion)(_pReg, _x, _y) - -#define RECT_IN_REGION(_pScreen, _pReg, prect) \ - (*(REG_pScreen)->RectIn)(_pReg, prect) - -#define POINT_IN_REGION(_pScreen, _pReg, _x, _y, prect) \ - (*(REG_pScreen)->PointInRegion)(_pReg, _x, _y, prect) - -#define REGION_NOTEMPTY(_pScreen, _pReg) \ - (*(REG_pScreen)->RegionNotEmpty)(_pReg) - -#define REGION_EQUAL(_pScreen, _pReg1, _pReg2) \ - (*(REG_pScreen)->RegionEqual)(_pReg1, _pReg2) - -#define REGION_BROKEN(_pScreen, _pReg) \ - (*(REG_pScreen)->RegionBroken)(_pReg) - -#define REGION_BREAK(_pScreen, _pReg) \ - (*(REG_pScreen)->RegionBreak)(_pReg) - -#define REGION_EMPTY(_pScreen, _pReg) \ - (*(REG_pScreen)->RegionEmpty)(_pReg) - -#define REGION_EXTENTS(_pScreen, _pReg) \ - (*(REG_pScreen)->RegionExtents)(_pReg) - -#define REGION_APPEND(_pScreen, dstrgn, rgn) \ - (*(REG_pScreen)->RegionAppend)(dstrgn, rgn) - -#define REGION_VALIDATE(_pScreen, badreg, pOverlap) \ - (*(REG_pScreen)->RegionValidate)(badreg, pOverlap) - -#define BITMAP_TO_REGION(_pScreen, pPix) \ - (*(REG_pScreen)->BitmapToRegion)(pPix) - -#define RECTS_TO_REGION(_pScreen, nrects, prect, ctype) \ - (*(REG_pScreen)->RectsToRegion)(nrects, prect, ctype) - -#else /* !NEED_SCREEN_REGIONS */ - -/* Reference _pScreen macro argument and check its type */ -#define REGION_SCREEN(_pScreen) (void)((REG_pScreen)->myNum) - -#define REGION_CREATE(_pScreen, _rect, _size) \ - (REGION_SCREEN(_pScreen), miRegionCreate(_rect, _size)) - -#define REGION_COPY(_pScreen, dst, src) \ - (REGION_SCREEN(_pScreen), miRegionCopy(dst, src)) - -#define REGION_DESTROY(_pScreen, _pReg) \ - (REGION_SCREEN(_pScreen), miRegionDestroy(_pReg)) +typedef struct pixman_region16_data RegDataRec, *RegDataPtr; -#define REGION_INTERSECT(_pScreen, newReg, reg1, reg2) \ - (REGION_SCREEN(_pScreen), miIntersect(newReg, reg1, reg2)) +extern BoxRec RegionEmptyBox; +extern RegDataRec RegionEmptyData; +extern RegDataRec RegionBrokenData; -#define REGION_UNION(_pScreen, newReg, reg1, reg2) \ - (REGION_SCREEN(_pScreen), miUnion(newReg, reg1, reg2)) - -#define REGION_SUBTRACT(_pScreen, newReg, reg1, reg2) \ - (REGION_SCREEN(_pScreen), miSubtract(newReg, reg1, reg2)) - -#define REGION_INVERSE(_pScreen, newReg, reg1, invRect) \ - (REGION_SCREEN(_pScreen), miInverse(newReg, reg1, invRect)) - -#define REGION_TRANSLATE(_pScreen, _pReg, _x, _y) \ - (REGION_SCREEN(_pScreen), miTranslateRegion(_pReg, _x, _y)) - -#define RECT_IN_REGION(_pScreen, _pReg, prect) \ - (REGION_SCREEN(_pScreen), miRectIn(_pReg, prect)) - -#define POINT_IN_REGION(_pScreen, _pReg, _x, _y, prect) \ - (REGION_SCREEN(_pScreen), miPointInRegion(_pReg, _x, _y, prect)) - -#define REGION_APPEND(_pScreen, dstrgn, rgn) \ - (REGION_SCREEN(_pScreen), miRegionAppend(dstrgn, rgn)) +static inline Bool RegionNil(RegionPtr reg) { + return ((reg)->data && !(reg)->data->numRects); +} -#define REGION_VALIDATE(_pScreen, badreg, pOverlap) \ - (REGION_SCREEN(_pScreen), miRegionValidate(badreg, pOverlap)) +static inline Bool RegionNar(RegionPtr reg) { + return ((reg)->data == &RegionBrokenData); +} -#define BITMAP_TO_REGION(_pScreen, pPix) \ - (*(_pScreen)->BitmapToRegion)(pPix) /* no mi version?! */ +static inline int RegionNumRects(RegionPtr reg) { + return ((reg)->data ? (reg)->data->numRects : 1); +} -#define RECTS_TO_REGION(_pScreen, nrects, prect, ctype) \ - (REGION_SCREEN(_pScreen), miRectsToRegion(nrects, prect, ctype)) +static inline int RegionSize(RegionPtr reg) { + return ((reg)->data ? (reg)->data->size : 0); +} -#define REGION_EQUAL(_pScreen, _pReg1, _pReg2) \ - (REGION_SCREEN(_pScreen), miRegionEqual(_pReg1, _pReg2)) +static inline BoxPtr RegionRects(RegionPtr reg) { + return ((reg)->data ? (BoxPtr)((reg)->data + 1) : &(reg)->extents); +} -#define REGION_BREAK(_pScreen, _pReg) \ - (REGION_SCREEN(_pScreen), miRegionBreak(_pReg)) +static inline BoxPtr RegionBoxptr(RegionPtr reg) { + return ((BoxPtr)((reg)->data + 1)); +} -#ifdef DONT_INLINE_REGION_OPS +static inline BoxPtr RegionBox(RegionPtr reg, int i) { + return (&RegionBoxptr(reg)[i]); +} -#define REGION_INIT(_pScreen, _pReg, _rect, _size) \ - (REGION_SCREEN(_pScreen), miRegionInit(_pReg, _rect, _size)) +static inline BoxPtr RegionTop(RegionPtr reg) { + return RegionBox(reg, (reg)->data->numRects); +} -#define REGION_UNINIT(_pScreen, _pReg) \ - (REGION_SCREEN(_pScreen), miRegionUninit(_pReg)) +static inline BoxPtr RegionEnd(RegionPtr reg) { + return RegionBox(reg, (reg)->data->numRects - 1); +} -#define REGION_RESET(_pScreen, _pReg, _pBox) \ - (REGION_SCREEN(_pScreen), miRegionReset(_pReg, _pBox)) +static inline size_t RegionSizeof(int n) { + return (sizeof(RegDataRec) + ((n) * sizeof(BoxRec))); +} -#define REGION_NOTEMPTY(_pScreen, _pReg) \ - (REGION_SCREEN(_pScreen), miRegionNotEmpty(_pReg)) +static inline void RegionInit(RegionPtr _pReg, BoxPtr _rect, int _size) +{ + if ((_rect) != NULL) + { + (_pReg)->extents = *(_rect); + (_pReg)->data = (RegDataPtr)NULL; + } + else + { + (_pReg)->extents = RegionEmptyBox; + if (((_size) > 1) && ((_pReg)->data = + (RegDataPtr)malloc(RegionSizeof(_size)))) + { + (_pReg)->data->size = (_size); + (_pReg)->data->numRects = 0; + } + else + (_pReg)->data = &RegionEmptyData; + } +} -#define REGION_BROKEN(_pScreen, _pReg) \ - (REGION_SCREEN(_pScreen), miRegionBroken(_pReg)) +static inline void RegionUninit(RegionPtr _pReg) +{ + if ((_pReg)->data && (_pReg)->data->size) { + free((_pReg)->data); + (_pReg)->data = NULL; + } +} -#define REGION_EMPTY(_pScreen, _pReg) \ - (REGION_SCREEN(_pScreen), miRegionEmpty(_pReg)) +static inline void RegionReset(RegionPtr _pReg, BoxPtr _pBox) +{ + (_pReg)->extents = *(_pBox); + RegionUninit(_pReg); + (_pReg)->data = (RegDataPtr)NULL; +} -#define REGION_EXTENTS(_pScreen, _pReg) \ - (REGION_SCREEN(_pScreen), miRegionExtents(_pReg)) +static inline Bool RegionNotEmpty(RegionPtr _pReg) { + return !RegionNil(_pReg); +} -#else /* inline certain simple region ops for performance */ +static inline Bool RegionBroken(RegionPtr _pReg) { + return RegionNar(_pReg); +} -#define REGION_INIT(_pScreen, _pReg, _rect, _size) \ -{ \ - REGION_SCREEN(_pScreen); \ - 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; \ - } \ - } +static inline void RegionEmpty(RegionPtr _pReg) +{ + RegionUninit(_pReg); + (_pReg)->extents.x2 = (_pReg)->extents.x1; + (_pReg)->extents.y2 = (_pReg)->extents.y1; + (_pReg)->data = &RegionEmptyData; +} +static inline BoxPtr RegionExtents(RegionPtr _pReg) +{ + return (&(_pReg)->extents); +} -#define REGION_UNINIT(_pScreen, _pReg) \ -{ \ - REGION_SCREEN(_pScreen); \ - if ((_pReg)->data && (_pReg)->data->size) { \ - xfree((_pReg)->data); \ - (_pReg)->data = NULL; \ - } \ +static inline void RegionNull(RegionPtr _pReg) +{ + (_pReg)->extents = RegionEmptyBox; + (_pReg)->data = &RegionEmptyData; } -#define REGION_RESET(_pScreen, _pReg, _pBox) \ -{ \ - REGION_SCREEN(_pScreen); \ - (_pReg)->extents = *(_pBox); \ - REGION_UNINIT(_pScreen, _pReg); \ - (_pReg)->data = (RegDataPtr)NULL; \ +static inline Bool +RegionCopy(RegionPtr dst, RegionPtr src) +{ + return pixman_region_copy (dst, src); } -#define REGION_NOTEMPTY(_pScreen, _pReg) \ - (REGION_SCREEN(_pScreen), !REGION_NIL(_pReg)) +static inline Bool +RegionIntersect( + RegionPtr newReg, /* destination Region */ + RegionPtr reg1, + RegionPtr reg2 /* source regions */ + ) +{ + return pixman_region_intersect (newReg, reg1, reg2); +} -#define REGION_BROKEN(_pScreen, _pReg) \ - (REGION_SCREEN(_pScreen), REGION_NAR(_pReg)) +static inline Bool +RegionUnion( + RegionPtr newReg, /* destination Region */ + RegionPtr reg1, + RegionPtr reg2 /* source regions */ + ) +{ + return pixman_region_union (newReg, reg1, reg2); +} -#define REGION_EMPTY(_pScreen, _pReg) \ -{ \ - REGION_UNINIT(_pScreen, _pReg); \ - (_pReg)->extents.x2 = (_pReg)->extents.x1; \ - (_pReg)->extents.y2 = (_pReg)->extents.y1; \ - (_pReg)->data = &miEmptyData; \ +/* + *----------------------------------------------------------------------- + * Subtract -- + * Subtract regS from regM and leave the result in regD. + * S stands for subtrahend, M for minuend and D for difference. + * + * Results: + * TRUE if successful. + * + * Side Effects: + * regD is overwritten. + * + *----------------------------------------------------------------------- + */ +static inline Bool +RegionSubtract(RegionPtr regD, RegionPtr regM, RegionPtr regS) +{ + return pixman_region_subtract (regD, regM, regS); } -#define REGION_EXTENTS(_pScreen, _pReg) \ - (REGION_SCREEN(_pScreen), &(_pReg)->extents) +/* + *----------------------------------------------------------------------- + * Inverse -- + * Take a region and a box and return a region that is everything + * in the box but not in the region. The careful reader will note + * that this is the same as subtracting the region from the box... + * + * Results: + * TRUE. + * + * Side Effects: + * newReg is overwritten. + * + *----------------------------------------------------------------------- + */ +static inline Bool +RegionInverse( + RegionPtr newReg, /* Destination region */ + RegionPtr reg1, /* Region to invert */ + BoxPtr invRect /* Bounding box for inversion */ + ) +{ + return pixman_region_inverse (newReg, reg1, invRect); +} -#define REGION_NULL(_pScreen, _pReg) \ -{ \ - REGION_SCREEN(_pScreen); \ - (_pReg)->extents = miEmptyBox; \ - (_pReg)->data = &miEmptyData; \ +static inline int +RegionContainsRect(RegionPtr region, BoxPtr prect) +{ + return pixman_region_contains_rectangle (region, prect); } -#endif /* DONT_INLINE_REGION_OPS */ +/* TranslateRegion(pReg, x, y) + * translates in place + */ -#endif /* NEED_SCREEN_REGIONS */ +static inline void +RegionTranslate(RegionPtr pReg, int x, int y) +{ + pixman_region_translate (pReg, x, y); +} -#ifndef REGION_NULL -#define REGION_NULL(_pScreen, _pReg) \ - REGION_INIT(_pScreen, _pReg, NullBox, 1) -#endif +static inline Bool +RegionContainsPoint( + RegionPtr pReg, + int x, + int y, + BoxPtr box /* "return" value */ + ) +{ + return pixman_region_contains_point (pReg, x, y, box); +} -/* moved from mi.h */ +static inline Bool +RegionEqual(RegionPtr reg1, RegionPtr reg2) +{ + return pixman_region_equal (reg1, reg2); +} -extern RegionPtr miRegionCreate( +extern RegionPtr RegionCreate( BoxPtr /*rect*/, int /*size*/); -extern void miRegionInit( +extern void RegionInit( RegionPtr /*pReg*/, BoxPtr /*rect*/, int /*size*/); -extern void miRegionDestroy( +extern void RegionDestroy( RegionPtr /*pReg*/); -extern void miRegionUninit( +extern void RegionUninit( RegionPtr /*pReg*/); -extern Bool miRegionCopy( +extern Bool RegionCopy( RegionPtr /*dst*/, RegionPtr /*src*/); -extern Bool miIntersect( +extern Bool RegionIntersect( RegionPtr /*newReg*/, RegionPtr /*reg1*/, RegionPtr /*reg2*/); -extern Bool miUnion( +extern Bool RegionUnion( RegionPtr /*newReg*/, RegionPtr /*reg1*/, RegionPtr /*reg2*/); -extern Bool miRegionAppend( +extern Bool RegionAppend( RegionPtr /*dstrgn*/, RegionPtr /*rgn*/); -extern Bool miRegionValidate( +extern Bool RegionValidate( RegionPtr /*badreg*/, Bool * /*pOverlap*/); -extern RegionPtr miRectsToRegion( +extern RegionPtr RegionFromRects( int /*nrects*/, xRectanglePtr /*prect*/, int /*ctype*/); -extern Bool miSubtract( +extern Bool RegionSubtract( RegionPtr /*regD*/, RegionPtr /*regM*/, RegionPtr /*regS*/); -extern Bool miInverse( +extern Bool RegionInverse( RegionPtr /*newReg*/, RegionPtr /*reg1*/, BoxPtr /*invRect*/); -extern int miRectIn( +extern int RegionContainsRect( RegionPtr /*region*/, BoxPtr /*prect*/); -extern void miTranslateRegion( +extern void RegionTranslate( RegionPtr /*pReg*/, int /*x*/, int /*y*/); -extern void miRegionReset( +extern void RegionReset( RegionPtr /*pReg*/, BoxPtr /*pBox*/); -extern Bool miRegionBreak( +extern Bool RegionBreak( RegionPtr /*pReg*/); -extern Bool miPointInRegion( +extern Bool RegionContainsPoint( RegionPtr /*pReg*/, int /*x*/, int /*y*/, BoxPtr /*box*/); -extern Bool miRegionEqual( +extern Bool RegionEqual( RegionPtr /*pReg1*/, RegionPtr /*pReg2*/); -extern Bool miRegionNotEmpty( +extern Bool RegionNotEmpty( RegionPtr /*pReg*/); -extern void miRegionEmpty( +extern void RegionEmpty( RegionPtr /*pReg*/); -extern BoxPtr miRegionExtents( +extern BoxPtr RegionExtents( RegionPtr /*pReg*/); +#define INCLUDE_LEGACY_REGION_DEFINES +#ifdef INCLUDE_LEGACY_REGION_DEFINES + +#define REGION_NIL RegionNil +#define REGION_NAR RegionNar +#define REGION_NUM_RECTS RegionNumRects +#define REGION_SIZE RegionSize +#define REGION_RECTS RegionRects +#define REGION_BOXPTR RegionBoxptr +#define REGION_BOX RegionBox +#define REGION_TOP RegionTop +#define REGION_END RegionEnd +#define REGION_SZOF RegionSizeof +#define BitmapToRegion BitmapToRegion +#define REGION_CREATE(pScreen, r, s) RegionCreate(r,s) +#define REGION_COPY(pScreen, d, r) RegionCopy(d, r) +#define REGION_DESTROY(pScreen, r) RegionDestroy(r) +#define REGION_INTERSECT(pScreen, res, r1, r2) RegionIntersect(res, r1, r2) +#define REGION_UNION(pScreen, res, r1, r2) RegionUnion(res, r1, r2) +#define REGION_SUBTRACT(pScreen, res, r1, r2) RegionSubtract(res, r1, r2) +#define REGION_INVERSE(pScreen, n, r, b) RegionInverse(n, r, b) +#define REGION_TRANSLATE(pScreen, r, x, y) RegionTranslate(r, x, y) +#define RECT_IN_REGION(pScreen, r, b) RegionContainsRect(r, b) +#define POINT_IN_REGION(pScreen, r, x, y, b) RegionContainsPoint(r, x, y, b) +#define REGION_EQUAL(pScreen, r1, r2) RegionEqual(r1, r2) +#define REGION_APPEND(pScreen, d, r) RegionAppend(d, r) +#define REGION_VALIDATE(pScreen, r, o) RegionValidate(r, o) +#define RECTS_TO_REGION(pScreen, n, r, c) RegionFromRects(n, r, c) +#define REGION_BREAK(pScreen, r) RegionBreak(r) +#define REGION_INIT(pScreen, r, b, s) RegionInit(r, b, s) +#define REGION_UNINIT(pScreen, r) RegionUninit(r) +#define REGION_RESET(pScreen, r, b) RegionReset(r, b) +#define REGION_NOTEMPTY(pScreen, r) RegionNotEmpty(r) +#define REGION_BROKEN(pScreen, r) RegionBroken(r) +#define REGION_EMPTY(pScreen, r) RegionEmpty(r) +#define REGION_EXTENTS(pScreen, r) RegionExtents(r) +#define REGION_NULL(pScreen, r) RegionNull(r) + +#endif /* INCLUDE_LEGACY_REGION_DEFINES */ #endif /* REGIONSTRUCT_H */ diff --git a/nx-X11/programs/Xserver/include/resource.h b/nx-X11/programs/Xserver/include/resource.h index 49c189869..30ae624fb 100644 --- a/nx-X11/programs/Xserver/include/resource.h +++ b/nx-X11/programs/Xserver/include/resource.h @@ -1,4 +1,3 @@ -/* $Xorg: resource.h,v 1.5 2001/02/09 02:05:15 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1989, 1998 The Open Group @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/include/resource.h,v 1.11 2002/03/06 21:14:04 mvojkovi Exp $ */ #ifndef RESOURCE_H #define RESOURCE_H 1 @@ -73,9 +71,9 @@ typedef unsigned long RESTYPE; /* 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) +#define RT_WINDOW ((RESTYPE)1|RC_DRAWABLE) +#define RT_PIXMAP ((RESTYPE)2|RC_DRAWABLE) +#define RT_GC ((RESTYPE)3) #undef RT_FONT #undef RT_CURSOR #define RT_FONT ((RESTYPE)4) @@ -123,24 +121,24 @@ typedef unsigned long RESTYPE; #define BAD_RESOURCE 0xe0000000 typedef int (*DeleteType)( - pointer /*value*/, + void * /*value*/, XID /*id*/); typedef void (*FindResType)( - pointer /*value*/, + void * /*value*/, XID /*id*/, - pointer /*cdata*/); + void * /*cdata*/); typedef void (*FindAllRes)( - pointer /*value*/, + void * /*value*/, XID /*id*/, RESTYPE /*type*/, - pointer /*cdata*/); + void * /*cdata*/); typedef Bool (*FindComplexResType)( - pointer /*value*/, + void * /*value*/, XID /*id*/, - pointer /*cdata*/); + void * /*cdata*/); extern RESTYPE CreateNewResourceType( DeleteType /*deleteFunc*/); @@ -161,7 +159,7 @@ extern XID FakeClientID( extern Bool AddResource( XID /*id*/, RESTYPE /*type*/, - pointer /*value*/); + void * /*value*/); extern void FreeResource( XID /*id*/, @@ -175,18 +173,18 @@ extern void FreeResourceByType( extern Bool ChangeResourceValue( XID /*id*/, RESTYPE /*rtype*/, - pointer /*value*/); + void * /*value*/); extern void FindClientResourcesByType( ClientPtr /*client*/, RESTYPE /*type*/, FindResType /*func*/, - pointer /*cdata*/); + void * /*cdata*/); extern void FindAllClientResources( ClientPtr /*client*/, FindAllRes /*func*/, - pointer /*cdata*/); + void * /*cdata*/); extern void FreeClientNeverRetainResources( ClientPtr /*client*/); @@ -200,19 +198,19 @@ extern Bool LegalNewID( XID /*id*/, ClientPtr /*client*/); -extern pointer LookupIDByType( +extern void * LookupIDByType( XID /*id*/, RESTYPE /*rtype*/); -extern pointer LookupIDByClass( +extern void * LookupIDByClass( XID /*id*/, RESTYPE /*classes*/); -extern pointer LookupClientResourceComplex( +extern void * LookupClientResourceComplex( ClientPtr client, RESTYPE type, FindComplexResType func, - pointer cdata); + void * cdata); /* These are the access modes that can be passed in the last parameter * to SecurityLookupIDByType/Class. The Security extension doesn't @@ -222,20 +220,20 @@ extern pointer LookupClientResourceComplex( * 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 */ +#define DixUnknownAccess 0 /* don't know intentions */ +#define DixReadAccess (1<<0) /* inspecting the object */ +#define DixWriteAccess (1<<1) /* changing the object */ +#define DixDestroyAccess (1<<2) /* destroying the object */ #ifdef XCSECURITY -extern pointer SecurityLookupIDByType( +extern void * SecurityLookupIDByType( ClientPtr /*client*/, XID /*id*/, RESTYPE /*rtype*/, Mask /*access_mode*/); -extern pointer SecurityLookupIDByClass( +extern void * SecurityLookupIDByClass( ClientPtr /*client*/, XID /*id*/, RESTYPE /*classes*/, diff --git a/nx-X11/programs/Xserver/include/rgb.h b/nx-X11/programs/Xserver/include/rgb.h index 5741a4efa..3e768b615 100644 --- a/nx-X11/programs/Xserver/include/rgb.h +++ b/nx-X11/programs/Xserver/include/rgb.h @@ -44,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $Xorg: rgb.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */ #ifndef RGB_H #define RGB_H diff --git a/nx-X11/programs/Xserver/include/screenint.h b/nx-X11/programs/Xserver/include/screenint.h index 74d5e14a0..abaa6f85b 100644 --- a/nx-X11/programs/Xserver/include/screenint.h +++ b/nx-X11/programs/Xserver/include/screenint.h @@ -1,4 +1,3 @@ -/* $Xorg: screenint.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/include/screenint.h,v 1.5 2001/12/14 19:59:56 dawes Exp $ */ #ifndef SCREENINT_H #define SCREENINT_H @@ -81,7 +79,6 @@ extern Bool AllocateGCPrivate( extern int AddScreen( Bool (* /*pfnInit*/)( - int /*index*/, ScreenPtr /*pScreen*/, int /*argc*/, char ** /*argv*/), diff --git a/nx-X11/programs/Xserver/include/scrnintstr.h b/nx-X11/programs/Xserver/include/scrnintstr.h index ef9358689..5a3f32309 100644 --- a/nx-X11/programs/Xserver/include/scrnintstr.h +++ b/nx-X11/programs/Xserver/include/scrnintstr.h @@ -1,4 +1,3 @@ -/* $Xorg: scrnintstr.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/include/scrnintstr.h,v 1.12 2003/04/27 21:31:05 herrb Exp $ */ #ifndef SCREENINTSTRUCT_H #define SCREENINTSTRUCT_H @@ -56,7 +54,7 @@ SOFTWARE. #include "colormap.h" #include "cursor.h" #include "validate.h" -#include <X11/Xproto.h> +#include <nx-X11/Xproto.h> #include "dix.h" typedef struct _PixmapFormat { @@ -85,13 +83,12 @@ typedef struct _Depth { /* - * 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 + * There is a typedef for each screen function void * so that code that + * needs to declare a screen function void * (e.g. in a screen private * or as a local variable) can easily do so and retain full type checking. */ typedef Bool (* CloseScreenProcPtr)( - int /*index*/, ScreenPtr /*pScreen*/); typedef void (* QueryBestSizeProcPtr)( @@ -199,11 +196,19 @@ typedef void (* ClipNotifyProcPtr)( int /*dx*/, int /*dy*/); +/* pixmap will exist only for the duration of the current rendering operation */ +#define CREATE_PIXMAP_USAGE_SCRATCH 1 +/* pixmap will be the backing pixmap for a redirected window */ +#define CREATE_PIXMAP_USAGE_BACKING_PIXMAP 2 +/* pixmap will contain a glyph */ +#define CREATE_PIXMAP_USAGE_GLYPH_PICTURE 3 + typedef PixmapPtr (* CreatePixmapProcPtr)( ScreenPtr /*pScreen*/, int /*width*/, int /*height*/, - int /*depth*/); + int /*depth*/, + unsigned /*usage_hint*/); typedef Bool (* DestroyPixmapProcPtr)( PixmapPtr /*pPixmap*/); @@ -431,15 +436,15 @@ typedef void (* SendGraphicsExposeProcPtr)( typedef void (* ScreenBlockHandlerProcPtr)( int /*screenNum*/, - pointer /*blockData*/, - pointer /*pTimeout*/, - pointer /*pReadmask*/); + void * /*blockData*/, + void * /*pTimeout*/, + void * /*pReadmask*/); typedef void (* ScreenWakeupHandlerProcPtr)( int /*screenNum*/, - pointer /*wakeupData*/, + void * /*wakeupData*/, unsigned long /*result*/, - pointer /*pReadMask*/); + void * /*pReadMask*/); typedef Bool (* CreateScreenResourcesProcPtr)( ScreenPtr /*pScreen*/); @@ -451,7 +456,7 @@ typedef Bool (* ModifyPixmapHeaderProcPtr)( int /*depth*/, int /*bitsPerPixel*/, int /*devKind*/, - pointer /*pPixData*/); + void * /*pPixData*/); typedef PixmapPtr (* GetWindowPixmapProcPtr)( WindowPtr /*pWin*/); @@ -523,6 +528,17 @@ typedef void (* MarkUnrealizedWindowProcPtr)( WindowPtr /*pWin*/, Bool /*fromConfigure*/); +typedef void (*ConstrainCursorHarderProcPtr)( + ScreenPtr, /*pScreen*/ + int, /*mode*/ + int *, /*x*/ + int * /*y*/); + +typedef Bool (*ReplaceScanoutPixmapProcPtr)( + DrawablePtr, /*pDrawable*/ + PixmapPtr, /*pPixmap*/ + Bool /*enable*/); + typedef struct _Screen { int myNum; /* index of this instance in Screens[] */ ATOM id; @@ -546,9 +562,10 @@ typedef struct _Screen { a standard one. */ PixmapPtr PixmapPerDepth[1]; - pointer devPrivate; + void * devPrivate; short numVisuals; VisualPtr visuals; + WindowPtr root; int WindowPrivateLen; unsigned *WindowPrivateSizes; unsigned totalWindowSize; @@ -611,6 +628,7 @@ typedef struct _Screen { /* Cursor Procedures */ ConstrainCursorProcPtr ConstrainCursor; + ConstrainCursorHarderProcPtr ConstrainCursorHarder; CursorLimitsProcPtr CursorLimits; DisplayCursorProcPtr DisplayCursor; RealizeCursorProcPtr RealizeCursor; @@ -668,8 +686,8 @@ typedef struct _Screen { ScreenBlockHandlerProcPtr BlockHandler; ScreenWakeupHandlerProcPtr WakeupHandler; - pointer blockData; - pointer wakeupData; + void * blockData; + void * wakeupData; /* anybody can get a piece of this array */ DevUnion *devPrivates; @@ -707,8 +725,13 @@ typedef struct _Screen { ChangeBorderWidthProcPtr ChangeBorderWidth; MarkUnrealizedWindowProcPtr MarkUnrealizedWindow; + ReplaceScanoutPixmapProcPtr ReplaceScanoutPixmap; } ScreenRec; +static inline RegionPtr BitmapToRegion(ScreenPtr _pScreen, PixmapPtr pPix) { + return (*(_pScreen)->BitmapToRegion)(pPix); /* no mi version?! */ +} + typedef struct _ScreenInfo { int imageByteOrder; int bitmapScanlineUnit; diff --git a/nx-X11/programs/Xserver/include/selection.h b/nx-X11/programs/Xserver/include/selection.h index 9e6edfbd9..fbe7cfca6 100644 --- a/nx-X11/programs/Xserver/include/selection.h +++ b/nx-X11/programs/Xserver/include/selection.h @@ -1,4 +1,3 @@ -/* $Xorg: selection.h,v 1.4 2001/02/09 02:05:16 xorgcvs Exp $ */ #ifndef SELECTION_H #define SELECTION_H 1 diff --git a/nx-X11/programs/Xserver/include/servermd.h b/nx-X11/programs/Xserver/include/servermd.h index cce6b329c..f6e82a233 100644 --- a/nx-X11/programs/Xserver/include/servermd.h +++ b/nx-X11/programs/Xserver/include/servermd.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/include/servermd.h,v 3.56tsi Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,479 +44,25 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $Xorg: servermd.h,v 1.3 2000/08/17 19:53:31 cpqbld Exp $ */ -/* $XdotOrg: xc/programs/Xserver/include/servermd.h,v 1.9 2005/11/15 00:29:23 ajax Exp $ */ #ifndef SERVERMD_H #define SERVERMD_H 1 -/* - * Machine dependent values: - * GLYPHPADBYTES should be chosen with consideration for the space-time - * trade-off. Padding to 0 bytes means that there is no wasted space - * in the font bitmaps (both on disk and in memory), but that access of - * the bitmaps will cause odd-address memory references. Padding to - * 2 bytes would ensure even address memory references and would - * be suitable for a 68010-class machine, but at the expense of wasted - * space in the font bitmaps. Padding to 4 bytes would be good - * for real 32 bit machines, etc. Be sure that you tell the font - * compiler what kind of padding you want because its defines are - * kept separate from this. See server/include/font.h for how - * GLYPHPADBYTES is used. - * - * Along with this, you should choose an appropriate value for - * GETLEFTBITS_ALIGNMENT, which is used in ddx/mfb/maskbits.h. This - * constant choses what kind of memory references are guarenteed during - * font access; either 1, 2 or 4, for byte, word or longword access, - * respectively. For instance, if you have decided to to have - * GLYPHPADBYTES == 4, then it is pointless for you to have a - * GETLEFTBITS_ALIGNMENT > 1, because the padding of the fonts has already - * guarenteed you that your fonts are longword aligned. On the other - * hand, even if you have chosen GLYPHPADBYTES == 1 to save space, you may - * also decide that the computing involved in aligning the pointer is more - * costly than an odd-address access; you choose GETLEFTBITS_ALIGNMENT == 1. - * - * Next, choose the tuning parameters which are appropriate for your - * hardware; these modify the behaviour of the raw frame buffer code - * in ddx/mfb and ddx/cfb. Defining these incorrectly will not cause - * the server to run incorrectly, but defining these correctly will - * cause some noticeable speed improvements: - * - * AVOID_MEMORY_READ - (8-bit cfb only) - * When stippling pixels on the screen (polytext and pushpixels), - * don't read long words from the display and mask in the - * appropriate values. Rather, perform multiple byte/short/long - * writes as appropriate. This option uses many more instructions - * but runs much faster when the destination is much slower than - * the CPU and at least 1 level of write buffer is availible (2 - * is much better). Defined currently for SPARC and MIPS. - * - * FAST_CONSTANT_OFFSET_MODE - (cfb and mfb) - * This define is used on machines which have no auto-increment - * addressing mode, but do have an effectively free constant-offset - * addressing mode. Currently defined for MIPS and SPARC, even though - * I remember the cg6 as performing better without it (cg3 definitely - * performs better with it). - * - * LARGE_INSTRUCTION_CACHE - - * This define increases the number of times some loops are - * unrolled. On 68020 machines (with 256 bytes of i-cache), - * this define will slow execution down as instructions miss - * the cache frequently. On machines with real i-caches, this - * reduces loop overhead, causing a slight performance improvement. - * Currently defined for MIPS and SPARC - * - * FAST_UNALIGNED_READS - - * For machines with more memory bandwidth than CPU, this - * define uses unaligned reads for 8-bit BitBLT instead of doing - * aligned reads and combining the results with shifts and - * logical-ors. Currently defined for 68020 and vax. - * PLENTIFUL_REGISTERS - - * For machines with > 20 registers. Currently used for - * unrolling the text painting code a bit more. Currently - * defined for MIPS. - * SHARED_IDCACHE - - * For non-Harvard RISC machines, those which share the same - * CPU memory bus for instructions and data. This unrolls some - * solid fill loops which are otherwise best left rolled up. - * Currently defined for SPARC. - */ - -#ifdef vax +#include <nx-X11/Xarch.h> /* for X_LITTLE_ENDIAN/X_BIG_ENDIAN */ -#define IMAGE_BYTE_ORDER LSBFirst /* Values for the VAX only */ +#if X_BYTE_ORDER == X_LITTLE_ENDIAN +#define IMAGE_BYTE_ORDER LSBFirst #define BITMAP_BIT_ORDER LSBFirst -#define GLYPHPADBYTES 1 -#define GETLEFTBITS_ALIGNMENT 4 -#define FAST_UNALIGNED_READS - -#endif /* vax */ - -#ifdef __arm32__ - -#define IMAGE_BYTE_ORDER LSBFirst - -# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO) -# define BITMAP_BIT_ORDER MSBFirst -# else -# define BITMAP_BIT_ORDER LSBFirst -# endif - -# if defined(XF86MONOVGA) || defined(XF86VGA16) -# define BITMAP_SCANLINE_UNIT 8 -# endif - -#define GLYPHPADBYTES 4 -#define GETLEFTBITS_ALIGNMENT 1 -#define LARGE_INSTRUCTION_CACHE -#define AVOID_MEMORY_READ - -#endif /* __arm32__ */ - -#if defined (hpux) || defined __hppa__ - +#elif X_BYTE_ORDER == X_BIG_ENDIAN #define IMAGE_BYTE_ORDER MSBFirst #define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 /* to make fb work */ -#define GETLEFTBITS_ALIGNMENT 1 /* PA forces longs to 4 */ - /* byte boundries */ -#define AVOID_MEMORY_READ -#define FAST_CONSTANT_OFFSET_MODE -#define LARGE_INSTRUCTION_CACHE -#define PLENTIFUL_REGISTERS - -#endif /* hpux || __hppa__ */ - -#if defined(__powerpc__) || defined(__ppc__) - -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 -#define GETLEFTBITS_ALIGNMENT 1 - -/* XXX Should this be for Lynx only? */ -#ifdef Lynx -#define BITMAP_SCANLINE_UNIT 8 -#endif - -#define LARGE_INSTRUCTION_CACHE -#define FAST_CONSTANT_OFFSET_MODE -#define PLENTIFUL_REGISTERS -#define AVOID_MEMORY_READ - -#define FAST_MEMCPY - -#endif /* PowerPC */ - -#if defined(__sh__) - -#if defined(__BIG_ENDIAN__) -# define IMAGE_BYTE_ORDER MSBFirst -# define BITMAP_BIT_ORDER MSBFirst -# define GLYPHPADBYTES 4 -# define GETLEFTBITS_ALIGNMENT 1 -#else -# define IMAGE_BYTE_ORDER LSBFirst -# define BITMAP_BIT_ORDER LSBFirst -# define GLYPHPADBYTES 4 -# define GETLEFTBITS_ALIGNMENT 1 -#endif - -#define AVOID_MEMORY_READ -#define FAST_CONSTANT_OFFSET_MODE -#define LARGE_INSTRUCTION_CACHE -#define PLENTIFUL_REGISTERS - -#endif /* SuperH */ - - -#if (defined(sun) && (defined(__sparc) || defined(sparc))) || \ - (defined(__uxp__) && (defined(sparc) || defined(mc68000))) || \ - defined(__sparc__) || defined(__mc68000__) - -#if defined(__sparc) || defined(__sparc__) -# if !defined(sparc) -# define sparc 1 -# endif -#endif - -#if defined(sun386) || defined(sun5) -# define IMAGE_BYTE_ORDER LSBFirst /* Values for the SUN only */ -# define BITMAP_BIT_ORDER LSBFirst -#else -# define IMAGE_BYTE_ORDER MSBFirst /* Values for the SUN only */ -# define BITMAP_BIT_ORDER MSBFirst -#endif - -#ifdef sparc -# define AVOID_MEMORY_READ -# define LARGE_INSTRUCTION_CACHE -# define FAST_CONSTANT_OFFSET_MODE -# define SHARED_IDCACHE -#endif - -#ifdef mc68020 -#define FAST_UNALIGNED_READS -#endif - -#define GLYPHPADBYTES 4 -#define GETLEFTBITS_ALIGNMENT 1 - -#endif /* sun && !(i386 && SVR4) */ - - -#if defined(AIXV3) - -#define IMAGE_BYTE_ORDER MSBFirst /* Values for the RISC/6000 */ -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 -#define GETLEFTBITS_ALIGNMENT 1 - -#define LARGE_INSTRUCTION_CACHE -#define FAST_CONSTANT_OFFSET_MODE -#define PLENTIFUL_REGISTERS -#define AVOID_MEMORY_READ - -#define FAST_MEMCPY -#endif /* AIXV3 */ - -#if defined(ibm032) || defined (ibm) - -#ifdef i386 -# define IMAGE_BYTE_ORDER LSBFirst /* Value for PS/2 only */ -#else -# define IMAGE_BYTE_ORDER MSBFirst /* Values for the RT only*/ -#endif -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 1 -#define GETLEFTBITS_ALIGNMENT 4 -/* ibm pcc doesn't understand pragmas. */ - -#ifdef i386 -#define BITMAP_SCANLINE_UNIT 8 -#endif - -#endif /* ibm */ - -#if defined (M4310) || defined(M4315) || defined(M4317) || defined(M4319) || defined(M4330) - -#define IMAGE_BYTE_ORDER MSBFirst /* Values for Pegasus only */ -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 -#define GETLEFTBITS_ALIGNMENT 1 - -#define FAST_UNALIGNED_READS - -#endif /* tektronix */ - -#ifdef macII - -#define IMAGE_BYTE_ORDER MSBFirst /* Values for the MacII only */ -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 -#define GETLEFTBITS_ALIGNMENT 1 - -/* might want FAST_UNALIGNED_READS for frame buffers with < 1us latency */ - -#endif /* macII */ - -#if (defined(mips) || defined(__mips)) && !defined(sgi) - -#if defined(MIPSEL) || defined(__MIPSEL__) -# define IMAGE_BYTE_ORDER LSBFirst /* Values for the PMAX only */ -# define BITMAP_BIT_ORDER LSBFirst -# define GLYPHPADBYTES 4 -# define GETLEFTBITS_ALIGNMENT 1 #else -# define IMAGE_BYTE_ORDER MSBFirst /* Values for the MIPS only */ -# define BITMAP_BIT_ORDER MSBFirst -# define GLYPHPADBYTES 4 -# define GETLEFTBITS_ALIGNMENT 1 -#endif - -#define AVOID_MEMORY_READ -#define FAST_CONSTANT_OFFSET_MODE -#define LARGE_INSTRUCTION_CACHE -#define PLENTIFUL_REGISTERS - -#endif /* mips */ - -#if defined(__alpha) || defined(__alpha__) || defined(__alphaCross) -# define IMAGE_BYTE_ORDER LSBFirst /* Values for the Alpha only */ - -# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO) -# define BITMAP_BIT_ORDER MSBFirst -# else -# define BITMAP_BIT_ORDER LSBFirst -# endif - -# if defined(XF86MONOVGA) || defined(XF86VGA16) -# define BITMAP_SCANLINE_UNIT 8 -# endif - -# define GLYPHPADBYTES 4 -# define GETLEFTBITS_ALIGNMENT 1 -# define FAST_CONSTANT_OFFSET_MODE -# define LARGE_INSTRUCTION_CACHE -# define PLENTIFUL_REGISTERS - -#endif /* alpha */ - -#if defined (linux) && defined (__s390__) - -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 -#define GETLEFTBITS_ALIGNMENT 1 - -#define BITMAP_SCANLINE_UNIT 8 -#define LARGE_INSTRUCTION_CACHE -#define FAST_CONSTANT_OFFSET_MODE -#define FAST_UNALIGNED_READ - -#define FAST_MEMCPY - -#endif /* linux/s390 */ - -#if defined (linux) && defined (__s390x__) - -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 -#define GETLEFTBITS_ALIGNMENT 1 - -#define BITMAP_SCANLINE_UNIT 8 -#define LARGE_INSTRUCTION_CACHE -#define FAST_CONSTANT_OFFSET_MODE -#define FAST_UNALIGNED_READ - -#define FAST_MEMCPY -#endif /* linux/s390x */ - - -#if defined(__ia64__) || defined(ia64) -# define IMAGE_BYTE_ORDER LSBFirst - -# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO) -# define BITMAP_BIT_ORDER MSBFirst -# else -# define BITMAP_BIT_ORDER LSBFirst -# endif - -# if defined(XF86MONOVGA) || defined(XF86VGA16) -# define BITMAP_SCANLINE_UNIT 8 -# endif - -# define GLYPHPADBYTES 4 -# define GETLEFTBITS_ALIGNMENT 1 -# define FAST_CONSTANT_OFFSET_MODE -# define LARGE_INSTRUCTION_CACHE -# define PLENTIFUL_REGISTERS - -#endif /* ia64 */ - -#if defined(__amd64__) || defined(amd64) || defined(__amd64) -# define IMAGE_BYTE_ORDER LSBFirst - -# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO) -# define BITMAP_BIT_ORDER MSBFirst -# else -# define BITMAP_BIT_ORDER LSBFirst -# endif - -# if defined(XF86MONOVGA) || defined(XF86VGA16) -# define BITMAP_SCANLINE_UNIT 8 -# endif - -# define GLYPHPADBYTES 4 -# define GETLEFTBITS_ALIGNMENT 1 -# define LARGE_INSTRUCTION_CACHE -# define FAST_CONSTANT_OFFSET_MODE -/* ???? */ -# define FAST_UNALIGNED_READS -#endif /* AMD64 */ - -#ifdef stellar - -#define IMAGE_BYTE_ORDER MSBFirst /* Values for the stellar only*/ -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 -#define GETLEFTBITS_ALIGNMENT 4 -#define IMAGE_BUFSIZE (64*1024) -/* - * Use SysV random number generator. - */ -#define random rand - -#endif /* stellar */ - -#ifdef luna - -#define IMAGE_BYTE_ORDER MSBFirst /* Values for the OMRON only*/ -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 -#define GETLEFTBITS_ALIGNMENT 1 - -#ifndef mc68000 -#define FAST_CONSTANT_OFFSET_MODE -#define AVOID_MEMORY_READ -#define LARGE_INSTRUCTION_CACHE -#define PLENTIFUL_REGISTERS -#endif - -#endif /* luna */ - -#if (defined(SVR4) && defined(i386)) || \ - defined(__alpha__) || defined(__alpha) || \ - defined(__i386__) || defined(__i386) || \ - defined(__UNIXOS2__) || \ - defined(__OS2ELF__) || \ - defined(__QNX__) || \ - defined(__s390x__) || defined(__s390__) - -#ifndef IMAGE_BYTE_ORDER -#define IMAGE_BYTE_ORDER LSBFirst -#endif - -#ifndef BITMAP_BIT_ORDER -# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO) -# define BITMAP_BIT_ORDER MSBFirst -# else -# define BITMAP_BIT_ORDER LSBFirst -# endif -#endif - -#ifndef BITMAP_SCANLINE_UNIT -# if defined(XF86MONOVGA) || defined(XF86VGA16) -# define BITMAP_SCANLINE_UNIT 8 -# endif +#error "Too weird to live." #endif #ifndef GLYPHPADBYTES #define GLYPHPADBYTES 4 #endif - -#define GETLEFTBITS_ALIGNMENT 1 -#define AVOID_MEMORY_READ -#ifdef XSVGA -#define AVOID_GLYPHBLT -#define FAST_CONSTANT_OFFSET_MODE -#define FAST_MEMCPY -#define NO_ONE_RECT -#endif - -#endif /* SVR4 / BSD / i386 */ - -#if defined (linux) && defined (__mc68000__) - -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#define FAST_UNALIGNED_READS -#define GLYPHPADBYTES 4 -#define GETLEFTBITS_ALIGNMENT 1 - -#endif /* linux/m68k */ - -#ifdef sgi - -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 -#define GETLEFTBITS_ALIGNMENT 1 -#define AVOID_MEMORY_READ -#define FAST_CONSTANT_OFFSET_MODE -#define LARGE_INSTRUCTION_CACHE -#define PLENTIFUL_REGISTERS - -#endif - -/* linux on the Compaq Itsy */ -#if defined(linux) && defined(__arm__) -#define IMAGE_BYTE_ORDER LSBFirst -#define BITMAP_BIT_ORDER LSBFirst -#define GLYPHPADBYTES 4 -#define GETLEFTBITS_ALIGNMENT 1 -#endif /* size of buffer to use with GetImage, measured in bytes. There's obviously * a trade-off between the amount of stack (or whatever ALLOCATE_LOCAL gives diff --git a/nx-X11/programs/Xserver/include/site.h b/nx-X11/programs/Xserver/include/site.h index be8c003da..c8dfe69a6 100644 --- a/nx-X11/programs/Xserver/include/site.h +++ b/nx-X11/programs/Xserver/include/site.h @@ -1,4 +1,3 @@ -/* $Xorg: site.h,v 1.6 2001/02/09 02:05:16 xorgcvs Exp $ */ /************************************************************ Copyright 1987, 1998 The Open Group @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/include/site.h,v 1.8 2001/12/19 21:37:35 dawes Exp $ */ #ifndef SITE_H #define SITE_H @@ -67,19 +65,15 @@ SOFTWARE. #endif /* - * The following constants are provided solely as a last line of defense. The - * normal build ALWAYS overrides them using a special rule given in - * server/dix/Imakefile. If you want to change either of these constants, - * you should set the DefaultFontPath or DefaultRGBDatabase configuration - * parameters. + * The following constant is provided solely as a last line of defense. The + * normal build ALWAYS overrides it using a special rule given in + * server/dix/Imakefile. If you want to change this constant, you should set + * the DefaultFontPath configuration parameter. * DO NOT CHANGE THESE VALUES OR THE DIX IMAKEFILE! */ #ifndef COMPILEDDEFAULTFONTPATH #define COMPILEDDEFAULTFONTPATH "/usr/lib/X11/fonts/misc/" #endif -#ifndef RGB_DB -#define RGB_DB "/usr/lib/X11/rgb" -#endif /* * The following constants contain default values for all of the variables diff --git a/nx-X11/programs/Xserver/include/swaprep.h b/nx-X11/programs/Xserver/include/swaprep.h index 2c026c659..8a9dcf036 100644 --- a/nx-X11/programs/Xserver/include/swaprep.h +++ b/nx-X11/programs/Xserver/include/swaprep.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/include/swaprep.h,v 3.0 1996/04/15 11:34:34 dawes Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> @@ -120,17 +119,6 @@ extern void SQueryKeymapReply( int /* size */, xQueryKeymapReply * /* pRep */); -#ifdef LBX -extern void SwapCharInfo( - xCharInfo * /* pInfo */); -#endif - -#ifdef LBX -extern void SwapFont( - xQueryFontReply * /* pr */, - Bool /* hasGlyphs */); -#endif - extern void SQueryFontReply( ClientPtr /* pClient */, int /* size */, diff --git a/nx-X11/programs/Xserver/include/swapreq.h b/nx-X11/programs/Xserver/include/swapreq.h index 9c59bbf84..9c785fe62 100644 --- a/nx-X11/programs/Xserver/include/swapreq.h +++ b/nx-X11/programs/Xserver/include/swapreq.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/include/swapreq.h,v 1.3 2003/04/27 21:31:05 herrb Exp $ */ /************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> diff --git a/nx-X11/programs/Xserver/include/validate.h b/nx-X11/programs/Xserver/include/validate.h index 467533d22..e88fb41a2 100644 --- a/nx-X11/programs/Xserver/include/validate.h +++ b/nx-X11/programs/Xserver/include/validate.h @@ -1,4 +1,3 @@ -/* $Xorg: validate.h,v 1.4 2001/02/09 02:05:16 xorgcvs Exp $ */ /* @@ -24,7 +23,6 @@ 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 diff --git a/nx-X11/programs/Xserver/include/window.h b/nx-X11/programs/Xserver/include/window.h index 7c3fce092..a8c78f569 100644 --- a/nx-X11/programs/Xserver/include/window.h +++ b/nx-X11/programs/Xserver/include/window.h @@ -1,4 +1,3 @@ -/* $Xorg: window.h,v 1.4 2001/02/09 02:05:16 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86$ */ #ifndef WINDOW_H #define WINDOW_H @@ -53,7 +51,7 @@ SOFTWARE. #include "misc.h" #include "region.h" #include "screenint.h" -#include <X11/Xproto.h> +#include <nx-X11/Xproto.h> #define TOTALLY_OBSCURED 0 #define UNOBSCURED 1 @@ -73,17 +71,17 @@ typedef struct _Window *WindowPtr; typedef int (*VisitWindowProcPtr)( WindowPtr /*pWin*/, - pointer /*data*/); + void * /*data*/); extern int TraverseTree( WindowPtr /*pWin*/, VisitWindowProcPtr /*func*/, - pointer /*data*/); + void * /*data*/); extern int WalkTree( ScreenPtr /*pScreen*/, VisitWindowProcPtr /*func*/, - pointer /*data*/); + void * /*data*/); extern WindowPtr AllocateWindow( ScreenPtr /*pScreen*/); @@ -102,6 +100,10 @@ extern void ClippedRegionFromBox( int /*w*/, int /*h*/); +typedef WindowPtr (* RealChildHeadProc) (WindowPtr pWin); + +void RegisterRealChildHeadProc (RealChildHeadProc proc); + extern WindowPtr RealChildHead( WindowPtr /*pWin*/); @@ -122,7 +124,7 @@ extern WindowPtr CreateWindow( int* /*error*/); extern int DeleteWindow( - pointer /*pWin*/, + void * /*pWin*/, XID /*wid*/); extern void DestroySubwindows( diff --git a/nx-X11/programs/Xserver/include/windowstr.h b/nx-X11/programs/Xserver/include/windowstr.h index 89e3ee10b..36d598c6e 100644 --- a/nx-X11/programs/Xserver/include/windowstr.h +++ b/nx-X11/programs/Xserver/include/windowstr.h @@ -1,4 +1,3 @@ -/* $Xorg: windowstr.h,v 1.4 2001/02/09 02:05:16 xorgcvs Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,7 +44,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/include/windowstr.h,v 1.6 2001/12/14 19:59:57 dawes Exp $ */ #ifndef WINDOWSTRUCT_H #define WINDOWSTRUCT_H @@ -58,7 +56,7 @@ SOFTWARE. #include "resource.h" /* for ROOT_WINDOW_ID_BASE */ #include "dix.h" #include "miscstruct.h" -#include <X11/Xprotostr.h> +#include <nx-X11/Xprotostr.h> #include "opaque.h" #define GuaranteeNothing 0 @@ -96,6 +94,33 @@ typedef struct _WindowOpt { #define BackgroundPixel 2L #define BackgroundPixmap 3L +/* + * The redirectDraw field can have one of three values: + * + * RedirectDrawNone + * A normal window; painted into the same pixmap as the parent + * and clipping parent and siblings to its geometry. These + * windows get a clip list equal to the intersection of their + * geometry with the parent geometry, minus the geometry + * of overlapping None and Clipped siblings. + * RedirectDrawAutomatic + * A redirected window which clips parent and sibling drawing. + * Contents for these windows are manage inside the server. + * These windows get an internal clip list equal to their + * geometry. + * RedirectDrawManual + * A redirected window which does not clip parent and sibling + * drawing; the window must be represented within the parent + * geometry by the client performing the redirection management. + * Contents for these windows are managed outside the server. + * These windows get an internal clip list equal to their + * geometry. + */ + +#define RedirectDrawNone 0 +#define RedirectDrawAutomatic 1 +#define RedirectDrawManual 2 + typedef struct _Window { DrawableRec drawable; WindowPtr parent; /* ancestor chain */ @@ -114,7 +139,7 @@ typedef struct _Window { Mask eventMask; PixUnion background; PixUnion border; - pointer backStorage; /* null when BS disabled */ + void * backStorage; /* null when BS disabled */ WindowOptPtr optional; unsigned backgroundState:2; /* None, Relative, Pixel, Pixmap */ unsigned borderIsPixel:1; @@ -138,7 +163,7 @@ typedef struct _Window { unsigned srcBuffer:1; /* source buffer for rendering */ #endif #ifdef COMPOSITE - unsigned redirectDraw:1; /* rendering is redirected from here */ + unsigned redirectDraw:2; /* rendering is redirected from here */ #endif DevUnion *devPrivates; } WindowRec; @@ -227,8 +252,4 @@ extern ScreenSaverStuffRec savedScreenInfo[MAXSCREENS]; extern int numSaveUndersViewable; extern int deltaSaveUndersViewable; -#ifdef XEVIE -extern WindowPtr xeviewin; -#endif - #endif /* WINDOWSTRUCT_H */ diff --git a/nx-X11/programs/Xserver/include/xkbfile.h b/nx-X11/programs/Xserver/include/xkbfile.h new file mode 100644 index 000000000..e99de6c9c --- /dev/null +++ b/nx-X11/programs/Xserver/include/xkbfile.h @@ -0,0 +1,479 @@ + +#ifndef _XKBFILE_H_ +#define _XKBFILE_H_ 1 + +/************************************************************ + Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. + + 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 Silicon Graphics not be + used in advertising or publicity pertaining to distribution + of the software without specific prior written permission. + Silicon Graphics makes no representation about the suitability + of this software for any purpose. It is provided "as is" + without any express or implied warranty. + + SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + GRAPHICS 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. + + ********************************************************/ + +/***====================================================================***/ + +#define XkbXKMFile 0 +#define XkbCFile 1 +#define XkbXKBFile 2 +#define XkbMessage 3 + +#define XkbMapDefined (1<<0) +#define XkbStateDefined (1<<1) + +typedef struct _XkbFileInfo { + unsigned type; + unsigned defined; + XkbDescPtr xkb; +} XkbFileInfo,*XkbFileInfoPtr; + +typedef void (*XkbFileAddOnFunc)( + FILE * /* file */, + XkbFileInfo * /* result */, + Bool /* topLevel */, + Bool /* showImplicit */, + int /* fileSection */, + void * /* priv */ +); + +/***====================================================================***/ + +#define _XkbSuccess 0 +#define _XkbErrMissingNames 1 +#define _XkbErrMissingTypes 2 +#define _XkbErrMissingReqTypes 3 +#define _XkbErrMissingSymbols 4 +#define _XkbErrMissingVMods 5 +#define _XkbErrMissingIndicators 6 +#define _XkbErrMissingCompatMap 7 +#define _XkbErrMissingSymInterps 8 +#define _XkbErrMissingGeometry 9 +#define _XkbErrIllegalDoodad 10 +#define _XkbErrIllegalTOCType 11 +#define _XkbErrIllegalContents 12 +#define _XkbErrEmptyFile 13 +#define _XkbErrFileNotFound 14 +#define _XkbErrFileCannotOpen 15 +#define _XkbErrBadValue 16 +#define _XkbErrBadMatch 17 +#define _XkbErrBadTypeName 18 +#define _XkbErrBadTypeWidth 19 +#define _XkbErrBadFileType 20 +#define _XkbErrBadFileVersion 21 +#define _XkbErrBadFileFormat 22 +#define _XkbErrBadAlloc 23 +#define _XkbErrBadLength 24 +#define _XkbErrXReqFailure 25 +#define _XkbErrBadImplementation 26 + +extern char * _XkbErrMessages[]; +extern unsigned _XkbErrCode; +extern char * _XkbErrLocation; +extern unsigned _XkbErrData; + +/***====================================================================***/ + +_XFUNCPROTOBEGIN + +extern char * XkbIndentText( + unsigned /* size */ +); + +extern char * XkbAtomText( + Display * /* dpy */, + Atom /* atm */, + unsigned /* format */ +); + +extern char * XkbKeysymText( + KeySym /* sym */, + unsigned /* format */ +); + +extern char * XkbStringText( + char * /* str */, + unsigned /* format */ +); + +extern char * XkbKeyNameText( + char * /* name */, + unsigned /* format */ +); + +extern char * +XkbModIndexText( + unsigned /* ndx */, + unsigned /* format */ +); + +extern char * +XkbModMaskText( + unsigned /* mask */, + unsigned /* format */ +); + +extern char * XkbVModIndexText( + Display * /* dpy */, + XkbDescPtr /* xkb */, + unsigned /* ndx */, + unsigned /* format */ +); + +extern char * XkbVModMaskText( + Display * /* dpy */, + XkbDescPtr /* xkb */, + unsigned /* modMask */, + unsigned /* mask */, + unsigned /* format */ +); + +extern char * XkbConfigText( + unsigned /* config */, + unsigned /* format */ +); + +extern char * XkbSIMatchText( + unsigned /* type */, + unsigned /* format */ +); + +extern char * XkbIMWhichStateMaskText( + unsigned /* use_which */, + unsigned /* format */ +); + +extern char * XkbAccessXDetailText( + unsigned /* state */, + unsigned /* format */ +); + +extern char * XkbNKNDetailMaskText( + unsigned /* detail */, + unsigned /* format */ +); + +extern char * XkbControlsMaskText( + unsigned /* ctrls */, + unsigned /* format */ +); + +extern char * XkbGeomFPText( + int /* val */, + unsigned /* format */ +); + +extern char * XkbDoodadTypeText( + unsigned /* type */, + unsigned /* format */ +); + +extern char * XkbActionTypeText( + unsigned /* type */, + unsigned /* format */ +); + +extern char * XkbActionText( + Display * /* dpy */, + XkbDescPtr /* xkb */, + XkbAction * /* action */, + unsigned /* format */ +); + +extern char * XkbBehaviorText( + XkbDescPtr /* xkb */, + XkbBehavior * /* behavior */, + unsigned /* format */ +); + +/***====================================================================***/ + +#define _XkbKSLower (1<<0) +#define _XkbKSUpper (1<<1) + +#define XkbKSIsLower(k) (_XkbKSCheckCase(k)&_XkbKSLower) +#define XkbKSIsUpper(k) (_XkbKSCheckCase(k)&_XkbKSUpper) +#define XkbKSIsKeypad(k) (((k)>=XK_KP_Space)&&((k)<=XK_KP_Equal)) +#define XkbKSIsDeadKey(k) \ + (((k)>=XK_dead_grave)&&((k)<=XK_dead_semivoiced_sound)) + +extern unsigned _XkbKSCheckCase( + KeySym /* sym */ +); + +extern int XkbFindKeycodeByName( + XkbDescPtr /* xkb */, + char * /* name */, + Bool /* use_aliases */ +); + +extern Bool XkbLookupGroupAndLevel( + XkbDescPtr /* xkb */, + int /* key */, + int * /* mods_inout */, + int * /* grp_inout */, + int * /* lvl_rtrn */ +); + +/***====================================================================***/ + + +/***====================================================================***/ + +extern Atom XkbInternAtom( + Display * /* dpy */, + char * /* name */, + Bool /* onlyIfExists */ +); + +extern Status XkbChangeKbdDisplay( + Display * /* newDpy */, + XkbFileInfo * /* result */ +); + +extern Atom XkbChangeAtomDisplay( + Display * /* oldDpy */, + Display * /* newDpy */, + Atom /* atm */ +); + +extern void XkbInitAtoms( + Display * /* dpy */ +); + +/***====================================================================***/ + +#ifdef _XKBGEOM_H_ + +#define XkbDW_Unknown 0 +#define XkbDW_Doodad 1 +#define XkbDW_Section 2 +typedef struct _XkbDrawable { + int type; + int priority; + union { + XkbDoodadPtr doodad; + XkbSectionPtr section; + } u; + struct _XkbDrawable * next; +} XkbDrawableRec,*XkbDrawablePtr; + +extern XkbDrawablePtr +XkbGetOrderedDrawables( + XkbGeometryPtr /* geom */, + XkbSectionPtr /* section */ +); + +extern void +XkbFreeOrderedDrawables( + XkbDrawablePtr /* draw */ +); + +#endif + +/***====================================================================***/ + +extern unsigned XkbConvertGetByNameComponents( + Bool /* toXkm */, + unsigned /* orig */ +); + +extern unsigned XkbConvertXkbComponents( + Bool /* toXkm */, + unsigned /* orig */ +); + +extern Bool XkbDetermineFileType( + XkbFileInfo * /* xkb */, + int /* format */, + int * /* opts_missing */ +); + +extern Bool XkbNameMatchesPattern( + char * /* name */, + char * /* pattern */ +); + +/***====================================================================***/ + +extern Bool XkbWriteXKBKeycodes( + FILE * /* file */, + XkbFileInfo * /* result */, + Bool /* topLevel */, + Bool /* showImplicit */, + XkbFileAddOnFunc /* addOn */, + void * /* priv */ +); + +extern Bool XkbWriteXKBKeyTypes( + FILE * /* file */, + XkbFileInfo * /* result */, + Bool /* topLevel */, + Bool /* showImplicit */, + XkbFileAddOnFunc /* addOn */, + void * /* priv */ +); + +extern Bool XkbWriteXKBCompatMap( + FILE * /* file */, + XkbFileInfo * /* result */, + Bool /* topLevel */, + Bool /* showImplicit */, + XkbFileAddOnFunc /* addOn */, + void * /* priv */ +); + +extern Bool XkbWriteXKBSymbols( + FILE * /* file */, + XkbFileInfo * /* result */, + Bool /* topLevel */, + Bool /* showImplicit */, + XkbFileAddOnFunc /* addOn */, + void * /* priv */ +); + +extern Bool XkbWriteXKBGeometry( + FILE * /* file */, + XkbFileInfo * /* result */, + Bool /* topLevel */, + Bool /* showImplicit */, + XkbFileAddOnFunc /* addOn */, + void * /* priv */ +); + +extern Bool XkbWriteXKBSemantics( + FILE * /* file */, + XkbFileInfo * /* result */, + Bool /* topLevel */, + Bool /* showImplicit */, + XkbFileAddOnFunc /* addOn */, + void * /* priv */ +); + +extern Bool XkbWriteXKBLayout( + FILE * /* file */, + XkbFileInfo * /* result */, + Bool /* topLevel */, + Bool /* showImplicit */, + XkbFileAddOnFunc /* addOn */, + void * /* priv */ +); + +extern Bool XkbWriteXKBKeymap( + FILE * /* file */, + XkbFileInfo * /* result */, + Bool /* topLevel */, + Bool /* showImplicit */, + XkbFileAddOnFunc /* addOn */, + void * /* priv */ +); + +extern Bool XkbWriteXKBFile( + FILE * /* file */, + XkbFileInfo * /* result */, + Bool /* showImplicit */, + XkbFileAddOnFunc /* addOn */, + void * /* priv */ +); + +extern Bool XkbWriteCFile( + FILE * /* file */, + char * /* name */, + XkbFileInfo * /* info */ +); + +extern Bool XkbWriteXKMFile( + FILE * /* file */, + XkbFileInfo * /* result */ +); + +extern Bool XkbWriteToServer( + XkbFileInfo * /* result */ +); + +extern void XkbEnsureSafeMapName( + char * /* name */ +); + +extern Bool XkbWriteXKBKeymapForNames( + FILE * /* file */, + XkbComponentNamesPtr /* names */, + Display * /* dpy */, + XkbDescPtr /* xkb */, + unsigned /* want */, + unsigned /* need */ +); + +extern Status XkbMergeFile( + XkbDescPtr /* xkb */, + XkbFileInfo /* finfo */ +); + +/***====================================================================***/ + +extern Bool XkmProbe( + FILE * /* file */ +); + +extern unsigned XkbReadFromServer( + Display * /* dpy */, + unsigned /* need */, + unsigned /* want */, + XkbFileInfo * /* result */ +); + +extern unsigned XkmReadFile( + FILE * /* file */, + unsigned /* need */, + unsigned /* want */, + XkbFileInfo * /* result */ +); + +#ifdef _XKMFORMAT_H_ + +extern Bool XkmReadTOC( + FILE * /* file */, + xkmFileInfo * /* file_info */, + int /* max_toc */, + xkmSectionInfo * /* toc */ +); + +extern xkmSectionInfo *XkmFindTOCEntry( + xkmFileInfo * /* finfo */, + xkmSectionInfo * /* toc */, + unsigned /* type */ +); + +extern Bool XkmReadFileSection( + FILE * /* file */, + xkmSectionInfo * /* toc */, + XkbFileInfo * /* result */, + unsigned * /* loaded_rtrn */ +); + +extern char * XkmReadFileSectionName( + FILE * /* file */, + xkmSectionInfo * /* toc */ +); + +#endif /* _XKMFORMAT_H */ + +_XFUNCPROTOEND + +#endif /* _XKBFILE_H_ */ diff --git a/nx-X11/programs/Xserver/include/xkbrules.h b/nx-X11/programs/Xserver/include/xkbrules.h new file mode 100644 index 000000000..021e1021f --- /dev/null +++ b/nx-X11/programs/Xserver/include/xkbrules.h @@ -0,0 +1,184 @@ +#ifndef _XKBRULES_H_ +#define _XKBRULES_H_ 1 + +/************************************************************ + Copyright (c) 1996 by Silicon Graphics Computer Systems, Inc. + + 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 Silicon Graphics not be + used in advertising or publicity pertaining to distribution + of the software without specific prior written permission. + Silicon Graphics makes no representation about the suitability + of this software for any purpose. It is provided "as is" + without any express or implied warranty. + + SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + GRAPHICS 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. + + ********************************************************/ + +/***====================================================================***/ + +typedef struct _XkbRF_VarDefs { + char * model; + char * layout; + char * variant; + char * options; + unsigned short sz_extra; + unsigned short num_extra; + char * extra_names; + char ** extra_values; +} XkbRF_VarDefsRec,*XkbRF_VarDefsPtr; + +typedef struct _XkbRF_VarDesc { + char * name; + char * desc; +} XkbRF_VarDescRec, *XkbRF_VarDescPtr; + +typedef struct _XkbRF_DescribeVars { + int sz_desc; + int num_desc; + XkbRF_VarDescPtr desc; +} XkbRF_DescribeVarsRec,*XkbRF_DescribeVarsPtr; + +typedef struct _XkbRF_Rule { + int number; + int layout_num; + int variant_num; + char * model; + char * layout; + char * variant; + char * option; + /* yields */ + char * keycodes; + char * symbols; + char * types; + char * compat; + char * geometry; + char * keymap; + unsigned flags; +} XkbRF_RuleRec,*XkbRF_RulePtr; + +typedef struct _XkbRF_Group { + int number; + char * name; + char * words; +} XkbRF_GroupRec, *XkbRF_GroupPtr; + +#define XkbRF_PendingMatch (1L<<1) +#define XkbRF_Option (1L<<2) +#define XkbRF_Append (1L<<3) +#define XkbRF_Normal (1L<<4) +#define XkbRF_Invalid (1L<<5) + +typedef struct _XkbRF_Rules { + XkbRF_DescribeVarsRec models; + XkbRF_DescribeVarsRec layouts; + XkbRF_DescribeVarsRec variants; + XkbRF_DescribeVarsRec options; + unsigned short sz_extra; + unsigned short num_extra; + char ** extra_names; + XkbRF_DescribeVarsPtr extra; + + unsigned short sz_rules; + unsigned short num_rules; + XkbRF_RulePtr rules; + unsigned short sz_groups; + unsigned short num_groups; + XkbRF_GroupPtr groups; +} XkbRF_RulesRec, *XkbRF_RulesPtr; + +/***====================================================================***/ + +_XFUNCPROTOBEGIN + +extern Bool XkbRF_GetComponents( + XkbRF_RulesPtr /* rules */, + XkbRF_VarDefsPtr /* var_defs */, + XkbComponentNamesPtr /* names */ +); + +extern XkbRF_RulePtr XkbRF_AddRule( + XkbRF_RulesPtr /* rules */ +); + +extern XkbRF_GroupPtr XkbRF_AddGroup(XkbRF_RulesPtr rules); + +extern Bool XkbRF_LoadRules( + FILE * /* file */, + XkbRF_RulesPtr /* rules */ +); + +extern Bool XkbRF_LoadRulesByName( + char * /* base */, + char * /* locale */, + XkbRF_RulesPtr /* rules */ +); + +/***====================================================================***/ + +extern XkbRF_VarDescPtr XkbRF_AddVarDesc( + XkbRF_DescribeVarsPtr /* vars */ +); + +extern XkbRF_VarDescPtr XkbRF_AddVarDescCopy( + XkbRF_DescribeVarsPtr /* vars */, + XkbRF_VarDescPtr /* copy_from */ +); + +extern XkbRF_DescribeVarsPtr XkbRF_AddVarToDescribe( + XkbRF_RulesPtr /* rules */, + char * /* name */ +); + +extern Bool XkbRF_LoadDescriptions( + FILE * /* file */, + XkbRF_RulesPtr /* rules */ +); + +extern Bool XkbRF_LoadDescriptionsByName( + char * /* base */, + char * /* locale */, + XkbRF_RulesPtr /* rules */ +); + +extern XkbRF_RulesPtr XkbRF_Load( + char * /* base */, + char * /* locale */, + Bool /* wantDesc */, + Bool /* wantRules */ +); + +extern XkbRF_RulesPtr XkbRF_Create( + int /* sz_rules */, + int /* sz_extra */ +); + +/***====================================================================***/ + +extern void XkbRF_Free( + XkbRF_RulesPtr /* rules */, + Bool /* freeRules */ +); + + +/***====================================================================***/ + +#define _XKB_RF_NAMES_PROP_ATOM "_XKB_RULES_NAMES" +#define _XKB_RF_NAMES_PROP_MAXLEN 1024 + + +_XFUNCPROTOEND + +#endif /* _XKBRULES_H_ */ diff --git a/nx-X11/programs/Xserver/include/xkbsrv.h b/nx-X11/programs/Xserver/include/xkbsrv.h new file mode 100644 index 000000000..533a30930 --- /dev/null +++ b/nx-X11/programs/Xserver/include/xkbsrv.h @@ -0,0 +1,1181 @@ +/************************************************************ +Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. + +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 Silicon Graphics not be +used in advertising or publicity pertaining to distribution +of the software without specific prior written permission. +Silicon Graphics makes no representation about the suitability +of this software for any purpose. It is provided "as is" +without any express or implied warranty. + +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON +GRAPHICS 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 _XKBSRV_H_ +#define _XKBSRV_H_ + +#define XkbAllocClientMap SrvXkbAllocClientMap +#define XkbAllocServerMap SrvXkbAllocServerMap +#define XkbChangeTypesOfKey SrvXkbChangeTypesOfKey +#define XkbAddKeyType SrvXkbAddKeyType +#define XkbCopyKeyType SrvXkbCopyKeyType +#define XkbCopyKeyTypes SrvXkbCopyKeyTypes +#define XkbFreeClientMap SrvXkbFreeClientMap +#define XkbFreeServerMap SrvXkbFreeServerMap +#define XkbInitCanonicalKeyTypes SrvXkbInitCanonicalKeyTypes +#define XkbKeyTypesForCoreSymbols SrvXkbKeyTypesForCoreSymbols +#define XkbApplyCompatMapToKey SrvXkbApplyCompatMapToKey +#define XkbUpdateMapFromCore SrvXkbUpdateMapFromCore +#define XkbResizeKeyActions SrvXkbResizeKeyActions +#define XkbResizeKeySyms SrvXkbResizeKeySyms +#define XkbResizeKeyType SrvXkbResizeKeyType +#define XkbAllocCompatMap SrvXkbAllocCompatMap +#define XkbAllocControls SrvXkbAllocControls +#define XkbAllocIndicatorMaps SrvXkbAllocIndicatorMaps +#define XkbAllocKeyboard SrvXkbAllocKeyboard +#define XkbAllocNames SrvXkbAllocNames +#define XkbFreeCompatMap SrvXkbFreeCompatMap +#define XkbFreeControls SrvXkbFreeControls +#define XkbFreeIndicatorMaps SrvXkbFreeIndicatorMaps +#define XkbFreeKeyboard SrvXkbFreeKeyboard +#define XkbFreeNames SrvXkbFreeNames +#define XkbAddDeviceLedInfo SrvXkbAddDeviceLedInfo +#define XkbAllocDeviceInfo SrvXkbAllocDeviceInfo +#define XkbFreeDeviceInfo SrvXkbFreeDeviceInfo +#define XkbResizeDeviceButtonActions SrvXkbResizeDeviceButtonActions +#define XkbLatchModifiers SrvXkbLatchModifiers +#define XkbLatchGroup SrvXkbLatchGroup +#define XkbVirtualModsToReal SrvXkbVirtualModsToReal +#define XkbChangeKeycodeRange SrvXkbChangeKeycodeRange +#define XkbApplyVirtualModChanges SrvXkbApplyVirtualModChanges +#define XkbUpdateActionVirtualMods SrvXkbUpdateActionVirtualMods +#define XkbUpdateKeyTypeVirtualMods SrvXkbUpdateKeyTypeVirtualMods + +#include <nx-X11/extensions/XKBproto.h> +#include "xkbstr.h" +#include "inputstr.h" + +#ifdef NXAGENT_SERVER +extern char *_NXGetXkbBasePath(const char *path); +extern char *_NXGetXkbCompPath(const char *path); +#endif + +typedef struct _XkbInterest { + DeviceIntPtr dev; + ClientPtr client; + XID resource; + struct _XkbInterest * next; + CARD16 extDevNotifyMask; + CARD16 stateNotifyMask; + CARD16 namesNotifyMask; + CARD32 ctrlsNotifyMask; + CARD8 compatNotifyMask; + BOOL bellNotifyMask; + BOOL actionMessageMask; + CARD16 accessXNotifyMask; + CARD32 iStateNotifyMask; + CARD32 iMapNotifyMask; + CARD16 altSymsNotifyMask; + CARD32 autoCtrls; + CARD32 autoCtrlValues; +} XkbInterestRec,*XkbInterestPtr; + +typedef struct _XkbRadioGroup { + CARD8 flags; + CARD8 nMembers; + CARD8 dfltDown; + CARD8 currentDown; + CARD8 members[XkbRGMaxMembers]; +} XkbRadioGroupRec, *XkbRadioGroupPtr; + +typedef struct _XkbEventCause { + CARD8 kc; + CARD8 event; + CARD8 mjr; + CARD8 mnr; + ClientPtr client; +} XkbEventCauseRec,*XkbEventCausePtr; +#define XkbSetCauseKey(c,k,e) { (c)->kc= (k),(c)->event= (e),\ + (c)->mjr= (c)->mnr= 0; \ + (c)->client= NULL; } +#define XkbSetCauseReq(c,j,n,cl) { (c)->kc= (c)->event= 0,\ + (c)->mjr= (j),(c)->mnr= (n);\ + (c)->client= (cl); } +#define XkbSetCauseCoreReq(c,e,cl) XkbSetCauseReq(c,e,0,cl) +#define XkbSetCauseXkbReq(c,e,cl) XkbSetCauseReq(c,XkbReqCode,e,cl) +#define XkbSetCauseUnknown(c) XkbSetCauseKey(c,0,0) + +#define _OFF_TIMER 0 +#define _KRG_WARN_TIMER 1 +#define _KRG_TIMER 2 +#define _SK_TIMEOUT_TIMER 3 +#define _ALL_TIMEOUT_TIMER 4 + +#define _BEEP_NONE 0 +#define _BEEP_FEATURE_ON 1 +#define _BEEP_FEATURE_OFF 2 +#define _BEEP_FEATURE_CHANGE 3 +#define _BEEP_SLOW_WARN 4 +#define _BEEP_SLOW_PRESS 5 +#define _BEEP_SLOW_ACCEPT 6 +#define _BEEP_SLOW_REJECT 7 +#define _BEEP_SLOW_RELEASE 8 +#define _BEEP_STICKY_LATCH 9 +#define _BEEP_STICKY_LOCK 10 +#define _BEEP_STICKY_UNLOCK 11 +#define _BEEP_LED_ON 12 +#define _BEEP_LED_OFF 13 +#define _BEEP_LED_CHANGE 14 +#define _BEEP_BOUNCE_REJECT 15 + +typedef struct _XkbSrvInfo { + XkbStateRec prev_state; + XkbStateRec state; + XkbDescPtr desc; + + DeviceIntPtr device; + KbdCtrlProcPtr kbdProc; + + XkbRadioGroupPtr radioGroups; + CARD8 nRadioGroups; + CARD8 clearMods; + CARD8 setMods; + INT16 groupChange; + + CARD16 dfltPtrDelta; + + double mouseKeysCurve; + double mouseKeysCurveFactor; + INT16 mouseKeysDX; + INT16 mouseKeysDY; + CARD8 mouseKeysFlags; + Bool mouseKeysAccel; + CARD8 mouseKeysCounter; + + CARD8 lockedPtrButtons; + CARD8 shiftKeyCount; + KeyCode mouseKey; + KeyCode inactiveKey; + KeyCode slowKey; + KeyCode repeatKey; + CARD8 krgTimerActive; + CARD8 beepType; + CARD8 beepCount; + + CARD32 flags; + CARD32 lastPtrEventTime; + CARD32 lastShiftEventTime; + OsTimerPtr beepTimer; + OsTimerPtr mouseKeyTimer; + OsTimerPtr slowKeysTimer; + OsTimerPtr bounceKeysTimer; + OsTimerPtr repeatKeyTimer; + OsTimerPtr krgTimer; +} XkbSrvInfoRec, *XkbSrvInfoPtr; + +#define XkbSLI_IsDefault (1L<<0) +#define XkbSLI_HasOwnState (1L<<1) + +typedef struct _XkbSrvLedInfo { + CARD16 flags; + CARD16 class; + CARD16 id; + union { + KbdFeedbackPtr kf; + LedFeedbackPtr lf; + } fb; + + CARD32 physIndicators; + CARD32 autoState; + CARD32 explicitState; + CARD32 effectiveState; + + CARD32 mapsPresent; + CARD32 namesPresent; + XkbIndicatorMapPtr maps; + Atom * names; + + CARD32 usesBase; + CARD32 usesLatched; + CARD32 usesLocked; + CARD32 usesEffective; + CARD32 usesCompat; + CARD32 usesControls; + + CARD32 usedComponents; +} XkbSrvLedInfoRec, *XkbSrvLedInfoPtr; + +/* + * Settings for xkbClientFlags field (used by DIX) + * These flags _must_ not overlap with XkbPCF_* + */ +#define _XkbClientInitialized (1<<15) + +#define _XkbWantsDetectableAutoRepeat(c)\ + ((c)->xkbClientFlags&XkbPCF_DetectableAutoRepeatMask) + +/* + * Settings for flags field + */ +#define _XkbStateNotifyInProgress (1<<0) + +typedef struct +{ + ProcessInputProc processInputProc; + ProcessInputProc realInputProc; + DeviceUnwrapProc unwrapProc; +} xkbDeviceInfoRec, *xkbDeviceInfoPtr; + +#define WRAP_PROCESS_INPUT_PROC(device, oldprocs, proc, unwrapproc) \ + device->public.processInputProc = proc; \ + oldprocs->processInputProc = \ + oldprocs->realInputProc = device->public.realInputProc; \ + device->public.realInputProc = proc; \ + oldprocs->unwrapProc = device->unwrapProc; \ + device->unwrapProc = unwrapproc; + +#define COND_WRAP_PROCESS_INPUT_PROC(device, oldprocs, proc, unwrapproc) \ + if (device->public.processInputProc == device->public.realInputProc)\ + device->public.processInputProc = proc; \ + oldprocs->processInputProc = \ + oldprocs->realInputProc = device->public.realInputProc; \ + device->public.realInputProc = proc; \ + oldprocs->unwrapProc = device->unwrapProc; \ + device->unwrapProc = unwrapproc; + +#define UNWRAP_PROCESS_INPUT_PROC(device, oldprocs) \ + device->public.processInputProc = oldprocs->processInputProc; \ + device->public.realInputProc = oldprocs->realInputProc; \ + device->unwrapProc = oldprocs->unwrapProc; + +#define XKBDEVICEINFO(dev) ((xkbDeviceInfoPtr) (dev)->devPrivates[xkbDevicePrivateIndex].ptr) + +/***====================================================================***/ + + +/***====================================================================***/ + +#define XkbAX_KRGMask (XkbSlowKeysMask|XkbBounceKeysMask) +#define XkbAllFilteredEventsMask \ + (XkbAccessXKeysMask|XkbRepeatKeysMask|XkbMouseKeysAccelMask|XkbAX_KRGMask) + +/***====================================================================***/ + +extern int XkbReqCode; +extern int XkbEventBase; +extern int XkbKeyboardErrorCode; +extern int XkbDisableLockActions; +extern char * XkbBaseDirectory; +extern char * XkbBinDirectory; +extern char * XkbInitialMap; +extern int _XkbClientMajor; +extern int _XkbClientMinor; +extern unsigned int XkbXIUnsupported; + +extern char * XkbModelUsed,*XkbLayoutUsed,*XkbVariantUsed,*XkbOptionsUsed; +extern Bool noXkbExtension; +extern Bool XkbWantRulesProp; + +extern void * XkbLastRepeatEvent; + +extern CARD32 xkbDebugFlags; +extern CARD32 xkbDebugCtrls; + + +#define _XkbAlloc(s) malloc((s)) +#define _XkbCalloc(n,s) calloc((n), (s)) +#define _XkbRealloc(o,s) realloc((o),(s)) +#define _XkbTypedAlloc(t) ((t *)malloc(sizeof(t))) +#define _XkbTypedCalloc(n,t) ((t *)calloc((n), sizeof(t))) +#define _XkbTypedRealloc(o,n,t) \ + ((o)?(t *)realloc((o),(n)*sizeof(t)):_XkbTypedCalloc(n,t)) +#define _XkbClearElems(a,f,l,t) bzero(&(a)[f],((l)-(f)+1)*sizeof(t)) +#define _XkbFree(p) free(p) + + +#define _XkbLibError(c,l,d) \ + { _XkbErrCode= (c); _XkbErrLocation= (l); _XkbErrData= (d); } +#define _XkbErrCode2(a,b) ((XID)((((unsigned int)(a))<<24)|((b)&0xffffff))) +#define _XkbErrCode3(a,b,c) _XkbErrCode2(a,(((unsigned int)(b))<<16)|(c)) +#define _XkbErrCode4(a,b,c,d) _XkbErrCode3(a,b,((((unsigned int)(c))<<8)|(d))) + +extern int DeviceKeyPress,DeviceKeyRelease; +extern int DeviceButtonPress,DeviceButtonRelease; + +#ifdef XINPUT +#define _XkbIsPressEvent(t) (((t)==KeyPress)||((t)==DeviceKeyPress)) +#define _XkbIsReleaseEvent(t) (((t)==KeyRelease)||((t)==DeviceKeyRelease)) +#else +#define _XkbIsPressEvent(t) ((t)==KeyPress) +#define _XkbIsReleaseEvent(t) ((t)==KeyRelease) +#endif + +#define _XkbCoreKeycodeInRange(c,k) (((k)>=(c)->curKeySyms.minKeyCode)&&\ + ((k)<=(c)->curKeySyms.maxKeyCode)) +#define _XkbCoreNumKeys(c) ((c)->curKeySyms.maxKeyCode-\ + (c)->curKeySyms.minKeyCode+1) + +#define XConvertCase(s,l,u) XkbConvertCase(s,l,u) +#undef IsKeypadKey +#define IsKeypadKey(s) XkbKSIsKeypad(s) + +#define Status int +#define XPointer void * +#define Display struct _XDisplay + +#ifndef True +#define True 1 +#define False 0 +#endif + +#ifndef PATH_MAX +#ifdef MAXPATHLEN +#define PATH_MAX MAXPATHLEN +#else +#define PATH_MAX 1024 +#endif +#endif + +_XFUNCPROTOBEGIN + +extern void XkbUseMsg( + void +); + +extern int XkbProcessArguments( + int /* argc */, + char ** /* argv */, + int /* i */ +); + +extern void XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc); + +extern void XkbFreeCompatMap( + XkbDescPtr /* xkb */, + unsigned int /* which */, + Bool /* freeMap */ +); + +extern void XkbFreeNames( + XkbDescPtr /* xkb */, + unsigned int /* which */, + Bool /* freeMap */ +); + +extern DeviceIntPtr _XkbLookupAnyDevice( + int /* id */, + int * /* why_rtrn */ +); + +extern DeviceIntPtr _XkbLookupKeyboard( + int /* id */, + int * /* why_rtrn */ +); + +extern DeviceIntPtr _XkbLookupBellDevice( + int /* id */, + int * /* why_rtrn */ +); + +extern DeviceIntPtr _XkbLookupLedDevice( + int /* id */, + int * /* why_rtrn */ +); + +extern DeviceIntPtr _XkbLookupButtonDevice( + int /* id */, + int * /* why_rtrn */ +); + +extern XkbDescPtr XkbAllocKeyboard( + void +); + +extern Status XkbAllocClientMap( + XkbDescPtr /* xkb */, + unsigned int /* which */, + unsigned int /* nTypes */ +); + +extern Status XkbAllocServerMap( + XkbDescPtr /* xkb */, + unsigned int /* which */, + unsigned int /* nNewActions */ +); + +extern void XkbFreeClientMap( + XkbDescPtr /* xkb */, + unsigned int /* what */, + Bool /* freeMap */ +); + +extern void XkbFreeServerMap( + XkbDescPtr /* xkb */, + unsigned int /* what */, + Bool /* freeMap */ +); + +extern Status XkbAllocIndicatorMaps( + XkbDescPtr /* xkb */ +); + +extern Status XkbAllocCompatMap( + XkbDescPtr /* xkb */, + unsigned int /* which */, + unsigned int /* nInterpret */ +); + +extern Status XkbAllocNames( + XkbDescPtr /* xkb */, + unsigned int /* which */, + int /* nTotalRG */, + int /* nTotalAliases */ +); + +extern Status XkbAllocControls( + XkbDescPtr /* xkb */, + unsigned int /* which*/ +); + +extern Status XkbCopyKeyType( + XkbKeyTypePtr /* from */, + XkbKeyTypePtr /* into */ +); + +extern Status XkbCopyKeyTypes( + XkbKeyTypePtr /* from */, + XkbKeyTypePtr /* into */, + int /* num_types */ +); + +extern Status XkbResizeKeyType( + XkbDescPtr /* xkb */, + int /* type_ndx */, + int /* map_count */, + Bool /* want_preserve */, + int /* new_num_lvls */ +); + +extern void XkbFreeKeyboard( + XkbDescPtr /* xkb */, + unsigned int /* which */, + Bool /* freeDesc */ +); + +extern void XkbSetActionKeyMods( + XkbDescPtr /* xkb */, + XkbAction * /* act */, + unsigned int /* mods */ +); + +extern Bool XkbCheckActionVMods( + XkbDescPtr /* xkb */, + XkbAction * /* act */, + unsigned int /* changed */ +); + +extern Bool XkbApplyVModChanges( + XkbSrvInfoPtr /* xkbi */, + unsigned int /* changed */, + XkbChangesPtr /* pChanges */, + unsigned int * /* needChecksRtrn */, + XkbEventCausePtr /* cause */ +); + +extern void XkbApplyVModChangesToAllDevices( + DeviceIntPtr /* dev */, + XkbDescPtr /* xkb */, + unsigned int /* changed */, + XkbEventCausePtr /* cause */ +); + +extern unsigned int XkbMaskForVMask( + XkbDescPtr /* xkb */, + unsigned int /* vmask */ +); + +extern Bool XkbVirtualModsToReal( + XkbDescPtr /* xkb */, + unsigned int /* virtua_mask */, + unsigned int * /* mask_rtrn */ +); + +extern unsigned int XkbAdjustGroup( + int /* group */, + XkbControlsPtr /* ctrls */ +); + +extern KeySym *XkbResizeKeySyms( + XkbDescPtr /* xkb */, + int /* key */, + int /* needed */ +); + +extern XkbAction *XkbResizeKeyActions( + XkbDescPtr /* xkb */, + int /* key */, + int /* needed */ +); + +extern void XkbUpdateKeyTypesFromCore( + DeviceIntPtr /* pXDev */, + KeyCode /* first */, + CARD8 /* num */, + XkbChangesPtr /* pChanges */ +); + +extern void XkbUpdateDescActions( + XkbDescPtr /* xkb */, + KeyCode /* first */, + CARD8 /* num */, + XkbChangesPtr /* changes */ +); + +extern void XkbUpdateActions( + DeviceIntPtr /* pXDev */, + KeyCode /* first */, + CARD8 /* num */, + XkbChangesPtr /* pChanges */, + unsigned int * /* needChecksRtrn */, + XkbEventCausePtr /* cause */ +); + +extern void XkbUpdateCoreDescription( + DeviceIntPtr /* keybd */, + Bool /* resize */ +); + +extern void XkbApplyMappingChange( + DeviceIntPtr /* pXDev */, + CARD8 /* request */, + KeyCode /* firstKey */, + CARD8 /* num */, + ClientPtr /* client */ +); + +extern void XkbSetIndicators( + DeviceIntPtr /* pXDev */, + CARD32 /* affect */, + CARD32 /* values */, + XkbEventCausePtr /* cause */ +); + +extern void XkbUpdateIndicators( + DeviceIntPtr /* keybd */, + CARD32 /* changed */, + Bool /* check_edevs */, + XkbChangesPtr /* pChanges */, + XkbEventCausePtr /* cause */ +); + +extern XkbSrvLedInfoPtr XkbAllocSrvLedInfo( + DeviceIntPtr /* dev */, + KbdFeedbackPtr /* kf */, + LedFeedbackPtr /* lf */, + unsigned int /* needed_parts */ +); + +extern XkbSrvLedInfoPtr XkbFindSrvLedInfo( + DeviceIntPtr /* dev */, + unsigned int /* class */, + unsigned int /* id */, + unsigned int /* needed_parts */ +); + +extern void XkbApplyLedNameChanges( + DeviceIntPtr /* dev */, + XkbSrvLedInfoPtr /* sli */, + unsigned int /* changed_names */, + xkbExtensionDeviceNotify * /* ed */, + XkbChangesPtr /* changes */, + XkbEventCausePtr /* cause */ +); + +extern void XkbApplyLedMapChanges( + DeviceIntPtr /* dev */, + XkbSrvLedInfoPtr /* sli */, + unsigned int /* changed_maps */, + xkbExtensionDeviceNotify * /* ed */, + XkbChangesPtr /* changes */, + XkbEventCausePtr /* cause */ +); + +extern void XkbApplyLedStateChanges( + DeviceIntPtr /* dev */, + XkbSrvLedInfoPtr /* sli */, + unsigned int /* changed_leds */, + xkbExtensionDeviceNotify * /* ed */, + XkbChangesPtr /* changes */, + XkbEventCausePtr /* cause */ +); + +extern void XkbUpdateLedAutoState( + DeviceIntPtr /* dev */, + XkbSrvLedInfoPtr /* sli */, + unsigned int /* maps_to_check */, + xkbExtensionDeviceNotify * /* ed */, + XkbChangesPtr /* changes */, + XkbEventCausePtr /* cause */ +); + +extern void XkbFlushLedEvents( + DeviceIntPtr /* dev */, + DeviceIntPtr /* kbd */, + XkbSrvLedInfoPtr /* sli */, + xkbExtensionDeviceNotify * /* ed */, + XkbChangesPtr /* changes */, + XkbEventCausePtr /* cause */ +); + +extern void XkbUpdateAllDeviceIndicators( + XkbChangesPtr /* changes */, + XkbEventCausePtr /* cause */ +); + +extern unsigned int XkbIndicatorsToUpdate( + DeviceIntPtr /* dev */, + unsigned long /* state_changes */, + Bool /* enabled_ctrl_changes */ +); + +extern void XkbComputeDerivedState( + XkbSrvInfoPtr /* xkbi */ +); + +extern void XkbCheckSecondaryEffects( + XkbSrvInfoPtr /* xkbi */, + unsigned int /* which */, + XkbChangesPtr /* changes */, + XkbEventCausePtr /* cause */ +); + +extern void XkbCheckIndicatorMaps( + DeviceIntPtr /* dev */, + XkbSrvLedInfoPtr /* sli */, + unsigned int /* which */ +); + +extern unsigned int XkbStateChangedFlags( + XkbStatePtr /* old */, + XkbStatePtr /* new */ +); + +extern void XkbSendStateNotify( + DeviceIntPtr /* kbd */, + xkbStateNotify * /* pSN */ +); + +extern void XkbSendMapNotify( + DeviceIntPtr /* kbd */, + xkbMapNotify * /* ev */ +); + +extern int XkbComputeControlsNotify( + DeviceIntPtr /* kbd */, + XkbControlsPtr /* old */, + XkbControlsPtr /* new */, + xkbControlsNotify * /* pCN */, + Bool /* forceCtrlProc */ +); + +extern void XkbSendControlsNotify( + DeviceIntPtr /* kbd */, + xkbControlsNotify * /* ev */ +); + +extern void XkbSendCompatMapNotify( + DeviceIntPtr /* kbd */, + xkbCompatMapNotify * /* ev */ +); + +extern void XkbSendIndicatorNotify( + DeviceIntPtr /* kbd */, + int /* xkbType */, + xkbIndicatorNotify * /* ev */ +); + +extern void XkbHandleBell( + BOOL /* force */, + BOOL /* eventOnly */, + DeviceIntPtr /* kbd */, + CARD8 /* percent */, + void * /* ctrl */, + CARD8 /* class */, + Atom /* name */, + WindowPtr /* pWin */, + ClientPtr /* pClient */ +); + +extern void XkbSendAccessXNotify( + DeviceIntPtr /* kbd */, + xkbAccessXNotify * /* pEv */ +); + +extern void XkbSendNamesNotify( + DeviceIntPtr /* kbd */, + xkbNamesNotify * /* ev */ +); + +extern void XkbSendCompatNotify( + DeviceIntPtr /* kbd */, + xkbCompatMapNotify * /* ev */ +); + +extern void XkbSendActionMessage( + DeviceIntPtr /* kbd */, + xkbActionMessage * /* ev */ +); + +extern void XkbSendExtensionDeviceNotify( + DeviceIntPtr /* kbd */, + ClientPtr /* client */, + xkbExtensionDeviceNotify * /* ev */ +); + +extern void XkbSendNotification( + DeviceIntPtr /* kbd */, + XkbChangesPtr /* pChanges */, + XkbEventCausePtr /* cause */ +); + +extern void XkbProcessKeyboardEvent( + struct _xEvent * /* xE */, + DeviceIntPtr /* keybd */, + int /* count */ +); + +extern void XkbProcessOtherEvent( + struct _xEvent * /* xE */, + DeviceIntPtr /* keybd */, + int /* count */ +); + +extern void XkbHandleActions( + DeviceIntPtr /* dev */, + DeviceIntPtr /* kbd */, + struct _xEvent * /* xE */, + int /* count */ +); + +extern Bool XkbEnableDisableControls( + XkbSrvInfoPtr /* xkbi */, + unsigned long /* change */, + unsigned long /* newValues */, + XkbChangesPtr /* changes */, + XkbEventCausePtr /* cause */ +); + +extern void AccessXInit( + DeviceIntPtr /* dev */ +); + +extern Bool AccessXFilterPressEvent( + register struct _xEvent * /* xE */, + register DeviceIntPtr /* keybd */, + int /* count */ +); + +extern Bool AccessXFilterReleaseEvent( + register struct _xEvent * /* xE */, + register DeviceIntPtr /* keybd */, + int /* count */ +); + +extern void AccessXCancelRepeatKey( + XkbSrvInfoPtr /* xkbi */, + KeyCode /* key */ +); + +extern void AccessXComputeCurveFactor( + XkbSrvInfoPtr /* xkbi */, + XkbControlsPtr /* ctrls */ +); + +extern XkbDeviceLedInfoPtr XkbAddDeviceLedInfo( + XkbDeviceInfoPtr /* devi */, + unsigned int /* ledClass */, + unsigned int /* ledId */ +); + +extern XkbDeviceInfoPtr XkbAllocDeviceInfo( + unsigned int /* deviceSpec */, + unsigned int /* nButtons */, + unsigned int /* szLeds */ +); + +extern void XkbFreeDeviceInfo( + XkbDeviceInfoPtr /* devi */, + unsigned int /* which */, + Bool /* freeDevI */ +); + +extern Status XkbResizeDeviceButtonActions( + XkbDeviceInfoPtr /* devi */, + unsigned int /* newTotal */ +); + +extern XkbInterestPtr XkbFindClientResource( + DevicePtr /* inDev */, + ClientPtr /* client */ +); + +extern XkbInterestPtr XkbAddClientResource( + DevicePtr /* inDev */, + ClientPtr /* client */, + XID /* id */ +); + +extern int XkbRemoveClient( + DevicePtr /* inDev */, + ClientPtr /* client */ +); + +extern int XkbRemoveResourceClient( + DevicePtr /* inDev */, + XID /* id */ +); + +extern int XkbDDXInitDevice( + DeviceIntPtr /* dev */ +); + +extern int XkbDDXAccessXBeep( + DeviceIntPtr /* dev */, + unsigned int /* what */, + unsigned int /* which */ +); + +extern void XkbDDXKeyClick( + DeviceIntPtr /* dev */, + int /* keycode */, + int /* synthetic */ +); + +extern int XkbDDXUsesSoftRepeat( + DeviceIntPtr /* dev */ +); + +extern void XkbDDXKeybdCtrlProc( + DeviceIntPtr /* dev */, + KeybdCtrl * /* ctrl */ +); + +extern void XkbDDXChangeControls( + DeviceIntPtr /* dev */, + XkbControlsPtr /* old */, + XkbControlsPtr /* new */ +); + +extern void XkbDDXUpdateIndicators( + DeviceIntPtr /* keybd */, + CARD32 /* newState */ +); + +extern void XkbDDXUpdateDeviceIndicators( + DeviceIntPtr /* dev */, + XkbSrvLedInfoPtr /* sli */, + CARD32 /* newState */ +); + +extern void XkbDDXFakePointerButton( + int /* event */, + int /* button */ +); + +extern void XkbDDXFakePointerMotion( + unsigned int /* flags */, + int /* x */, + int /* y */ +); + +extern void XkbDDXFakeDeviceButton( + DeviceIntPtr /* dev */, + Bool /* press */, + int /* button */ +); + +extern int XkbDDXTerminateServer( + DeviceIntPtr /* dev */, + KeyCode /* key */, + XkbAction * /* act */ +); + +extern int XkbDDXSwitchScreen( + DeviceIntPtr /* dev */, + KeyCode /* key */, + XkbAction * /* act */ +); + +extern int XkbDDXPrivate( + DeviceIntPtr /* dev */, + KeyCode /* key */, + XkbAction * /* act */ +); + +extern void XkbDisableComputedAutoRepeats( + DeviceIntPtr /* pXDev */, + unsigned int /* key */ +); + +extern void XkbSetRepeatKeys( + DeviceIntPtr /* pXDev */, + int /* key */, + int /* onoff */ +); + +extern int XkbLatchModifiers( + DeviceIntPtr /* pXDev */, + CARD8 /* mask */, + CARD8 /* latches */ +); + +extern int XkbLatchGroup( + DeviceIntPtr /* pXDev */, + int /* group */ +); + +extern void XkbClearAllLatchesAndLocks( + DeviceIntPtr /* dev */, + XkbSrvInfoPtr /* xkbi */, + Bool /* genEv */, + XkbEventCausePtr /* cause */ +); + +extern void XkbSetRulesDflts( + char * /* rulesFile */, + char * /* model */, + char * /* layout */, + char * /* variant */, + char * /* options */ +); + +extern void XkbInitDevice( + DeviceIntPtr /* pXDev */ +); + +extern Bool XkbInitKeyboardDeviceStruct( + DeviceIntPtr /* pXDev */, + XkbComponentNamesPtr /* pNames */, + KeySymsPtr /* pSyms */, + CARD8 /* pMods */[], + BellProcPtr /* bellProc */, + KbdCtrlProcPtr /* ctrlProc */ +); + +extern int SProcXkbDispatch( + ClientPtr /* client */ +); + +extern XkbGeometryPtr XkbLookupNamedGeometry( + DeviceIntPtr /* dev */, + Atom /* name */, + Bool * /* shouldFree */ +); + +extern void XkbConvertCase( + KeySym /* sym */, + KeySym * /* lower */, + KeySym * /* upper */ +); + +extern Status XkbChangeKeycodeRange( + XkbDescPtr /* xkb */, + int /* minKC */, + int /* maxKC */, + XkbChangesPtr /* changes */ +); + +extern int XkbFinishDeviceInit( + DeviceIntPtr /* pXDev */ +); + +extern void XkbFreeSrvLedInfo( + XkbSrvLedInfoPtr /* sli */ +); + +extern void XkbFreeInfo( + XkbSrvInfoPtr /* xkbi */ +); + +extern Status XkbChangeTypesOfKey( + XkbDescPtr /* xkb */, + int /* key */, + int /* nGroups */, + unsigned int /* groups */, + int * /* newTypesIn */, + XkbMapChangesPtr /* changes */ +); + +extern XkbKeyTypePtr XkbAddKeyType( + XkbDescPtr /* xkb */, + Atom /* name */, + int /* map_count */, + Bool /* want_preserve */, + int /* num_lvls */ +); + +extern Status XkbInitCanonicalKeyTypes( + XkbDescPtr /* xkb */, + unsigned int /* which */, + int /* keypadVMod */ +); + +extern int XkbKeyTypesForCoreSymbols( + XkbDescPtr /* xkb */, + int /* map_width */, + KeySym * /* core_syms */, + unsigned int /* protected */, + int * /* types_inout */, + KeySym * /* xkb_syms_rtrn */ +); + +extern Bool XkbApplyCompatMapToKey( + XkbDescPtr /* xkb */, + KeyCode /* key */, + XkbChangesPtr /* changes */ +); + +extern Bool XkbUpdateMapFromCore( + XkbDescPtr /* xkb */, + KeyCode /* first_key */, + int /* num_keys */, + int /* map_width */, + KeySym * /* core_keysyms */, + XkbChangesPtr /* changes */ +); + +extern void XkbFreeControls( + XkbDescPtr /* xkb */, + unsigned int /* which */, + Bool /* freeMap */ +); + +extern void XkbFreeIndicatorMaps( + XkbDescPtr /* xkb */ +); + +extern Bool XkbApplyVirtualModChanges( + XkbDescPtr /* xkb */, + unsigned int /* changed */, + XkbChangesPtr /* changes */ +); + +extern Bool XkbUpdateActionVirtualMods( + XkbDescPtr /* xkb */, + XkbAction * /* act */, + unsigned int /* changed */ +); + +extern void XkbUpdateKeyTypeVirtualMods( + XkbDescPtr /* xkb */, + XkbKeyTypePtr /* type */, + unsigned int /* changed */, + XkbChangesPtr /* changes */ +); + +extern void XkbSendNewKeyboardNotify( + DeviceIntPtr /* kbd */, + xkbNewKeyboardNotify * /* pNKN */ +); + + +#include <nx-X11/extensions/XKMformat.h> +#include "xkbfile.h" +#include "xkbrules.h" + +#define _XkbListKeymaps 0 +#define _XkbListKeycodes 1 +#define _XkbListTypes 2 +#define _XkbListCompat 3 +#define _XkbListSymbols 4 +#define _XkbListGeometry 5 +#define _XkbListNumComponents 6 + +typedef struct _XkbSrvListInfo { + int szPool; + int nPool; + char * pool; + + int maxRtrn; + int nTotal; + + char * pattern[_XkbListNumComponents]; + int nFound[_XkbListNumComponents]; +} XkbSrvListInfoRec,*XkbSrvListInfoPtr; + +char * +XkbGetRulesDflts( + XkbRF_VarDefsPtr /* defs */ +); + +extern void XkbSetRulesUsed( + XkbRF_VarDefsPtr /* defs */ +); + + +extern Status XkbDDXList( + DeviceIntPtr /* dev */, + XkbSrvListInfoPtr /* listing */, + ClientPtr /* client */ +); + +extern unsigned int XkbDDXLoadKeymapByNames( + DeviceIntPtr /* keybd */, + XkbComponentNamesPtr /* names */, + unsigned int /* want */, + unsigned int /* need */, + XkbFileInfoPtr /* finfoRtrn */, + char * /* keymapNameRtrn */, + int /* keymapNameRtrnLen */ +); + +extern Bool XkbDDXNamesFromRules( + DeviceIntPtr /* keybd */, + char * /* rules */, + XkbRF_VarDefsPtr /* defs */, + XkbComponentNamesPtr /* names */ +); + +extern FILE *XkbDDXOpenConfigFile( + char * /* mapName */, + char * /* fileNameRtrn */, + int /* fileNameRtrnLen */ +); + +extern Bool XkbDDXApplyConfig( + XPointer /* cfg_in */, + XkbSrvInfoPtr /* xkbi */ +); + +extern XPointer XkbDDXPreloadConfig( + char ** /* rulesFileRtrn */, + XkbRF_VarDefsPtr /* defs */, + XkbComponentNamesPtr /* names */, + DeviceIntPtr /* dev */ +); + +extern int _XkbStrCaseCmp( + char * /* str1 */, + char * /* str2 */ +); + + + +_XFUNCPROTOEND + +#endif /* _XKBSRV_H_ */ + + diff --git a/nx-X11/programs/Xserver/include/xkbstr.h b/nx-X11/programs/Xserver/include/xkbstr.h new file mode 100644 index 000000000..f3c901805 --- /dev/null +++ b/nx-X11/programs/Xserver/include/xkbstr.h @@ -0,0 +1,608 @@ +/************************************************************ +Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. + +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 Silicon Graphics not be +used in advertising or publicity pertaining to distribution +of the software without specific prior written permission. +Silicon Graphics makes no representation about the suitability +of this software for any purpose. It is provided "as is" +without any express or implied warranty. + +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON +GRAPHICS 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 _XKBSTR_H_ +#define _XKBSTR_H_ + +#include <nx-X11/extensions/XKB.h> + +#define XkbCharToInt(v) ((v)&0x80?(int)((v)|(~0xff)):(int)((v)&0x7f)) +#define XkbIntTo2Chars(i,h,l) (((h)=((i>>8)&0xff)),((l)=((i)&0xff))) + +#define Xkb2CharsToInt(h,l) ((short)(((h)<<8)|(l))) + + /* + * Common data structures and access macros + */ + +typedef struct _XkbStateRec { + unsigned char group; + unsigned char locked_group; + unsigned short base_group; + unsigned short latched_group; + unsigned char mods; + unsigned char base_mods; + unsigned char latched_mods; + unsigned char locked_mods; + unsigned char compat_state; + unsigned char grab_mods; + unsigned char compat_grab_mods; + unsigned char lookup_mods; + unsigned char compat_lookup_mods; + unsigned short ptr_buttons; +} XkbStateRec,*XkbStatePtr; +#define XkbModLocks(s) ((s)->locked_mods) +#define XkbStateMods(s) ((s)->base_mods|(s)->latched_mods|XkbModLocks(s)) +#define XkbGroupLock(s) ((s)->locked_group) +#define XkbStateGroup(s) ((s)->base_group+(s)->latched_group+XkbGroupLock(s)) +#define XkbStateFieldFromRec(s) XkbBuildCoreState((s)->lookup_mods,(s)->group) +#define XkbGrabStateFromRec(s) XkbBuildCoreState((s)->grab_mods,(s)->group) + +typedef struct _XkbMods { + unsigned char mask; /* effective mods */ + unsigned char real_mods; + unsigned short vmods; +} XkbModsRec,*XkbModsPtr; + +typedef struct _XkbKTMapEntry { + Bool active; + unsigned char level; + XkbModsRec mods; +} XkbKTMapEntryRec,*XkbKTMapEntryPtr; + +typedef struct _XkbKeyType { + XkbModsRec mods; + unsigned char num_levels; + unsigned char map_count; + XkbKTMapEntryPtr map; + XkbModsPtr preserve; + Atom name; + Atom * level_names; +} XkbKeyTypeRec, *XkbKeyTypePtr; + +#define XkbNumGroups(g) ((g)&0x0f) +#define XkbOutOfRangeGroupInfo(g) ((g)&0xf0) +#define XkbOutOfRangeGroupAction(g) ((g)&0xc0) +#define XkbOutOfRangeGroupNumber(g) (((g)&0x30)>>4) +#define XkbSetGroupInfo(g,w,n) (((w)&0xc0)|(((n)&3)<<4)|((g)&0x0f)) +#define XkbSetNumGroups(g,n) (((g)&0xf0)|((n)&0x0f)) + + /* + * Structures and access macros used primarily by the server + */ + +typedef struct _XkbBehavior { + unsigned char type; + unsigned char data; +} XkbBehavior; + +#define XkbAnyActionDataSize 7 +typedef struct _XkbAnyAction { + unsigned char type; + unsigned char data[XkbAnyActionDataSize]; +} XkbAnyAction; + +typedef struct _XkbModAction { + unsigned char type; + unsigned char flags; + unsigned char mask; + unsigned char real_mods; + unsigned char vmods1; + unsigned char vmods2; +} XkbModAction; +#define XkbModActionVMods(a) \ + ((short)(((a)->vmods1<<8)|((a)->vmods2))) +#define XkbSetModActionVMods(a,v) \ + (((a)->vmods1=(((v)>>8)&0xff)),(a)->vmods2=((v)&0xff)) + +typedef struct _XkbGroupAction { + unsigned char type; + unsigned char flags; + char group_XXX; +} XkbGroupAction; +#define XkbSAGroup(a) (XkbCharToInt((a)->group_XXX)) +#define XkbSASetGroup(a,g) ((a)->group_XXX=(g)) + +typedef struct _XkbISOAction { + unsigned char type; + unsigned char flags; + unsigned char mask; + unsigned char real_mods; + char group_XXX; + unsigned char affect; + unsigned char vmods1; + unsigned char vmods2; +} XkbISOAction; + +typedef struct _XkbPtrAction { + unsigned char type; + unsigned char flags; + unsigned char high_XXX; + unsigned char low_XXX; + unsigned char high_YYY; + unsigned char low_YYY; +} XkbPtrAction; +#define XkbPtrActionX(a) (Xkb2CharsToInt((a)->high_XXX,(a)->low_XXX)) +#define XkbPtrActionY(a) (Xkb2CharsToInt((a)->high_YYY,(a)->low_YYY)) +#define XkbSetPtrActionX(a,x) (XkbIntTo2Chars(x,(a)->high_XXX,(a)->low_XXX)) +#define XkbSetPtrActionY(a,y) (XkbIntTo2Chars(y,(a)->high_YYY,(a)->low_YYY)) + +typedef struct _XkbPtrBtnAction { + unsigned char type; + unsigned char flags; + unsigned char count; + unsigned char button; +} XkbPtrBtnAction; + +typedef struct _XkbPtrDfltAction { + unsigned char type; + unsigned char flags; + unsigned char affect; + char valueXXX; +} XkbPtrDfltAction; +#define XkbSAPtrDfltValue(a) (XkbCharToInt((a)->valueXXX)) +#define XkbSASetPtrDfltValue(a,c) ((a)->valueXXX= ((c)&0xff)) + +typedef struct _XkbSwitchScreenAction { + unsigned char type; + unsigned char flags; + char screenXXX; +} XkbSwitchScreenAction; +#define XkbSAScreen(a) (XkbCharToInt((a)->screenXXX)) +#define XkbSASetScreen(a,s) ((a)->screenXXX= ((s)&0xff)) + +typedef struct _XkbCtrlsAction { + unsigned char type; + unsigned char flags; + unsigned char ctrls3; + unsigned char ctrls2; + unsigned char ctrls1; + unsigned char ctrls0; +} XkbCtrlsAction; +#define XkbActionSetCtrls(a,c) (((a)->ctrls3=(((c)>>24)&0xff)),\ + ((a)->ctrls2=(((c)>>16)&0xff)),\ + ((a)->ctrls1=(((c)>>8)&0xff)),\ + ((a)->ctrls0=((c)&0xff))) +#define XkbActionCtrls(a) ((((unsigned int)(a)->ctrls3)<<24)|\ + (((unsigned int)(a)->ctrls2)<<16)|\ + (((unsigned int)(a)->ctrls1)<<8)|\ + ((unsigned int)((a)->ctrls0))) + +typedef struct _XkbMessageAction { + unsigned char type; + unsigned char flags; + unsigned char message[6]; +} XkbMessageAction; + +typedef struct _XkbRedirectKeyAction { + unsigned char type; + unsigned char new_key; + unsigned char mods_mask; + unsigned char mods; + unsigned char vmods_mask0; + unsigned char vmods_mask1; + unsigned char vmods0; + unsigned char vmods1; +} XkbRedirectKeyAction; + +#define XkbSARedirectVMods(a) ((((unsigned int)(a)->vmods1)<<8)|\ + ((unsigned int)(a)->vmods0)) +#define XkbSARedirectSetVMods(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),\ + ((a)->vmods_mask0=((m)&0xff))) +#define XkbSARedirectVModsMask(a) ((((unsigned int)(a)->vmods_mask1)<<8)|\ + ((unsigned int)(a)->vmods_mask0)) +#define XkbSARedirectSetVModsMask(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),\ + ((a)->vmods_mask0=((m)&0xff))) + +typedef struct _XkbDeviceBtnAction { + unsigned char type; + unsigned char flags; + unsigned char count; + unsigned char button; + unsigned char device; +} XkbDeviceBtnAction; + +typedef struct _XkbDeviceValuatorAction { + unsigned char type; + unsigned char device; + unsigned char v1_what; + unsigned char v1_ndx; + unsigned char v1_value; + unsigned char v2_what; + unsigned char v2_ndx; + unsigned char v2_value; +} XkbDeviceValuatorAction; + +typedef union _XkbAction { + XkbAnyAction any; + XkbModAction mods; + XkbGroupAction group; + XkbISOAction iso; + XkbPtrAction ptr; + XkbPtrBtnAction btn; + XkbPtrDfltAction dflt; + XkbSwitchScreenAction screen; + XkbCtrlsAction ctrls; + XkbMessageAction msg; + XkbRedirectKeyAction redirect; + XkbDeviceBtnAction devbtn; + XkbDeviceValuatorAction devval; + unsigned char type; +} XkbAction; + +typedef struct _XkbControls { + unsigned char mk_dflt_btn; + unsigned char num_groups; + unsigned char groups_wrap; + XkbModsRec internal; + XkbModsRec ignore_lock; + unsigned int enabled_ctrls; + unsigned short repeat_delay; + unsigned short repeat_interval; + unsigned short slow_keys_delay; + unsigned short debounce_delay; + unsigned short mk_delay; + unsigned short mk_interval; + unsigned short mk_time_to_max; + unsigned short mk_max_speed; + short mk_curve; + unsigned short ax_options; + unsigned short ax_timeout; + unsigned short axt_opts_mask; + unsigned short axt_opts_values; + unsigned int axt_ctrls_mask; + unsigned int axt_ctrls_values; + unsigned char per_key_repeat[XkbPerKeyBitArraySize]; +} XkbControlsRec, *XkbControlsPtr; + +#define XkbAX_AnyFeedback(c) ((c)->enabled_ctrls&XkbAccessXFeedbackMask) +#define XkbAX_NeedOption(c,w) ((c)->ax_options&(w)) +#define XkbAX_NeedFeedback(c,w) (XkbAX_AnyFeedback(c)&&XkbAX_NeedOption(c,w)) + +typedef struct _XkbServerMapRec { + unsigned short num_acts; + unsigned short size_acts; + XkbAction *acts; + + XkbBehavior *behaviors; + unsigned short *key_acts; +#if defined(__cplusplus) || defined(c_plusplus) + /* explicit is a C++ reserved word */ + unsigned char *c_explicit; +#else + unsigned char *explicit; +#endif + unsigned char vmods[XkbNumVirtualMods]; + unsigned short *vmodmap; +} XkbServerMapRec, *XkbServerMapPtr; + +#define XkbSMKeyActionsPtr(m,k) (&(m)->acts[(m)->key_acts[k]]) + + /* + * Structures and access macros used primarily by clients + */ + +typedef struct _XkbSymMapRec { + unsigned char kt_index[XkbNumKbdGroups]; + unsigned char group_info; + unsigned char width; + unsigned short offset; +} XkbSymMapRec, *XkbSymMapPtr; + +typedef struct _XkbClientMapRec { + unsigned char size_types; + unsigned char num_types; + XkbKeyTypePtr types; + + unsigned short size_syms; + unsigned short num_syms; + KeySym *syms; + XkbSymMapPtr key_sym_map; + + unsigned char *modmap; +} XkbClientMapRec, *XkbClientMapPtr; + +#define XkbCMKeyGroupInfo(m,k) ((m)->key_sym_map[k].group_info) +#define XkbCMKeyNumGroups(m,k) (XkbNumGroups((m)->key_sym_map[k].group_info)) +#define XkbCMKeyGroupWidth(m,k,g) (XkbCMKeyType(m,k,g)->num_levels) +#define XkbCMKeyGroupsWidth(m,k) ((m)->key_sym_map[k].width) +#define XkbCMKeyTypeIndex(m,k,g) ((m)->key_sym_map[k].kt_index[g&0x3]) +#define XkbCMKeyType(m,k,g) (&(m)->types[XkbCMKeyTypeIndex(m,k,g)]) +#define XkbCMKeyNumSyms(m,k) (XkbCMKeyGroupsWidth(m,k)*XkbCMKeyNumGroups(m,k)) +#define XkbCMKeySymsOffset(m,k) ((m)->key_sym_map[k].offset) +#define XkbCMKeySymsPtr(m,k) (&(m)->syms[XkbCMKeySymsOffset(m,k)]) + + /* + * Compatibility structures and access macros + */ + +typedef struct _XkbSymInterpretRec { + KeySym sym; + unsigned char flags; + unsigned char match; + unsigned char mods; + unsigned char virtual_mod; + XkbAnyAction act; +} XkbSymInterpretRec,*XkbSymInterpretPtr; + +typedef struct _XkbCompatMapRec { + XkbSymInterpretPtr sym_interpret; + XkbModsRec groups[XkbNumKbdGroups]; + unsigned short num_si; + unsigned short size_si; +} XkbCompatMapRec, *XkbCompatMapPtr; + +typedef struct _XkbIndicatorMapRec { + unsigned char flags; + unsigned char which_groups; + unsigned char groups; + unsigned char which_mods; + XkbModsRec mods; + unsigned int ctrls; +} XkbIndicatorMapRec, *XkbIndicatorMapPtr; + +#define XkbIM_IsAuto(i) ((((i)->flags&XkbIM_NoAutomatic)==0)&&\ + (((i)->which_groups&&(i)->groups)||\ + ((i)->which_mods&&(i)->mods.mask)||\ + ((i)->ctrls))) +#define XkbIM_InUse(i) (((i)->flags)||((i)->which_groups)||\ + ((i)->which_mods)||((i)->ctrls)) + + +typedef struct _XkbIndicatorRec { + unsigned long phys_indicators; + XkbIndicatorMapRec maps[XkbNumIndicators]; +} XkbIndicatorRec,*XkbIndicatorPtr; + +typedef struct _XkbKeyNameRec { + char name[XkbKeyNameLength]; +} XkbKeyNameRec,*XkbKeyNamePtr; + +typedef struct _XkbKeyAliasRec { + char real[XkbKeyNameLength]; + char alias[XkbKeyNameLength]; +} XkbKeyAliasRec,*XkbKeyAliasPtr; + + /* + * Names for everything + */ +typedef struct _XkbNamesRec { + Atom keycodes; + Atom geometry; + Atom symbols; + Atom types; + Atom compat; + Atom vmods[XkbNumVirtualMods]; + Atom indicators[XkbNumIndicators]; + Atom groups[XkbNumKbdGroups]; + XkbKeyNamePtr keys; + XkbKeyAliasPtr key_aliases; + Atom *radio_groups; + Atom phys_symbols; + + unsigned char num_keys; + unsigned char num_key_aliases; + unsigned short num_rg; +} XkbNamesRec,*XkbNamesPtr; + +typedef struct _XkbGeometry *XkbGeometryPtr; + /* + * Tie it all together into one big keyboard description + */ +typedef struct _XkbDesc { + struct _XDisplay * dpy; + unsigned short flags; + unsigned short device_spec; + KeyCode min_key_code; + KeyCode max_key_code; + + XkbControlsPtr ctrls; + XkbServerMapPtr server; + XkbClientMapPtr map; + XkbIndicatorPtr indicators; + XkbNamesPtr names; + XkbCompatMapPtr compat; + XkbGeometryPtr geom; +} XkbDescRec, *XkbDescPtr; +#define XkbKeyKeyTypeIndex(d,k,g) (XkbCMKeyTypeIndex((d)->map,k,g)) +#define XkbKeyKeyType(d,k,g) (XkbCMKeyType((d)->map,k,g)) +#define XkbKeyGroupWidth(d,k,g) (XkbCMKeyGroupWidth((d)->map,k,g)) +#define XkbKeyGroupsWidth(d,k) (XkbCMKeyGroupsWidth((d)->map,k)) +#define XkbKeyGroupInfo(d,k) (XkbCMKeyGroupInfo((d)->map,(k))) +#define XkbKeyNumGroups(d,k) (XkbCMKeyNumGroups((d)->map,(k))) +#define XkbKeyNumSyms(d,k) (XkbCMKeyNumSyms((d)->map,(k))) +#define XkbKeySymsPtr(d,k) (XkbCMKeySymsPtr((d)->map,(k))) +#define XkbKeySym(d,k,n) (XkbKeySymsPtr(d,k)[n]) +#define XkbKeySymEntry(d,k,sl,g) \ + (XkbKeySym(d,k,((XkbKeyGroupsWidth(d,k)*(g))+(sl)))) +#define XkbKeyAction(d,k,n) \ + (XkbKeyHasActions(d,k)?&XkbKeyActionsPtr(d,k)[n]:NULL) +#define XkbKeyActionEntry(d,k,sl,g) \ + (XkbKeyHasActions(d,k)?\ + XkbKeyAction(d,k,((XkbKeyGroupsWidth(d,k)*(g))+(sl))):NULL) + +#define XkbKeyHasActions(d,k) ((d)->server->key_acts[k]!=0) +#define XkbKeyNumActions(d,k) (XkbKeyHasActions(d,k)?XkbKeyNumSyms(d,k):1) +#define XkbKeyActionsPtr(d,k) (XkbSMKeyActionsPtr((d)->server,k)) +#define XkbKeycodeInRange(d,k) (((k)>=(d)->min_key_code)&&\ + ((k)<=(d)->max_key_code)) +#define XkbNumKeys(d) ((d)->max_key_code-(d)->min_key_code+1) + + + /* + * The following structures can be used to track changes + * to a keyboard device + */ +typedef struct _XkbMapChanges { + unsigned short changed; + KeyCode min_key_code; + KeyCode max_key_code; + unsigned char first_type; + unsigned char num_types; + KeyCode first_key_sym; + unsigned char num_key_syms; + KeyCode first_key_act; + unsigned char num_key_acts; + KeyCode first_key_behavior; + unsigned char num_key_behaviors; + KeyCode first_key_explicit; + unsigned char num_key_explicit; + KeyCode first_modmap_key; + unsigned char num_modmap_keys; + KeyCode first_vmodmap_key; + unsigned char num_vmodmap_keys; + unsigned char pad; + unsigned short vmods; +} XkbMapChangesRec,*XkbMapChangesPtr; + +typedef struct _XkbControlsChanges { + unsigned int changed_ctrls; + unsigned int enabled_ctrls_changes; + Bool num_groups_changed; +} XkbControlsChangesRec,*XkbControlsChangesPtr; + +typedef struct _XkbIndicatorChanges { + unsigned int state_changes; + unsigned int map_changes; +} XkbIndicatorChangesRec,*XkbIndicatorChangesPtr; + +typedef struct _XkbNameChanges { + unsigned int changed; + unsigned char first_type; + unsigned char num_types; + unsigned char first_lvl; + unsigned char num_lvls; + unsigned char num_aliases; + unsigned char num_rg; + unsigned char first_key; + unsigned char num_keys; + unsigned short changed_vmods; + unsigned long changed_indicators; + unsigned char changed_groups; +} XkbNameChangesRec,*XkbNameChangesPtr; + +typedef struct _XkbCompatChanges { + unsigned char changed_groups; + unsigned short first_si; + unsigned short num_si; +} XkbCompatChangesRec,*XkbCompatChangesPtr; + +typedef struct _XkbChanges { + unsigned short device_spec; + unsigned short state_changes; + XkbMapChangesRec map; + XkbControlsChangesRec ctrls; + XkbIndicatorChangesRec indicators; + XkbNameChangesRec names; + XkbCompatChangesRec compat; +} XkbChangesRec, *XkbChangesPtr; + + /* + * These data structures are used to construct a keymap from + * a set of components or to list components in the server + * database. + */ +typedef struct _XkbComponentNames { + char * keymap; + char * keycodes; + char * types; + char * compat; + char * symbols; + char * geometry; +} XkbComponentNamesRec, *XkbComponentNamesPtr; + +typedef struct _XkbComponentName { + unsigned short flags; + char * name; +} XkbComponentNameRec,*XkbComponentNamePtr; + +typedef struct _XkbComponentList { + int num_keymaps; + int num_keycodes; + int num_types; + int num_compat; + int num_symbols; + int num_geometry; + XkbComponentNamePtr keymaps; + XkbComponentNamePtr keycodes; + XkbComponentNamePtr types; + XkbComponentNamePtr compat; + XkbComponentNamePtr symbols; + XkbComponentNamePtr geometry; +} XkbComponentListRec, *XkbComponentListPtr; + + /* + * The following data structures describe and track changes to a + * non-keyboard extension device + */ +typedef struct _XkbDeviceLedInfo { + unsigned short led_class; + unsigned short led_id; + unsigned int phys_indicators; + unsigned int maps_present; + unsigned int names_present; + unsigned int state; + Atom names[XkbNumIndicators]; + XkbIndicatorMapRec maps[XkbNumIndicators]; +} XkbDeviceLedInfoRec,*XkbDeviceLedInfoPtr; + +typedef struct _XkbDeviceInfo { + char * name; + Atom type; + unsigned short device_spec; + Bool has_own_state; + unsigned short supported; + unsigned short unsupported; + + unsigned short num_btns; + XkbAction * btn_acts; + + unsigned short sz_leds; + unsigned short num_leds; + unsigned short dflt_kbd_fb; + unsigned short dflt_led_fb; + XkbDeviceLedInfoPtr leds; +} XkbDeviceInfoRec,*XkbDeviceInfoPtr; + +#define XkbXI_DevHasBtnActs(d) (((d)->num_btns>0)&&((d)->btn_acts!=NULL)) +#define XkbXI_LegalDevBtn(d,b) (XkbXI_DevHasBtnActs(d)&&((b)<(d)->num_btns)) +#define XkbXI_DevHasLeds(d) (((d)->num_leds>0)&&((d)->leds!=NULL)) + +typedef struct _XkbDeviceLedChanges { + unsigned short led_class; + unsigned short led_id; + unsigned int defined; /* names or maps changed */ + struct _XkbDeviceLedChanges *next; +} XkbDeviceLedChangesRec,*XkbDeviceLedChangesPtr; + +typedef struct _XkbDeviceChanges { + unsigned int changed; + unsigned short first_btn; + unsigned short num_btns; + XkbDeviceLedChangesRec leds; +} XkbDeviceChangesRec,*XkbDeviceChangesPtr; + +#endif /* _XKBSTR_H_ */ |
